Date: Tue, 21 Sep 2010 10:07:19 +0100
Subject: Re: [OpenBIOS] x86 multiboot header?
Nathan Kunkee wrote:
> Hi all,
> As of revision 861, I am unable to build a working multiboot image. I am working on
Ubuntu 10.4, gcc 4.4. Although OpenSolaris b134, gcc4, also doesn't work.
> Grub 1.95 doesn't recognize the file as a multiboot file. QEMU crashes when
passed this via -kernel (something about running code near 0xa000). Sure enough, I can
find the second header for 0x2BAD but not 0x1BAD. Is the linker script that prefixes the
> Thank you in advance for any assistance!
Interesting. Did you find r861 as the result of an SVN bisect? If so,
posting a link to your test image so that someone could debug this would
be very helpful.
I should have said "As of the latest commit (r861)..." since I wanted to convey
that I'd tried the latest sources, not that a particular revision introduced this, nor
that I found it with a bisect.
I found the following change enabled the multiboot image to load with the embedded
--- arch/x86/multiboot.c (revision 872)
+++ arch/x86/multiboot.c (working copy)
@@ -15,8 +15,10 @@
unsigned int magic, flags, checksum;
-static const struct mbheader multiboot_header
- __attribute__((section (".hdr"))) =
+const struct mbheader multiboot_header
+ __attribute__ ((section (".hdr")))
However, even with this, qemu doesn't successfully load the multiboot image:
nathan@fangorn:~/openbios-devel/obj-x86$ /usr/local/build/qemu/i386-softmmu/qemu -L
/usr/local/src/qemu/pc-bios/ -kernel openbios.multiboot -initrd openbios-x86.dict
qemu: I believe we found a multiboot image!
multiboot: mh_header_addr = 0
multiboot: mh_load_addr = 0x8
multiboot: mh_load_end_addr = 0x9
multiboot: mh_bss_end_addr = 0x1
qemu: loading multiboot kernel (0x14d28 bytes) at 0x8
multiboot loading module: openbios-x86.dict
mod00: 00016008 - 0002dd44
multiboot: mh_entry_addr = 0x42464c45
mb_buf_phys = 00000008
mod_start = 00016008
mb_mods_count = 1
qemu: fatal: Trying to execute code outside RAM or ROM at 0x42464c45
I've uploaded a zip (openbios-multi.zip) to
[filebin.ca] if you'd like to look at my
Thank you for your assistance!