Driver porting: hello world
Driver porting: hello world
Posted Nov 22, 2004 4:33 UTC (Mon) by prakash07 (guest, #26172)Parent article: Driver porting: hello world
i am getting error while compiling make file in kernel 2.6.8.1
make: -C/lib/modules/2.6.8.1/build/SUBDIRS=/rootmodules
make:*** /lib/modules/2.6.8.1/build/SUBDIRS=/rootmodules: No Such file or directory. stop
make: ***[default]error 2
can any one give me the solutions
Posted Dec 18, 2004 5:22 UTC (Sat)
by sockie (guest, #26758)
[Link] (3 responses)
**************************************************************************
**************************************************************************
Any help is appreciated.
Y.W.
Posted Aug 26, 2005 20:24 UTC (Fri)
by vleo (guest, #32027)
[Link] (2 responses)
Most people having problem with hello_world driver don't understand that you should have Linux kernel sources installed and configured, 'make menuconfig' is your friend. Only after that you can start building your own drivers.
Good place to put sources into is for example /usr/src/linux-2.6.12 (for kernel 2.6.12). If you untar kernel souce into /usr/src you would be pretty close to that.
Then make sure you have following among gcc flags in your Makefile:
-I /usr/src/linux-2.6.12/include
If you do not have that, #includes like <linux/types.h> would get file /usr/include/linux/types.h, which is certainly not what you want to be included as opposed to /usr/src/linux-2.6.12/include/linux/types.h
Posted Sep 20, 2005 15:17 UTC (Tue)
by jeanwelly (guest, #29199)
[Link] (1 responses)
[root@localhost kernel-dev]# rmmod -f hello.ko
Does any one know why?
Posted Jan 13, 2008 5:51 UTC (Sun)
by manish_badarkhe (guest, #49929)
[Link]
I am getting the following errors when trying to compile the above example on Kernel 2.6.9Driver porting: hello world
make -C /lib/modules/2.6.9-1.667smp/build SUBDIRS=/root/ppm/client modules
make[1]: Entering directory `/lib/modules/2.6.9-1.667smp/build'
CC [M] /root/ppm/client/test.o
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from include/linux/module.h:10,
from /root/ppm/client/test.c:2:
include/asm/mpspec.h:6:38: mach-generic/mach_mpspec.h: No such file or directory
In file included from include/asm/smp.h:18,
from include/linux/smp.h:17,
from include/linux/sched.h:23,
from include/linux/module.h:10,
from /root/ppm/client/test.c:2:
include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a function)
include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function)
make[2]: *** [/root/ppm/client/test.o] Error 1
make[1]: *** [_module_/root/ppm/client] Error 2
make[1]: Leaving directory `/lib/modules/2.6.9-1.667smp/build'
make: *** [default] Error 2
Everybody new to driver development - RTFM - Read Rubini's book.Driver porting: hello world
I use "insmod hello.ko " to use the module, It's OK when I check the kernel message. But when I want to remove the module, error found:Driver porting: hello world
ERROR: Removing 'hello': Device or resource busy
Thanks!
Driver porting: hello world
I think your device is in some other mode(read or write) while you are removing the device