On 10-01-08 16:33, Nikolay N. Ivanov wrote:

I'm really newbie in kernel programming but I fond of daring experiments.
So I have written a simple module which is runs infinite cycle in the
init function. After insmodding system hangs up (it is not a problem
because i use qemu). I also tryed to put endless loop into exit function.
Then I've written a script.

#!/bin/sh

sleep 20 rmmod -f hangupmodule

I run this script every time before insmodding (or rmmodding). But
nothing helps to remain the system into working state. So my [stupid]
question is whether the system really hangs up when endless cycle runs
inside init or exit function?

Depends on CONFIG_PREEMPT.

Having a non-preemtive kernel means (by definition) that processes can not be scheduled away while running in kernel-mode -- in this case the insmod process is running in kernel-mode inside your infite loop and will be the only process that runs, effectively locking up the machine (interrupts will still happen but nothing will come of it).

With a preemptive kernel though, the system will happily switch away from insmod to different processes, allowing you to cleanly reboot to get rid of the insmod process -- you can't kill it since it's in kernel-mode.

Rene.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to