From mboxrd@z Thu Jan 1 00:00:00 1970 From: fser@code-libre.org (=?UTF-8?B?RnJhbsOnb2lz?=) Date: Thu, 12 May 2016 17:26:27 +0200 Subject: can anyone tell me which function to call to pause the kernel In-Reply-To: <57349965.5070707@gmail.com> References: <57349965.5070707@gmail.com> Message-ID: <5734A0A3.8080503@code-libre.org> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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