[OpenBIOS] x86 multiboot header?

Nathan Kunkee nkunkee42 at hotmail.com
Thu Sep 30 14:24:45 CEST 2010


 > Date: Tue, 21 Sep 2010 10:07:19 +0100
> From: mark.cave-ayland at siriusit.co.uk
> To: openbios at openbios.org
> 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 header off?
> >
> > Thank you in advance for any assistance!
> > Nathan
>
> 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.
>
>
> ATB,
>
> Mark.

Hello,

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 utils/iso/boot/grub:

Index: arch/x86/multiboot.c
===================================================================
--- 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"))) =
+//static 
+const struct mbheader multiboot_header
+    __attribute__ ((section (".hdr"))) 
+=
 {
     MULTIBOOT_HEADER_MAGIC,
     MULTIBOOT_HEADER_FLAGS,

However, even with this, qemu doesn't successfully load the multiboot image:

nathan at 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
mod_start: 0x9b73cd0
mod_end:   0x9b8ba0c
cmdline: 00015018
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 http://filebin.ca/boqpcs/openbios-multi.zip [filebin.ca] if you'd like to look at my test image.

Thank you for your assistance!
Nathan

 		 	   		  


More information about the OpenBIOS mailing list