Skip to contentSkip to conversation

multiboot: set boot_device to first partition

PATCH Applied Arun Thomas 3 participants 5 messages Apr 28, 2011 – Jun 3, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multiboot: set boot_device to first partition

The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, which maps to the second primary partition. To specify the first primary partition, 'part1' should be set to 0x00, since partition numbers start from zero according to the multiboot spec.

---
 hw/multiboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +1 -1
index 394ed01..6e6cfb9 100644
@@ -307,7 +307,7 @@ int load_multiboot(void *fw_cfg,
                                 | MULTIBOOT_FLAGS_MMAP);
     stl_p(bootinfo + MBI_MEM_LOWER,   640);
     stl_p(bootinfo + MBI_MEM_UPPER,   (ram_size / 1024) - 1024);
-    stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8001ffff); /* XXX: use the -boot switch? */
+    stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8000ffff); /* XXX: use the -boot switch? */
     stl_p(bootinfo + MBI_MMAP_ADDR,   ADDR_E820_MAP);
 
     mb_debug("multiboot: mh_entry_addr = %#x\n", mh_entry_addr);
Signature · 1 line
tg: (d16e0f0..) bootdev (depends on: master)
#1 lore raw
Quoted 6 lines · Arun Thomas

The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, which maps to the second primary partition. To specify the first primary partition, 'part1' should be set to 0x00, since partition numbers start from zero according to the multiboot spec.

Which OSes have you tested? Xen? Solaris?

Stefan

#2 lore raw
Quoted 9 lines · Stefan Hajnoczi
Quoted 6 lines · Arun Thomas

The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, which maps to the second primary partition. To specify the first primary partition, 'part1' should be set to 0x00, since partition numbers start from zero according to the multiboot spec.

Which OSes have you tested?  Xen?  Solaris?

I tested Solaris (OpenIndiana Build 148), and it boots fine. I haven't been able to try Xen. Linux also boots fine, as expected.

Thanks,
Arun

Reviewed-by
#3 lore raw
Quoted 7 lines · Arun Thomas
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Arun Thomas

The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, which maps to the second primary partition. To specify the first primary partition, 'part1' should be set to 0x00, since partition numbers start from zero according to the multiboot spec.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Which OSes have you tested?  Xen?  Solaris?

I tested Solaris (OpenIndiana Build 148), and it boots fine. I haven't been able to try Xen. Linux also boots fine, as expected.

Okay, if Solaris boots that's a good sign. According to the spec your change is correct, I think this patch should be applied.

#4 lore raw
In reply to Arun Thomas
Quoted 10 lines · Arun Thomas

The multiboot info struct's 'boot_device' field has 'part1' set to 0x01, which maps to the second primary partition. To specify the first primary partition, 'part1' should be set to 0x00, since partition numbers start from zero according to the multiboot spec.

---
 hw/multiboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

Quoted 17 lines
hw/multiboot.c +1 -1
index 394ed01..6e6cfb9 100644
@@ -307,7 +307,7 @@ int load_multiboot(void *fw_cfg,
                                 | MULTIBOOT_FLAGS_MMAP);
     stl_p(bootinfo + MBI_MEM_LOWER,   640);
     stl_p(bootinfo + MBI_MEM_UPPER,   (ram_size / 1024) - 1024);
-    stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8001ffff); /* XXX: use the -boot switch? */
+    stl_p(bootinfo + MBI_BOOT_DEVICE, 0x8000ffff); /* XXX: use the -boot switch? */
     stl_p(bootinfo + MBI_MMAP_ADDR,   ADDR_E820_MAP);
 
     mb_debug("multiboot: mh_entry_addr = %#x\n", mh_entry_addr);
Signature · 1 line
tg: (d16e0f0..) bootdev (depends on: master)
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net