How to Load and Unload a C Linux Kernel Module

Basically, load and unload a C Linux Kernel Module is including steps:

A. Load a Module
At the location where the C source file is located. execute one by one command:
//Compile the C source file
>make
//Clear the log
>dmesg -c
//Load the Module
>sudo insmod partonelist.ko
//Show the log
>dmesg
//Show current Processes
>ps –el
//Show current Processes
>ps –eLf

B. Unload a Module
At the location where the C source file is located. execute one by one command:
>dmesg -c
>sudo rmmod partonelist
>dmesg

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.