[TI-H] Re: help me with minix


[Prev][Index][Thread]

[TI-H] Re: help me with minix




I'm not seeing the problem here.  I think you would be able to run it in the
background just fine.  Realize that this is off the top of my head and you
have likely already thought about it all, but this seems reasonable.

Since you don't have a kernel (as in OS kernel, not like shell kernels which
were the worst idea ever), that's what you are essentially writing, in
addition to the stack.

Sending is easy.  You have the outgoing buffer, and on every timer
interrupt, you send some bytes.  The bytes would be sent from a send queue.
The queue would be a simple ring buffer for the sole purpose of sending
data.  You then check to see if the stack is running.  If it is, then exit.
Otherwise, run the stack, and flag that it is running.  When writing into
the send queue, you disable interrupts, so that in case the stack runs too
long, the send queue won't get corrupted.

Receiving is very similar.  When you get the link interrupt, you simply
place bytes into the receive queue.  Then check to see if the stack is
running, and if not, run it.  Interrupts would also have to be disabled when
reading from the receive queue.

As for being able to use memory in the interrupt handlers, there are various
methods of handling this, but I'm sure you can figure them out.

> Yes, there's an interrupt but I probably can't just base the _complete_
> stack
> on this routine. Imagine if there are coming 50 SLIP packets which are 3
> IP packets (fragmented). This system needs a lot of memory and it becomes
> VERY labil. The only possibility is that the stack is active as the user
> calls
> TiSockinit() in his user program. It's nearly impossible to run the stack
in
> background (also in AMS and other ASM programs) when you like to
> have a stable calculator.





References: