can anyone tell me which function to call to pause the kernel
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 had checked the "sys_***" functions in this page: http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html but just can't find a proper one )
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
On Thu, May 12, 2016 at 9:55 PM, walkerlala <ablacktshirt@gmail.com> 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 had checked the "sys_***" functions in this page: http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html but just can't find a proper one )
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi... sounds like what kgdb does. But not sure if it is still maintained or not. btw, kernel can not be paused, actually. if you really need that, you need to run linux kernel inside virtual machine and pause the virtual machine. But doing that, you will also pause user space too :) -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (3)
-
François -
Mulyadi Santosa -
walkerlala