<div dir="ltr">Hi,<div><br></div><div>Please suggest some IDE's to Linux code navigation and development if possible.</div><div><br></div><div>Thanks in advance,</div><div>Sankara Rao Majji</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 3, 2020 at 10:49 AM Majji SankaraRao <<a href="mailto:sankar.linux.development@gmail.com">sankar.linux.development@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Valdis,<div><br></div><div>Thanks for your reply.</div><div><br></div><div>With your suggestions I have used the following code to test helloworld module and successfully saw "Hello World!' msg with dmesg command.</div><div><br></div><div>#include<linux/module.h><br>#include<linux/init.h><br>#include<linux/kernel.h><br><br><br>MODULE_LICENSE("GPL");<br>MODULE_AUTHOR("Sankar");<br>MODULE_DESCRIPTION("Hello World Module");<br><br>static int __init helloworld_init(void)<br>{<br> printk(KERN_INFO "Hello world!\n");<br> return 0;<br>}<br><br>static void __exit helloworld_exit(void)<br>{<br> printk(KERN_INFO "Cleaning up module.\n");<br> return;<br>}<br><br>module_init(helloworld_init);<br>module_exit(helloworld_exit);<br></div><div><br></div><div><br></div><div>BR,</div><div>Sankar</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 3, 2020 at 1:37 AM Valdis Klētnieks <<a href="mailto:valdis.kletnieks@vt.edu" target="_blank">valdis.kletnieks@vt.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 02 May 2020 23:46:08 +0530, Majji SankaraRao said:<br>
<br>
> I want to practice writing modules in Linux version 5.3.0-51-generic.<br>
> So please guide me by providing related documentation/Steps.<br>
<br>
Create two functions, one for initializing your module, and one for cleaning up at exit.<br>
<br>
static int __init init_my_module(void)<br>
{<br>
printk(KERN_DEBUG "Hello World!\n");<br>
}<br>
<br>
static void __exit exit_my_module(void)<br>
{<br>
printk(KERN_DEBUG "Say goodnight, Gracie\n");<br>
}<br>
module_init(init_my_module);<br>
module_exit(exit_my_module);<br>
<br>
Everything else isn't how to write a module, it's about how to write whatever<br>
code is needed for the function you're trying to add, whether it's a file<br>
system, or a new netfilter target, or a device driver, or a network congestion<br>
control module, or whatever...<br>
<br>
And that code basically doesn't care if it's a module or if it's built in to<br>
the kernel.<br>
<br>
So the question becomes: What did you want to do inside the kernel?<br>
</blockquote></div>
</blockquote></div>