Driver porting: compiling external modules
Driver porting: compiling external modules
Posted Feb 6, 2003 6:05 UTC (Thu) by rfunk (subscriber, #4054)Parent article: Driver porting: compiling external modules
For the make trickery in the latter part of this article, it's important to note that the original make command assumes the kernel source is in /usr/src/linux/:
make -C /usr/src/linux SUBDIRS=$PWD modules
While the makefile that allows a shorter command line assumes the kernel source is in a directory like /lib/modules/2.5.59/build/, due to the following line:
KDIR := /lib/modules/$(shell uname -r)/build
I believe there was some minor controversy on the linux-kernel mailing list recently over which location is more appropriate.
Posted Feb 6, 2003 14:44 UTC (Thu)
by corbet (editor, #1)
[Link] (3 responses)
Posted Oct 27, 2004 8:25 UTC (Wed)
by rashminivarthy (guest, #25682)
[Link] (2 responses)
Posted Oct 27, 2004 10:17 UTC (Wed)
by rashminivarthy (guest, #25682)
[Link] (1 responses)
Posted Jul 18, 2005 11:38 UTC (Mon)
by kalou (guest, #31046)
[Link]
your kernel is not module enabled,
Sincere Regards,
Olivier
Posted Sep 14, 2005 23:45 UTC (Wed)
by mraviraj (guest, #32463)
[Link]
I need to port our existing makefiles to work with 2.4 and 2.6.
while i am trying to use following syntax for 2.4, it is just doing 'make clean' job in linux kernel directory.
ifeq ($(KERNELRELEASE),)
foo-objs := foo1.o foo2.o
Can someone please share their experience in compiling the same source code for 2.4 and 2.6 ?
thanks ..
Actually, /usr/src/linux is pretty much deprecated by the Prime Penguin himself; you're supposed to keep your kernel sources somewhere else. I got lazy and used it in the example, mostly because it's shorter to type than the /lib/modules path. The latter is the better way to go, however, especially in scripts or makefiles - it "automatically" points to the right source tree, unless you move your trees around.
Path to the kernel source
hello, Path to the kernel source
i was trying to compile a simple helloworld module on linux-2.6
kernel (Fedoracore-2)i'm geting this error while using this
makefile
---------------
|MakeFile |
----------------
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
---------------
|ERROR MESSAGE|
----------------
cc hello.c -o hello
hello.c:1:26: linux/module.h: No such file or directory
hello.c:2:27: linux/kernel.h: No such file or directory
hello.c:3:24: linux/init.h: No such file or directory
make: *** [hello] Error 1
hello unable to use ksyms on 2.6 kernel
i tried using ksyms on 2.6 kernel to view all the exported kernel
symbols .It gave an error-
ksyms: QM_MODULES: Function not implemented
plz any 1 reply back
Hi rashminivarthy,unable to use ksyms on 2.6 kernel
obviously.
We have been using linux 2.4 for the development and recently started supporting 2.6.Driver porting: compiling external modules
obj-m := foo.o
else
KDIR := /linux/kernel/src/v2.4/linux-2.4.31
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
Raviraj
