Question: Part 2.A) Modify, compile, install, and uninstall a Loadable Kernel Module (LKM). Start with the code provided to students in the chapter 2 folder in
source code is below can you please also provide screenshots
-----------------------
Makefile
---------------------------------------
obj-m += simple.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
-----------------------------
simple.c
--------------------------------
#include #include #include
/* This function is called when the module is loaded. */ int simple_init(void) { printk(KERN_INFO "Loading Module ");
return 0; }
/* This function is called when the module is removed. */ void simple_exit(void) { printk(KERN_INFO "Removing Module "); }
/* Macros for registering module entry and exit points. */ module_init( simple_init ); module_exit( simple_exit );
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Simple Module"); MODULE_AUTHOR("SGG");
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
