Re: Reg : Writing modules in new Linux versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

Attachment: pgpKjJ7Ht3upX.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux