On Thu, May 8, 2008 at 11:53 PM, K D <[EMAIL PROTECTED]> wrote:
> Hi Manish
>
> I built my base kernel and UML from same 2.6.24 source but I built them from
> seperate directories..something like below:
>
> /home/user/basekernel/linux-2.6.24/ ===> under here I've built the kernel
> /home/user/uml-krnl/linux-2.6.24/ ==> UML
>
> This is all I did while building UML kernel:
>
> 1. untar linux source
> 2. Edit Makefile and put that "EXTRAVERSION"
> 3. make defconfig ARCH=um
> 4. make menuconfig ARCH=um
> 4.1. enabled "Host File System" option.
> 5. make linux ARCH=um
>
Ok... I am not sure what is going wrong..but this is what I do and
it works for me...so probably it will work for you too. I compile
my modules against the same kernel which I am runnning.
[EMAIL PROTECTED] ~]# mount -t hostfs none /mnt/host
[EMAIL PROTECTED] fs]# cat a.ksh
rm -f *.o *.ko
make -C /mnt/host/home/mkatiyar/personal/uml/linux-2.6.23.12 M=`pwd` modules
[EMAIL PROTECTED] fs]#
ie... mount the baseuml kernel tree under hostfs and compile against
it. You can give it a shot
Hope that helps...
> Can send Makefile later..isn't that quite big to upload here?
>
> thanks for helping
>
>
>
> - Original Message
> From: Manish Katiyar <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]; user-mode-linux-user
>
> Sent: Thursday, May 8, 2008 12:04:28 AM
> Subject: Fwd: [uml-user] do i have to recompile my module in UML
>
> -- Forwarded message --
> From: K D <[EMAIL PROTECTED]>
> Date: Thu, May 8, 2008 at 12:27 PM
> Subject: [uml-user] do i have to recompile my module in UML
> To: user-mode-linux-user@lists.sourceforge.net
>
>
>
> Hi
>
> Am newbie to UML. I have 2.6.24 kernel, which I've built from source.
> I've also built UML from 2.6.24 in different directory. I could load
> UML from my host OS and mount hostfs without any issue. This is how I
> built UML from source,
>
> 1. untar linux source
> 2. make defconfig ARCH=um
> 3. make menuconfig ARCH=um
> i've set only option 'host file system access', saved the config and did
> 4. make linux ARCH=um
>
> 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
>
>
> Which kernel source tree you compiled against ?? How does your
> makefile look like.
>
>
> 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. here is the trace:
>
> I added this printk() in mm/slab.c to print the name, size of 'prot'
> struct and they seem to be NULL and 0. THe same code works without any
> issue while loading in host OS.
>
> ==
> proto_register: name [] size 0
> kmem_cache_create: Early error in slab
> BUG: failure at mm/slab.c:2166/kmem_cache_create()!
> Kernel panic - not syncing: BUG!
>
> EIP: 0073:[] CPU: 0 Not tainted ESP: 007b:bf8e97c0 EFLAGS:
> 0246
> Not tainted
> EAX: ffda EBX: 40153008 ECX: 000339d7 EDX: 0804a008
> ESI: EDI: EBP: bf8e9828 DS: 007b ES: 007b
> 0bdc3dc0: [<08069c54>] show_regs+0xb4/0xb9
> 0bdc3dec: [<08058c46>] panic_exit+0x25/0x3f
> 0bdc3e00: [<08085084>] notifier_call_chain+0x21/0x46
> 0bdc3e20: [<0808511f>] __atomic_notifier_call_chain+0x17/0x19
> 0bdc3e3c: [<08085136>] atomic_notifier_call_chain+0x15/0x17
> 0bdc3e58: [<080704be>] panic+0x52/0xdd
> 0bdc3e78: [<080a87c0>] kmem_cache_create+0x1a1/0x3e0
> 0bdc3ec0: [<08145894>] proto_register+0x47/0x1db
> 0bdc3efc: [<0c838012>] mymod_init+0x12/0x6a [mymod]
> 0bdc3f14: [<08058fb7>] handle_syscall+0x83/0x9c
> 0bdc3f60: [<08066b72>] handle_trap+0xd8/0xe1
> 0bdc3f7c: [<08066fe2>] userspace+0x1ac/0x249
> 0bdc3fdc: [<08056a36>] fork_handler+0x74/0x7c
> 0bdc3ffc: [<>] obsolete_checksetup+0xf7fb7000/0x88
>
> Segmentation fault
> [EMAIL PROTECTED] uml]#
>
> I must be doing something very basic.
>
> Also the output of "lsmod" is empty inside UML.
>
> Should (or Can) I recompile my module inside UML?
>
> thanks for your help.
>
>
>
>
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
> now.
> -
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> ___
> User-mode-linux-user mailing list
> User-mode-linux-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
>
>
>
>
> --
> Thanks & Regards,
> *