Re: [cc65] The Contiki Desktop OS for cc65

Date view Thread view Subject view

From: Adam Dunkels (adam_at_sics.se)
Date: 2003-03-11 23:41:43


Hi!

On Tue, 2003-03-11 at 18:40, M Ancher wrote:
> First let me tell ya': I'm impressed. Thank you.

Thanks! :-)

> *Disk access*
> I see why it is so small. There's no disk-operating-system ("DOS") in
> the OS. This will make the system less complex.

Adding disk support for Contiki will require a little bit of extra code,
but nothing that makes the system significantly larger. Especially for
cc65 target systems, as it often is possible to make use of ROM
routines.

The main problem with using ROM routines (at least on the C64) is that
they don't work well together with the RS232 NMIs. There are a few ways
to remedy this - one would be to see to it that disk access never
happens while the RS232 is active. It is a little tricky to implement in
practice, but one way would be to queue all disk requests for later
processing while the RS232 driver is busy reading a packet. When the
packet is read and processed, the disk driver could turn off the RS232
driver and pull one request from the queue and service it, and then turn
the RS232 driver back on when the disk request is finished.

It would be a large performance hit, however, as it would lead to
dropped packets and really bad network performance.

An asyncronous fastloader is a better solution - faster than the C64
kernal routines and works with the RS232 NMIs. It wouldn't work with
hard drives, though.

> Maybe Contiki is just a toolkit a programmer can use for his own
> programs, and not an OS.

Yes, that's exactly what an operating system is - a toolkit a programmer
can use for his own programs ;-) It is an abstraction layer between the
hardware and other software.

> *API*
> Will there be an API, so we'll know which kernel call are "public", and
> which are "private"? Maybe there's som "must-implement-methods".

Yes, there is a kernel API that is quite simple... but it isn't
documented yet. It consists of the following functions:

/* Start a new process */
ek_id_t dispatcher_start(struct dispatcher_proc *p);

/* Listen to a specified signal */
void dispatcher_listen(ek_signal_t s);

/* Set a timer */
void dispatcher_timer(ek_signal_t s, ek_data_t data, ek_ticks_t t);

/* Allocate a signal */
ek_signal_t dispatcher_sigalloc(void);

/* Emit a signal */
ek_err_t dispatcher_emit(ek_signal_t s, ek_data_t data, ek_id_t id);

There is one thing that must be done by every Contiki program, and that
is to call the dispatcher_start() function, which starts a new process
for the program. Without dispatcher_start(), there is no way for a
program to receive signals, and therefore no way for it to actually do
much.

Cheers,

/adam
-- 
Adam Dunkels <adam_at_sics.se>
http://www.sics.se/~adam/

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de 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-11 23:42:54 CET