Hello World Linux Device Driver Program
Let's in this post write a hello world Linux device driver
Create a hello.c file with the following content in a new folder
Create a Makefile with the following content in the same folder
Command to create a module: make
Command to load module: insmod hello.ko
When you run this command, function specified in module_init will be executed, to check run "dmesg"
Command to remove module: rmmod hello
When you run this command, function specified in module_exit will be executed, verify it by running "dmesg"
Output:
Create a hello.c file with the following content in a new folder
Create a Makefile with the following content in the same folder
Command to create a module: make
Command to load module: insmod hello.ko
When you run this command, function specified in module_init will be executed, to check run "dmesg"
Command to remove module: rmmod hello
When you run this command, function specified in module_exit will be executed, verify it by running "dmesg"
Output:
Comments
Post a Comment