|
|
Subscribe / Log in / New account

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


to post comments

Driver porting: hello world

Posted Dec 18, 2004 5:22 UTC (Sat) by sockie (guest, #26758) [Link] (3 responses)

I am getting the following errors when trying to compile the above example on Kernel 2.6.9

**************************************************************************
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

**************************************************************************

Any help is appreciated.

Y.W.

Driver porting: hello world

Posted Aug 26, 2005 20:24 UTC (Fri) by vleo (guest, #32027) [Link] (2 responses)

Everybody new to driver development - RTFM - Read Rubini's book.

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

Driver porting: hello world

Posted Sep 20, 2005 15:17 UTC (Tue) by jeanwelly (guest, #29199) [Link] (1 responses)

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:

[root@localhost kernel-dev]# rmmod -f hello.ko
ERROR: Removing 'hello': Device or resource busy

Does any one know why?
Thanks!

Driver porting: hello world

Posted Jan 13, 2008 5:51 UTC (Sun) by manish_badarkhe (guest, #49929) [Link]

I think your device is in some other mode(read or write) while you are removing the device


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds