[En-Nut-Discussion] nut/os unix port preview available

Matthias Ringwald mringwal at inf.ethz.ch
Thu Apr 1 18:00:47 CEST 2004


Hi all.

after some work, I'm happy with the basic nut/os unix simulation.
this means: threads, interrupts are working, some basic uart I/O is 
available.
(and the code is good enough to have a look at it)


The Outline:

THREADS: every nut/os thread is simulated by a pthread.
of those, only one is running at a time by using condition variables
to switch from one pthread to the next pthread (when nut/os decides
to that threads has to switch)

IRQ: IRQs are simulated using the SIGUSR1 signal.
critical sections are modelled by blocking this signal.
if there is no critical section of the running thread, the signal
is received by it and gets processed.

to allow for multiple IRQ sources, an extra thread is used that
dispatches occured IRQs to their IRQ handler.

so far, the only interrupt is the RTC interrupt, that simulates
a RTC tick every 1 ms.

UARTs: instead of the avr hw uarts, stdio and native devices can be 
used.


EXAMPLES: with this, the simple, threads, timers and uart example work.

Instructions:
in ./configure, select 4) unix emulation
then build everyting: make

go to one of the working examples in app/ and build it.

to map uart0 and/or uart1 to a specific device
you can use the command line options:
-u0 devName -u1 devName

you can get it at:
http://vs16.ethz.ch/nut-unix-snapshot.zip


so. comments will be welcomed...,
let's see if it will talk to the Bluetooth module soon.

matthias ringwald






More information about the En-Nut-Discussion mailing list