I have a program as shown below.
test_module.c
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
int init_module(void)
{
while(1) {
pr_info("hello 4 sec\n");
msleep(4 * 1000);
}
return 0;
}
void cleanup_module(void)
{
pr_info("module removed successful\n");
}
When I load this module, my terminal freezes / locks. How to stop this program. I tried sudo rmmod test_modulebut did not use. So I rebooted my system. How to break init_module? In the future, if something goes wrong, and if mine init_moduledoes not end, what should I do? And what happens if we don't stop at init_module?
source
share