On 29.06.2012, at 14:23, Alexander Graf wrote:
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.
To unsubscribe, e-mail: opensuse-arm+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-arm+owner(a)opensuse.org