Re: [cc65] The Contiki Desktop OS for cc65

Date view Thread view Subject view

From: Adam Dunkels (
Date: 2003-03-16 01:12:12


On Fri, 2003-03-14 at 22:19, Groepaz wrote:
> On Friday 14 March 2003 22:04, Shawn Jefferson wrote:
> > I know nothing about loadable modules (I couldn't figure out exactly what
> > you need to do  to compile a module and load it.)  I wonder if loadable
> > modules could be used to swap parts of the program from extended to regular
> > memory, with some changes?
> loadable modules are on adams list.... ie, some time in the future each 
> contiki application is supposed to be a loadable module.

Yepp, that's the genereal idea: each application is a loadable module
that is loaded using the regular cc65 module loader/relocator. I haven't
used the module loader myself, so I'm not sure how much hassle this will
be, but Uz seemed to think this would work (right Uz? :-)

As Uz wrote in another mail in this thread, it isn't possible (or at
least not advisable) to have dynamically linked functions in the module
(i.e., the Contiki application program). So, instead we statically link
all external functions and variables in the application program to the
memory mappings of a well-defined Contiki version. For instance, lets
say Contiki 1.1 gets loadable program support. In the C64 version of
Contiki 1.1, the function ctk_widget_redraw() is put in memory 0x3ce1.
Now, when we compile and link our Contiki application programs, all
calls to ctk_widget_redraw() will be statically linked so that they will
correspond to a call too 0x3ec1.

Furthermore, the Contiki task manager is designed with this in mind. In
Contiki, each new process is started by a call to the program's init()
function. This function will set up function pointers for the signal
handler function, the uIP callback function and the idle function. The
Contiki system does not know of these in advance, but they are
completely controlled by the application program. This means that
Contiki only needs to know a single function in the application program
- and we can define this function so that it is located at the first
byte in the object file. 

> > Another option, and no disrespect towards Adam and other developers of
> > Contiki: do we (Atari people, but maybe all 8-bitters) really need a
> > multitasking environment?  We could compile each app seperately (web
> > browser, email client, telnet client, web server, etc.) and use some other
> > means for switching between two or more separate apps (such as Tom Hunt's
> > Snapshot.)
> removing the multitasking but wont save to much....and in turn add a lot of 
> hazzle...not worth the effort imho.

In fact, multitasking is central to the design of Contiki, so it not
only is impossible to turn it off, it also would not make the system any

Adam Dunkels <>

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-03-16 01:13:16 CET