can anyone tell me which function to call to pause the kernel

François fser at code-libre.org
Thu May 12 11:26:27 EDT 2016


On 05/12/2016 04:55 PM, walkerlala wrote:
> I successfully insert some function into the kernel code and make it 
> execute when the kernel start up, but I just can't make the kernel stop 
> executing. Are there any functions which can pause the kernel so that I 
> prompt the user, and let the user input a command(maybe a comment to 
> display the current time. Something like a shell would do) and interact ?

I don't think you can actually stop the kernel. The linux kernel is
multi-threads and events driven, so I doubt you can stop and restart it
that easily.

BUT

if you want to interract with userland, you can implement a syscall on
your own, or create a proc device (for instance) to let user read /
write data to the kernel.

For instance, you could create a proc entry called gettime, and when
user reads it (ie: cat /proc/gettime) you would provide a proper answer.

Hope this help.

François



More information about the Kernelnewbies mailing list