I can clearly see a } missing after your printk("bye").
Main Topics
Browse All TopicsHello sir, i am yogi. i am studying device driver development under linux .
i am trying to execute "insmod" command and want to insert a simple module.
i am reffering o'reilly book for device drivers under linux.
i am using Red Hat Linux version 7.3.I am not able to insert the module.
If i try to execute lsmod, its giving all the module names which are loaded.
This is my code(hello.c) following with the errors coming after executing the code:
#define MODULE
#include <linux/module.h>
init_module(void){ printk("Hello"); return 0;}
void cleanup_module(void){print
at root : cc -c hello.c
errors:
In file included from hello.c :2:
/usr/include/linux/module.
/usr/include/linux/module.
/usr/include/linux/module.
/usr/include/linux/module.
/usr/include/linux/module.
/usr/include/linux/module.
waiting for reply
thanking you in anticipation
Yogi
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I would suggest reading the following doc if you want to get serious with module programming
http://www.tldp.org/LDP/lk
You will be able to rectify most of the erros (apart from the parse errs) after you read the first couple of pages.
Business Accounts
Answer for Membership
by: person1994Posted on 2005-06-17 at 06:13:22ID: 14240411
Try to compile with cc -D__KERNEL__ .....
Good luck