In this post we shall be writing a kernel module, which would cause
the kernel to print our messages to the kernel log buffer. we shall not
be looking deeper into the kernel buffer or the particular commands as
that would be stretching this post too long. this is just a jump-start.
The kernel log is available through this command.
let’s make the module now, do this task inside a directory you create, I named mine as “test” and the file as test.c. The contents of the file are as follows.
There would have been many questions on the way but no worries all would be clear with some efforts. The strange make command, the new commands like “insmod” “dmesg” are real simple and can be understood with a simple google search. for the serious minds do read “Linux device drivers by greg kroah hartman” and “Linux kernel development by Robert love” the two very good books that i have always referred to. any more questions? do comment.. more than happy to help.
The kernel log is available through this command.
sudo dmesg
If you look at the messages already printed, they will be more often than not by the drivers , insert and remove a pen drive and run the command again, you will see some messages being printed. I would now advise to clear the kernel log buffer by running the following command.
sudo dmesg -c
now if you run the “dmesg” command again, you will see nothing or very minimal data s the old entries have been cleared and fresh entries are being put up.
let’s make the module now, do this task inside a directory you create, I named mine as “test” and the file as test.c. The contents of the file are as follows.
#include <linux/init.h> #include <linux/module.h> static int my_init(void){ printk("Hello world"); return 0; } static void my_exit(void){ printk("bye-bye"); } module_init(my_init); module_exit(my_exit);
now in the same directory make a file called Makefile and the contents of the makefile should be these.
obj-m := test.o
That’s it… now we run the command to compile our module. The command is as follows
make -C <linux-source-dir> M=$PWD modules
if the compilation is succesful you will have a file named test.ko in the directory. we need to load it by using the insmod command.
sudo insmod test.ko
now see the kernel log by
dmesg
you would see the two messages “hello world” and “bye-bye”. It is finally done now, you have made the kernel print out a custom message for you.
There would have been many questions on the way but no worries all would be clear with some efforts. The strange make command, the new commands like “insmod” “dmesg” are real simple and can be understood with a simple google search. for the serious minds do read “Linux device drivers by greg kroah hartman” and “Linux kernel development by Robert love” the two very good books that i have always referred to. any more questions? do comment.. more than happy to help.
Great post about internet of things. I like it.
ReplyDeleteseo service in nepal
Thanks for providing the great information with us and the you have have explained the topic in clearly and it is easy to understand .
ReplyDeleteIoT Training in Hyderabad
This comment has been removed by the author.
ReplyDeleteHi, Thanks for sharing this full topic on Internet of things. It is very full to every one. keep it up Internet of things
ReplyDeleteThanks for sharing such a great information here. I really appreciate this post and like it very much.and more information
ReplyDeletePlease go trough the link : IoT
training in Hyderabad
Good informative blog. It's very useful site to all. Thanks for the who is posted the good information thanks.
ReplyDeleteDevOps Training in Hyderabad
Great Article. Thanks for sharing info.
ReplyDeleteWorkday Training in Hyderabad
IELTS Coaching in Hyderabad
Salesforce Training in Hyderabad
SAP FICO Training in Hyderabad
Great Article. Thanks for sharing info.
ReplyDeleteDigital Marketing Training in Hyderabad
Best SAP ABAP Training Institute In Ameerpet
Best SAP FICO Training Institute In Ameerpet
Best faculty for AWS Training in Hyderabad
Salesforce Training Institute in Hyderabad
Great Article. Thanks for sharing info.
ReplyDeleteDigital Marketing Course in Hyderabad
Digital Marketing Training in Hyderabad
AWS Training in Hyderabad
SEO Training in Hyderabad
Google Analytics Training in Hyderabad
Good Post. I like your blog. Thanks for Sharing good information.
ReplyDeleteIoT Training Institute in Noida
Thanks For Sharing The Information The Information Shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The article Python Online Course
ReplyDeleteThank you for sharing such a IoT scope of information. These are the trending technologies that spread all over the world. Internet of Things is also the trending and most required technology that people loves the most.
ReplyDeletethanks for sharing this information
ReplyDeleteaws training in sholinganallur
azure training in sholinganallur
data science training in siruseri
best data science training in omr
devops training in omr
best devops training institute in omr
java training in omr
python training in omr
I enjoyed reading your article about IOT. Please make more interesting topics like this.I'll come back for more��
ReplyDeleteBuy tinder accounts
Thanks for your marvelous posting!I really enjoyed reading it. You're a great author.I will be sure to bookmark your blog and will come back very soon.
ReplyDeleteBuy bulk aged Gmail accounts
I love visiting sites in my free time. I have visited many sites but did not find any site more efficient than yours Great job for publishing such a beneficial website. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically.
ReplyDeletebuy google voice number
Thank you arun, For sharing a Fabulous post with a lot of information.
ReplyDeleteBuy Google voice pva accounts
nice blog
ReplyDeleteselenium training in chennai
selenium training in omr
selenium training in sholinganallur
best python training in chennai
data Science training in chennai
aws training center in chennai
nice message
ReplyDeleteArtificial Intelligence training in Bangalore
RPA Training in Bangalore
Blue Prism Training in Bangalore
Best Android Training Institute in Bangalore
Android Training in Bangalore
informatica Training in Bangalore
Machine Learning training in bangalore
Thank You for sharing a great information with us.I have you bookmarked your site to look at the new stuff you post.
ReplyDeleteIoT App Development
Great post!!
ReplyDeleteThanks for Sharing a useful content about Internet of things (IoT), Definitely IOT will be the Game Changer of all technology
IoT Training courses | IoT training
Very nice post. I absolutely love this site. Thanks!
ReplyDeleteBuy tinder pva accounts
Thanks for sharing
ReplyDeletepython certification training in Bangalore
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeleteData Science Institute in Bangalore
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
ReplyDeleteData Science Course in Bangalore
This comment has been removed by the author.
ReplyDeleteI just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
ReplyDeleteSimple Linear Regression
Correlation vs Covariance
Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.iot training in delhi
ReplyDeleteTerrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. Infact, educating the participants with it's amazing content. Hope you share the similar content consecutively.
ReplyDelete360DigiTMG Data Science Course
amazing site with relevant information thanks for sharing.
ReplyDeleteData Science Training 360DigiTMG
Pretty good post blog with excellent information. really enjoyed reading your blog posts thanks for sharing.
ReplyDeleteData Analytics Certification Training 360DigiTMG
I am looking for and I love to post a comment that "The content of your post is awesome" Great work! data science courses
ReplyDeletekernel module writing is very hard. So anyone need to write easy way must read this blog. Thank you admin for tis blog buy google voice number
ReplyDeleteThanks for sharing the helpful blogpost.pvait
ReplyDeletehttps://www.digitalbrolly.com/digital-marketing-course-in-hyderabad/
ReplyDeleteSuch a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
ReplyDeletebest data science institute in hyderabad
This article discusses the importance of this blog for business promotion. Promoting a blog is just like promoting any other website and can be difficult to do if you are not sure what needs to be done, but with the right buy google voice number tips and tricks, this doesn't have to be. Hopefully, you find this article on this blog helpful and decide to visit the site below to see just what they are talking about
ReplyDeleteI have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you...
ReplyDeletedigital marketing courses in hyderabad with placement
To get the most out of IOT, take the option of getting a good night's sleep. So that IOT does not interrupt anyone's sleep, the time when the alert is active can be chosen. These IoTs also provide a variety of alert delivery channels. There are no limits to these items, which range from email to voice recording on one's phone. IoT devices may also remotely monitor a variety of other devices. Visit here https://store.ubibot.com/
ReplyDeleteExcellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this…
ReplyDeleteData Science Training in Hyderabad
This article discusses
ReplyDeleteBuy facebook accounts the importance of this blog for business promotion. Promoting a blog is just like promoting any other website and can be difficult to do if you are not sure what needs to be done, but with the right tips and tricks, this doesn't have to be. Hopefully, you find this article on this blog helpful and decide to visit the site below to see just what they are talking about.
buy pva gmail accounts
Great blog. Recently got my IoT app from IoT app development company
ReplyDeleteI recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you.
ReplyDeletedata scientist course in hyderabad
Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks.
ReplyDeletecyber security course malaysia
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,
ReplyDeletedata scientist training in hyderabad
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.
ReplyDeletedata analytics courses in hyderabad with placements
Learn to use analytics tools and techniques to manage and analyze large sets of data from Data Science training institutes in Bangalore. Learn to take on business challenges and solve problems by uncovering valuable insights from data. Learn from the comprehensively designed curriculum by the industry experts and work on live projects to sharpen your skills.
ReplyDeleteBest Data Science Training institute in Bangalore
Learn to use analytics tools and techniques to manage and analyze large sets of data from Data Science training institutes in Bangalore. Learn to take on business challenges and solve problems by uncovering valuable insights from data. Learn from the comprehensively designed curriculum by the industry experts and work on live projects to sharpen your skills.
ReplyDeleteData Science Course in Delhi
Are you looking for a Data Science course that will aid you in your career growth. 360DigiTMG is the right place for you. Enroll now for a better tomorrow.
ReplyDeleteData Scientist Course in Delhi
Unleash your potential and expand your capabilities with the Data Science Certification Course.
ReplyDeletedata analytics course in borivali
"If you are also one of them and want to know what the companies demand from the data scientists to do in their organization, you have come to the right place.data science course in kolkata"
ReplyDeleteThis article provides a clear and concise introduction to creating a kernel module in Linux. The step-by-step instructions, along with the provided code snippets, make it accessible even for those new to kernel development. The recommendation of additional resources for deeper learning is a valuable bonus. Great job simplifying a complex topic!
ReplyDeleteData Analytics Courses in Nashik
Hello Blogger,
ReplyDeleteThis post is a valuable resource for anyone interested in kernel module development in Linux, and the author's willingness to answer questions and provide further assistance is a commendable trait.
Data Analytics Courses In Dubai
The way you've explained the concept and its real-world applications is both clear and engaging.
ReplyDeleteDigital marketing courses in illinois