When I compile my module with UML kernel source tree I get these errors. I must be doing something silly:

[root@localhost rdp]# make -C /oldext/downloads/uml-krnl/linux-2.6.24 M=`pwd` modules
make: Entering directory `/oldext/downloads/uml-krnl/linux-2.6.24'
  CC [M]  /oldext/rdp/hello.o
In file included from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/processor.h:17:30: error: sysdep/faultinfo.h: No such file or directory
In file included from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/processor.h:29: error: field ¡faultinfo¢ has incomplete type
In file included from include/asm/arch/user_32.h:4,
                 from include/asm/arch/user.h:3,
                 from include/asm/processor.h:52,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/page.h:99:17: error: mem.h: No such file or directory
In file included from include/asm/ptrace.h:12,
                 from include/asm/processor-generic.h:13,
                 from include/asm/processor.h:77,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/ptrace-generic.h:13:27: error: sysdep/ptrace.h: No such file or directory
In file included from include/asm/ptrace.h:12,
                 from include/asm/processor-generic.h:13,
                 from include/asm/processor.h:77,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/ptrace-generic.h:16: error: field ¡regs¢ has incomplete type
In file included from include/asm/processor.h:77,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/processor-generic.h:14:23: error: registers.h: No such file or directory
include/asm/processor-generic.h:15:31: error: sysdep/archsetjmp.h: No such file or directory
In file included from include/asm/processor.h:77,
                 from include/linux/prefetch.h:14,
                 from include/linux/list.h:8,
                 from include/linux/module.h:9,
                 from /oldext/rdp/hello.c:1:
include/asm/processor-generic.h:33: error: expected specifier-qualifier-list before ¡jmp_buf¢
In file included from include/linux/mm_types.h:14,
                 from include/linux/sched.h:60,
                 from include/asm/elf.h:8,
                 from include/linux/elf.h:6,
                 from include/linux/module.h:14,
                 from /oldext/rdp/hello.c:1:
include/asm/mmu.h:9:20: error: um_mmu.h: No such file or directory
In file included from include/linux/sched.h:60,
                 from include/asm/elf.h:8,
                 from include/linux/elf.h:6,
                 from include/linux/module.h:14,
                 from /oldext/rdp/hello.c:1:
include/linux/mm_types.h:200: error: expected specifier-qualifier-list before ¡mm_context_t¢
In file included from include/linux/elf.h:6,
                 from include/linux/module.h:14,
                 from /oldext/rdp/hello.c:1:
include/asm/elf.h:9:18: error: skas.h: No such file or directory
In file included from include/linux/elf.h:6,
                 from include/linux/module.h:14,
                 from /oldext/rdp/hello.c:1:
include/asm/elf.h: In function ¡elf_core_copy_fpregs¢:
include/asm/elf.h:83: error: implicit declaration of function ¡save_fp_registers¢
include/asm/elf.h:83: error: ¡userspace_pid¢ undeclared (first use in this function)
include/asm/elf.h:83: error: (Each undeclared identifier is reported only once
include/asm/elf.h:83: error: for each function it appears in.)
make[1]: *** [/oldext/rdp/hello.o] Error 1
make: *** [_module_/oldext/rdp] Error 2
make: Leaving directory `/oldext/downloads/uml-krnl/linux-2.6.24'
[root@localhost rdp]#

I see the symlink to sysdep as below:

[root@localhost linux-2.6.24]# ls -l arch/um/include/sysdep
lrwxrwxrwx 1 root root 11 May  9 18:08 arch/um/include/sysdep -> sysdep-i386
[root@localhost linux-2.6.24]#
[root@localhost linux-2.6.24]# pwd
/oldext/downloads/uml-krnl/linux-2.6.24
[root@localhost linux-2.6.24]# ls -l arch/um/include/sysdep/
total 60
-rw-r--r-- 1 root root  363 Jan 24 14:58 archsetjmp.h
-rw-r--r-- 1 root root  281 Jan 24 14:58 barrier.h
-rw-r--r-- 1 root root 5080 Jan 24 14:58 checksum.h
-rw-r--r-- 1 root root  903 Jan 24 14:58 faultinfo.h
-rw-r--r-- 1 root root  468 Jan 24 14:58 kernel-offsets.h
-rw-r--r-- 1 root root 4897 Jan 24 14:58 ptrace.h
-rw-r--r-- 1 root root 1669 Jan 24 14:58 ptrace_user.h
-rw-r--r-- 1 root root 1757 Jan 24 14:58 sc.h
-rw-r--r-- 1 root root  615 Jan 24 14:58 sigcontext.h
-rw-r--r-- 1 root root  374 Jan 24 14:58 skas_ptrace.h
-rw-r--r-- 1 root root 2199 Jan 24 14:58 stub.h
-rw-r--r-- 1 root root  731 Jan 24 14:58 syscalls.h
-rw-r--r-- 1 root root  769 Jan 24 14:58 tls.h
[root@localhost linux-2.6.24]#

 What am I missing?

thanks



----- Original Message ----
From: Jeff Dike <jdike@addtoit.com>
To: K D <kdcalif@yahoo.com>
Cc: user-mode-linux-user@lists.sourceforge.net
Sent: Friday, May 9, 2008 8:49:37 AM
Subject: Re: [uml-user] do i have to recompile my module in UML

On Wed, May 07, 2008 at 11:57:22PM -0700, K D wrote:
> Coming to my problem. I'm developing a kernel module and I hate to
> reboot my host OS everytime there is any issue in module. I'm hoping
> UML would help me here.  When I load my module in host OS, it
> loads/unloads without any issue. However, when I try to load this in
> UML I get:
>
> 1. vermagic: "blah blah" should be "blah blah x yz". Invalid format
>
> I circumvented above issue by commenting out this vermagic check in
> kernel/module.c and rebuilding UML. Now it gets past above error but
> I'm getting a kernel panic in mm/slab.c.

Perhaps this means the check you circumvented was there for a reason.

No, you can't stuff x86 modules into a UML, any more than you can
stuff 32-bit modules into a x86_64 kernel.  You need to compile UML
modules in a UML tree.

            Jeff

--
Work email - jdike at linux dot intel dot com


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.