|
From: | Jens Nyberg |
Subject: | Re: [Qemu-devel] Multiboot using -kernel and -initrd stopped working |
Date: | Sat, 20 Jul 2013 23:07:38 +0200 |
I have some information to go on:The problem occurs because of a failed call to rom_copy from hw/i386/multiboot.cI print debugged some values:ELF_LOW: 0x100000ELF_HIGH: 0x14c578MH_LOAD_ADDR: 0x100000MH_KERNEL_SIZE: 0x4c578MH_ENTRY_ADDR: 0x10000cCOPY SIZE: 0x4210The return value from rom_copy (found in hw/core/loader.c) is compared with mh_kernel_size to see they are the same. If they are not qemu will exit and print the error message I got. As you can see in this printout mh_kernel_size is 0x4c578 and the return value was 0x4210. Now something goes wrong here. I suspect it doesnt take into the account that there can be more program headers for elf so it just takes the first one.So to confirm this I ran readelf -a fudge I get this information about my binary:Program Headers:Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg AlignLOAD 0x001000 0x00100000 0x00100000 0x04210 0x04210 R E 0x1000LOAD 0x006000 0x00105000 0x00105000 0x00000 0x47578 RW 0x1000GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4As you can see the MemSiz field contains the value 0x4210 meaning rom_copy only copys the first program header but not the second causing this problem.I will try to see if I can fix this so that qemu takes into account all program headers.// Jens2013/7/20 Jens Nyberg <address@hidden>Hi!I develop my own operating system and I have been using this command to start my operating system:$ qemu-system-x86_64 -kernel fudge -initrd initrd.tar
I just recently upgraded the qemu package for arch linux and now this does not seem to work anymore. I get this error message:Error while fetching elf kernel from romSo I checked out the latest version of qemu from git today and did a build but it had the same result.Now I havent made any changes to my kernel so I know I havent screwed anything up in that regard. It is a normal 32 bit x86 multiboot compliant kernel so it should work using these commands. I run qemu on a x86_64 machine.I'd like to help sort this issue out. I will do my best to collect any data you might be interested in. I will try to figure out what change made this not work but it will take some time so if anyone has an idea what commit-id it is please let me know.ThanksJens
[Prev in Thread] | Current Thread | [Next in Thread] |