Monday, September 11, 2006

Writing Kernel Modules for 2.6

hello.c
1 #include <linux/module.h>
2 #include <linux/kernel.h>
3
4 int init_module(void)
5 {
6 printk(KERN_INFO "Hello world \n");
7 return 0;
8 }
9
10 void cleanup_module(void)
11 {
12 printk(KERN_INFO "Goodbye world \n");
13 }

Makefile
1 obj-m += hello.o
2
3 all:
4 make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
5
6
7 clean:
8 make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
9 fresh: clean all

Commands:

Install Module# insmod hello.ko
Remove Module # rmmod hello.ko
Module info # modinfr hello.ko
List Module # lsmod
Check Log # tail /var/log/messages

Files :
/proc/modules | List of modules |
/proc/kallsyms | List of Symbols |

Vaibhav.

5 comments:

Anonymous said...

Test Comment

Telefon genggam bikin buaya kehilangan nafsu makan said...

i am just visit

foto bugil gadis smu said...

kep update

Palm Pixi Plus Verizon Only Cell Phone with WebOS, Touch Screen said...

good post

Akbar Ali said...

Send Unlimited Marketing Mails?
It's 100% Cheap & Inbox Guaranteed Delivery.

Take 14 Days Free Trial.
Add 1000 contacts & send unlimited campaigns.

Visit: http://j.mp/outboxmailer-affiliate-004 at Just $59/month

- You can ADD UNLIMITED CONTACTS
- You Can SEND UNLIMITED MailS without limits.
- Custom HTML editor, Web forms, Follow ups, and Auto-Responder.
- 99.5% Inbox Delivery and Real time reporting.
- Simple and Easy.

USE COUPON CODE & SAVE 50%: MADOFFER786

Take 14 Days Free Trial.
Add 1000 contacts & send unlimited campaigns.

In other network, they are charging +1000 USD for 1 Million Mails / contacts.
But in http://j.mp/outboxmailer-affiliate-004 is cheap at Just $59/month.?