[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MiNT device drivers



Thierry Bousch writes:
> Hello Juergen,
hello
> 
> >  there is still the problem you cannot call wake() directly from
> > interrupts...  should we fix that?  like add some iwake() that just
> > puts it on a list thats processed somewhere at top of sleep?
> > 
> >  of course you can already use addroottimeout but thats a bit of
> > overhead just to queue a call to wake(), and the wake would take effect
> > one sleep() later.
> 
> This is rather contrived.

 i know, i know...

>  An interrupt handler should be able to call
> safely wakeselect() and wake() (to wake up any sleeping process waiting
> for data) and kill() (when connections are established/lost, or a break
> or ^C, ^\ etc is received). I don't think we need other kernel functions
> to be interrupt-safe. 
> 
> Ideally, the interrupt handler should do the biggest part of the work
> (raising signals, waking up sleeping processes) while the device-driver
> functions read() and write() would only read from (write to) some buffer,
> putting the process to sleep when the buffer is empty (full).

 yep.  that should(!) be possible on 1.11, wakeselect and now also (i)kill
work from interrupts, only for wake() you still need something like
if (!f) {addroottimeout(0, callwake, 1); f = 1;} (and reset f in callwake)
and thats what i thought could be fixed...
> 
> Of course, the "right way" to do things would be to inspire ourselves of
> what is described in the daemon book (4.3), Chapter 9 -- terminal handling.
> What makes modm0dev complicated and kludgy is that it's a tty device;
> raw devices are cleanly handled by MiNT.

 unless they need to call wake :)
> 
> Thierry.

 i know what you mean... but i think its getting better.
	Juergen
-- 
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA