[En-Nut-Discussion] Nut/OS Simulation on Host PC
Ralph Mason
ralph.mason at telogis.com
Tue Mar 2 04:37:54 CET 2004
I can't make it fully available yet.
I did thread switching the exact same way as nutos does except I use a
single OS thread to simulate all the nut threads and manually switch the
stack pointer of the Win32 thread. This technique should work with any
OS though.
Yes, I 'emulated' the serial drivers (well really just wrote a nut
driver that called the OS driver) so when running on the hardware you
call fopen('uarta') on a windows box you would call fopen('com1')
Attached is thread.c that does switching of threads for 80x86.
Ralph
Matthias Ringwald wrote:
> Dear Mr. Mason,
>
> I just found your mail about porting Nut/OS to a Windows PC.
>
> I'm very interested in this port, because I have the same need
> (write and debug apps on the pc before even starting the programmer)
>
> Could you make the port available to me?
> Could it be made available to others, too?
>
>
> I want to run nut/os on mac and/or linux.
>
> How did you simulate the thread switching?
>
> I thought I could use a posix thread for every nut/os thread
> and have all but one of them block on a semaphore (or whatever it is
> called)
> if a nut/os thread switch oocures the running thread could first signal
> the next thread to start and then block itself again on the semaphore.
>
> did you emulate the uart drivers too?
>
> so far, on our btnode platform (www.btnode.ethz.ch) we had a simple
> dispatcher 'os', and simulating this on linux was quite straight forward.
>
>
> thanks,
> Matthias Ringwald
> ETH Zürich
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: thread.c
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20040302/65be64e5/attachment.c>
More information about the En-Nut-Discussion
mailing list