LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux 2.6 Module programming - failed first attempts (https://www.linuxquestions.org/questions/programming-9/linux-2-6-module-programming-failed-first-attempts-321319/)

introuble 05-08-2005 11:26 AM

Linux 2.6 Module programming - failed first attempts
 
Hello !

Ok , I'm reading http://sdn.vlsm.org/share/LDP/lkmpg/2.6/html/index.html in an attempt to learn a bit about Linux Kernerl Module programming .

The programming part is fairly easy to understand .. what I can't understand is how I am supposed to compile the modules ..

Quote:

So, let's look at a simple Makefile for compiling a module named hello-1.c:
.. so .. do I just go "vi Makefile" in the same dirrectory as my hello-1.c and insert there obj-m += hello-1.o ; followed by "make -C /usr/src/linux-`uname -r` SUBDIRS=$PWD modules" ? because it doesn't work ..

Also .. "usual" task as .. writing/reading to/from files/sockets and other tasks .. are they achieved in modules in the same way (same functions) as in normal programs ?

Also , does anyone know of any more , valuable (preferably Free and available Online) resources on this topic ?

Thank you for your attention !

btmiller 05-08-2005 12:24 PM

You might find the 3rd edition of Linux Device Drivers useful. I have to the point that I purchased a paper copy even though it's available for free online from the publisher (thank you, O'Reilly).


All times are GMT -5. The time now is 06:22 PM.