On Thu, Oct 2, 2008 at 9:20 PM, Chetan Nanda <chetannanda@xxxxxxxxx> wrote: > > > On Tue, Sep 30, 2008 at 11:50 PM, arshad hussain <arshad.super@xxxxxxxxx> > wrote: >> >> On Tue, Sep 30, 2008 at 11:12 PM, Chetan Nanda <chetannanda@xxxxxxxxx> >> wrote: >> > Hi All, >> > >> > I am trying my hands with User mode Linux. >> > I am able to configure and kernel 2.6.24 under UML. >> > >> > Next It am trying to compile kernel module (so that modules can be >> > insmod >> > into running UML). >> > But not able to compile my kernel module for UML. >> >> Hoping you are not missing "ARCH=um" in your "Makefile". >> You also need the linux source. > > My Make file look like this: > ############## > CC=gcc > ARCH=um > KERNELDIR=/root/Work/linux_src/linux-source-2.6.24 > ARCHDIR=$(KERNELDIR)/arch/um > TTDIR=$(ARCHDIR)/kernel/tt > SKASDIR=$(ARCHDIR)/kernel/skas > CFLAGS= -DDEBUG -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include > -I$(ARCHDIR)/include -I$(TTDIR)/include -I$(SKASDIR)/include -Wall -Wunused > -Wuninitialized -g -O > ALL = hello_1.o > > all: $(ALL) > ################ > > But on compiling module using 'make' make command gives me following error: > from hello_1.c:7: > /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h: In > function 'current_thread_info': > /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50: > error: 'CONFIG_KERNEL_STACK_ORDER' undeclared (first use in this function) > /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50: > error: (Each undeclared identifier is reported only once > /root/Work/linux_src/linux-source-2.6.24/include/asm/thread_info.h:50: > error: for each function it appears in.) > > Do I still missing something ? In case you have not got answers from user-mode-linux-user@xxxxxxxxxxxxxxxxxxxxx Try this... I use Makefile different from yours. Copied the simplest when i first started and stuck with it's style. /* Sample make file , assuming your driver code is named driver.c */ obj-m += driver.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules ARCH=um clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean ARCH=um /* end sample make file */ See to it that "/lib/modules/$(shell uname -r)/build" points to the kernel source. [root@_UMLKERNEL_@localhost dd]# ls -l /lib/modules/$(uname -r)/build lrwxrwxrwx 1 root root 35 Dec 20 2007 /lib/modules/2.6.23.11/build -> ../../../umlkernel/linux-2.6.23.11/ [root@_UMLKERNEL_@localhost dd]# My huch is there is something with your makefile, do we still need to pass-D_KERNEL_ (etc) in 2.6. This was done with 2.4. Hope this help you in narrowing down the problem. > > Thanks, > Chetan Nanda > >> >> >> >> > >> > Please point me into right direction. >> > >> > Thanks, >> > Chetan Nanda >> > >> > > > -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ