[opensuse-arm] parted and x86 bootinfo in the MBR
Hi Petr, When running parted to create or modify an MBR label, it tries to be clever and throws a dummy x86 boot sector onto the MBR, so the disk is bootable on PCs. While that's nice and helpful for a bunch of use cases, it doesn't exactly help when running on ARM. Some ARM devices, such as the OMAP3 series, have a buggy boot rom that simply goes into nirvana if it finds non-0 in the first 4 bytes of the SD card. Please see libparted/labels/dos.c:1271 for the place that copies a generic x86 asm MBR into the MBR when its first byte is 0. We need to have the first byte be 0 though. Otherwise later on the whole machine won't be bootable anymore :). Any idea how to resolve this? The easy fix I could imagine would be to just not do the fixup on ARM, but that sounds slightly hackish :(. Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On 29.06.2012, at 14:23, Alexander Graf wrote:
Hi Petr,
When running parted to create or modify an MBR label, it tries to be clever and throws a dummy x86 boot sector onto the MBR, so the disk is bootable on PCs.
While that's nice and helpful for a bunch of use cases, it doesn't exactly help when running on ARM. Some ARM devices, such as the OMAP3 series, have a buggy boot rom that simply goes into nirvana if it finds non-0 in the first 4 bytes of the SD card.
Please see libparted/labels/dos.c:1271 for the place that copies a generic x86 asm MBR into the MBR when its first byte is 0.
We need to have the first byte be 0 though. Otherwise later on the whole machine won't be bootable anymore :). Any idea how to resolve this? The easy fix I could imagine would be to just not do the fixup on ARM, but that sounds slightly hackish :(.
Hmm. Maybe we could extend the boot loader code to just do 0: 00 00 add %al,(%eax) 2: 00 00 add %al,(%eax) as the first instructions? That way the first 4 bytes would always be zero :). As long as %eax doesn't point to some MMIO memory, that should work fine. We overwrites %ax right as the 2nd instruction anyway, so the contents don't matter. Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Fri, Jun 29, 2012 at 02:23:01PM +0200, Alexander Graf wrote:
Hi Petr,
Hi Alex,
When running parted to create or modify an MBR label, it tries to be clever and throws a dummy x86 boot sector onto the MBR, so the disk is bootable on PCs.
While that's nice and helpful for a bunch of use cases, it doesn't exactly help when running on ARM. Some ARM devices, such as the OMAP3 series, have a buggy boot rom that simply goes into nirvana if it finds non-0 in the first 4 bytes of the SD card.
Please see libparted/labels/dos.c:1271 for the place that copies a generic x86 asm MBR into the MBR when its first byte is 0.
We need to have the first byte be 0 though. Otherwise later on the whole machine won't be bootable anymore :). Any idea how to resolve this? The easy fix I could imagine would be to just not do the fixup on ARM, but that sounds slightly hackish :(.
It can easily hide in the pile of other hacks in parted ;) I created https://bugzilla.novell.com/show_bug.cgi?id=769789 and submitted a fix to Factory (and 12.2).
Alex
Thanks, Petr -- Petr Uzel IRC: ptr_uzl @ freenode
On 03.07.2012, at 15:43, Petr Uzel wrote:
On Fri, Jun 29, 2012 at 02:23:01PM +0200, Alexander Graf wrote:
Hi Petr,
Hi Alex,
When running parted to create or modify an MBR label, it tries to be clever and throws a dummy x86 boot sector onto the MBR, so the disk is bootable on PCs.
While that's nice and helpful for a bunch of use cases, it doesn't exactly help when running on ARM. Some ARM devices, such as the OMAP3 series, have a buggy boot rom that simply goes into nirvana if it finds non-0 in the first 4 bytes of the SD card.
Please see libparted/labels/dos.c:1271 for the place that copies a generic x86 asm MBR into the MBR when its first byte is 0.
We need to have the first byte be 0 though. Otherwise later on the whole machine won't be bootable anymore :). Any idea how to resolve this? The easy fix I could imagine would be to just not do the fixup on ARM, but that sounds slightly hackish :(.
It can easily hide in the pile of other hacks in parted ;)
I created https://bugzilla.novell.com/show_bug.cgi?id=769789 and submitted a fix to Factory (and 12.2).
Awesome! Thank you :) Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (2)
-
Alexander Graf
-
Petr Uzel