[syslinux:elflink] mbr: Add support for loading VBRs from XFS filesystems

syslinux-bot for Paulo Alcantara pcacjr at zytor.com
Tue Nov 27 12:57:04 PST 2012


Commit-ID:  4298786ca19e9121568ecd4cc8b79d276ccfd24a
Gitweb:     http://www.syslinux.org/commit/4298786ca19e9121568ecd4cc8b79d276ccfd24a
Author:     Paulo Alcantara <pcacjr at zytor.com>
AuthorDate: Fri, 8 Jun 2012 18:07:59 -0300
Committer:  Paulo Alcantara <pcacjr at zytor.com>
CommitDate: Sat, 21 Jul 2012 01:21:45 -0300

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 at zytor.com>

---
 mbr/mbr.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/mbr/mbr.S b/mbr/mbr.S
index b71cfb7..270a356 100644
--- a/mbr/mbr.S
+++ b/mbr/mbr.S
@@ -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 */


More information about the Syslinux-commits mailing list