Compiling modules in kernel 2.6.7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have updated to linux 2.6.7 and have tried a module but now it is not
working. 

Here it happens the same with a sample hello world kernel module.

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

static int hello_init(void)
{
        printk(KERN_ALERT "Hello, world\n");
        return 0;
}

static void hello_exit(void)
{
        printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);

And the 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

And the errors are:
make -C /lib/modules/2.6.7/build/ SUBDIRS=/home/alejandro/work/modulo
modules
make[1]: Entering directory `/usr/src/linux-2.6.7'
  CC [M]  /home/alejandro/work/modulo/hello.o
In file included from include/asm/processor-generic.h:14,
                 from include/asm/processor.h:22,
                 from include/asm/thread_info.h:11,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/asm/ptrace.h:9:27: sysdep/ptrace.h: No such file or directory
In file included from include/asm/ptrace.h:10,
                 from include/asm/processor-generic.h:14,
                 from include/asm/processor.h:22,
                 from include/asm/thread_info.h:11,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/asm/ptrace-generic.h:26:25: skas_ptrace.h: No such file or
directory
In file included from include/asm/ptrace.h:10,
                 from include/asm/processor-generic.h:14,
                 from include/asm/processor.h:22,
                 from include/asm/thread_info.h:11,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/asm/ptrace-generic.h:29: error: field `regs' has incomplete type
In file included from include/asm/processor.h:22,
                 from include/asm/thread_info.h:11,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/asm/processor-generic.h:15:25: choose-mode.h: No such file or
directory
In file included from include/linux/sched.h:21,
                 from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/asm/mmu.h:9:20: um_mmu.h: No such file or directory
In file included from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/linux/sched.h:226: error: parse error before "mm_context_t"
include/linux/sched.h:226: warning: no semicolon at end of struct or
union
include/linux/sched.h:237: error: parse error before '}' token
In file included from include/linux/module.h:10,
                 from /home/alejandro/work/modulo/hello.c:2:
include/linux/sched.h: In function `mmdrop':
include/linux/sched.h:836: error: dereferencing pointer to incomplete
type
make[2]: *** [/home/alejandro/work/modulo/hello.o] Error 1
make[1]: *** [_module_/home/alejandro/work/modulo] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.7'
make: *** [default] Error 2

Any clue?

Thanks in advance,
Alejandro


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux