Reg : Writing modules in new Linux versions
valdis.kletnieks at vt.edu
Sat May 2 16:07:08 EDT 2020
On Sat, 02 May 2020 23:46:08 +0530, Majji SankaraRao said:
> I want to practice writing modules in Linux version 5.3.0-51-generic.
> So please guide me by providing related documentation/Steps.
Create two functions, one for initializing your module, and one for cleaning up at exit.
static int __init init_my_module(void)
printk(KERN_DEBUG "Hello World!\n");
static void __exit exit_my_module(void)
printk(KERN_DEBUG "Say goodnight, Gracie\n");
Everything else isn't how to write a module, it's about how to write whatever
code is needed for the function you're trying to add, whether it's a file
system, or a new netfilter target, or a device driver, or a network congestion
control module, or whatever...
And that code basically doesn't care if it's a module or if it's built in to
So the question becomes: What did you want to do inside the kernel?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 832 bytes
Desc: not available
More information about the Kernelnewbies