Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm trying to learn kernel modules and I'm not sure how to get started. I want to install the simple "hello world" one at http://www.tldp.org/LDP/lkmpg/2.6/html/x181.html, but it's not very specific on how to do it. It says that modules should be built from the console and not from X. Do I just open up a console window? Do I use a text editor like GEDIT to write the module? I'm running a pretty standard Ubuntu 5.10 release on my laptop. Any help is greatly appreciated!
I copied the necessary code from the tutorial into a file and named it "makefile." I saved it on the desktop and ran "make" from a terminal. This is the error that I got:
make -C /lib/modules/2.6.12-10-386/build M=/home/allen/Desktop modules
make: *** /lib/modules/2.6.12-10-386/build: No such file or directory. Stop.make: *** [all] Error 2
The makefile code that I posted earlier is from the tutorial at http://www.tldp.org/LDP/lkmpg/2.6/html/x181.html. It seems like it cannot find the directory. I do not have a directory named "build" in the shell folder. I can't seem to create one either.
I'm not sure what you mean by your last post, jcliburn. I think Ubuntu is based on Debian. I made a directory called "build" but now I receive an error saying that "*** No rule to make target 'modules'. Stop."
You have to remove the last / as I posted before.
Otherwise then you have created yourself the directory and then you are beginning to break things, this directory is created when a new kernel is install, don't create it yourself
Do I need to compile a new kernel? If so, what is the easiest way to do it? Can I use a "live" cd like Knoppix or something similar?
Hum you should look on google or on tldp.org for compiling linux kernel. Quickly said, what you need is kernel source and gnu compiler (gcc).
As sundialsvcs, you should not try building kernel modules now. If you skip steps, you will end up with bad knowledge.
Try to compile and use your own kernel first. After this, ask again for kernel modules
Learning make is maybe not really needed (if you have time, do it but you look like impatient) , see here: http://www.linuxquestions.org/questi...0&goto=newpost