[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Announcement: Contiki 1.3
Hi Rich,
>I'd really like to see and help code Contiki that uses multiple
>banks on Ramworks III aux RAM.
The Contiki source is freely available - just go ahead. BTW: Contiki
1.3 makes (very limited) use of banking. From the CVS readme.txt:
----------
Generally it's very hard to make use of memory mapping for an event
driven system like Contiki but the Apple //e allows to map only 8kB of
Aux memory to the address space $2000-$3FFF to facilitate double hires
graphics. this feature is accompanied by ProDOS 8 which allows to keep
/RAM generally active while doing double hires graphics by saving a
8kB file as first file to /RAM and thus preserving $2000-$3FFF of Aux
memory. Contiki makes use of all this double hires support while just
staying in text mode and using the 8kB as additional memory.
The additional 8kB are used to store the code of the uIP TCP/IP stack.
They are mapped in both on calls from the Contiki event kernel to the
TCP/IP stack process (poll and event handler) and calls to the uIP API
from programs. Most of the time the 8kB are just kept mapped in when
the uIP code calls other code. This is possible because the only
memory not reachable from the uIP code are the corresponding 8kB of
Main memory - and the Contiki kernel objects are linked in an order
which makes only CTK code (which is never called by uIP code) use that
8kB of Main memory. The only call from uIP code that triggers mapping
out the 8kB of Aux memory is the uIP upcall into a program for
processing incoming IP data as some program may potentially call CTK
code while processing that data.
Beside that Contiki makes use of the Language Card bank 2 to store the
code of the C-libary. Most of this 4 kB can be considered free
although officially marked as reserved by ProDOS 8. Only $D100-$D3FF
are actually used to store the ProDOS 8 dispatcher. As it is only used
after terminating Contiki it can be saved to /RAM on startup and
restored from there while cleanup.
The code doing all that code relocation gets overwritten on setting
the BSS segment to zero. The code doing this (and the C-library
initialization) gets overwritten later by the heap content.
----------
Best, Oliver