diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2012-06-08 18:07:59 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-07-21 01:21:45 -0300 |
commit | 4298786ca19e9121568ecd4cc8b79d276ccfd24a (patch) | |
tree | e1a3607530069734e06ca59fdc4e29e3402dd0b8 | |
parent | a126f17f663c438ef264a459fa130951dbac780d (diff) | |
download | syslinux-4298786ca19e9121568ecd4cc8b79d276ccfd24a.tar.gz syslinux-4298786ca19e9121568ecd4cc8b79d276ccfd24a.tar.xz syslinux-4298786ca19e9121568ecd4cc8b79d276ccfd24a.zip |
mbr: Add support for loading VBRs from XFS filesystems
Before reading the VBR into 0x7C00, we need to check the first 4 bytes of
the read sector and check whether it is a XFS superblock or not. If it
is, then we need to read the right sector, which is the 4th sector of
the XFS partition where the Syslinux boot sector lives in.
This patch adds support for booting off XFS partitions properly on
MBR HDDs.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | mbr/mbr.S | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -265,6 +265,19 @@ boot: movl %eax, 8(%si) /* Adjust in-memory partition table entry */ call read_sector jc disk_error + + /* Check if the read sector is a XFS superblock */ + cmpl $0x42534658, (bootsec) /* "XFSB" */ + jne no_xfs + + /* We put the Syslinux boot sector at offset 0x800 (4 sectors), so we + * need to adjust %eax (%eax + 4) to read the right sector into 0x7C00. + */ + addl $0x800 >> 0x09, %eax /* plus 4 sectors */ + call read_sector + jc disk_error + +no_xfs: cmpw $0xaa55, (bootsec+510) jne missing_os /* Not a valid boot sector */ movw $driveno, %sp /* driveno == bootsec-6 */ |