Reg : Writing modules in new Linux versions
Valdis Kl=?utf-8?Q?=c4=93?=tnieks
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");
}
module_init(init_my_module);
module_exit(exit_my_module);
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
the kernel.
So the question becomes: What did you want to do inside the kernel?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20200502/3c7953a9/attachment.sig>
More information about the Kernelnewbies
mailing list