nanosleep crashed my kernel

2003-05-30 Thread Anurag Chaudhary
I used nanosleep() in my device driver, but it crashed the kernel saying 
pagefault in kernel mode.
Can anybody please suggest some other method to be used in a kld to sleep

thanx
Anurag
_
Attention NRIs! Send money to India. 
http://server1.msn.co.in/msnleads/citibankrca/citibankrca2.asp Do it in a 
jiffy!

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: nanosleep crashed my kernel

2003-05-30 Thread Chuck Swiger
Anurag Chaudhary wrote:
I used nanosleep() in my device driver, but it crashed the kernel saying 
pagefault in kernel mode.
Can anybody please suggest some other method to be used in a kld to sleep
When you put the kernel to sleep, what were you expecting to wake it up?  :-)

A literal answer would be an interrupt, but in many contexts, such as device 
drivers, tend to block receipt of new interrupts while servicing the existing 
one.  Regardless, there is a critical design methodology involved: you shouldn't 
ever block or busy-wait in the kernel, at least if you can possibly avoid it. 
Look into continuations and performing a context swap to a runnable process 
until the next interrupt happens and your device driver can make more progress.

--
-Chuck
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]