[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#857597: "isolinux.bin missing or corrupt" when booting USB flash drive in old PC


the following patch has been committed to SYSLINUX to fix the C/H/S
addressing problems in isohybrid MBR and isolinux.bin :

diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 17e1efe..f9e9691 100644
--- a/mbr/isohdpfx.S
+++ b/mbr/isohdpfx.S
@@ -175,12 +175,12 @@ next:
	/* Get (C)HS geometry */
	movb	$0x08, %ah
	int	$0x13
-	andw 	$0x3f, %cx	/* Sector count */
	popw	%bx		/* EBIOS flag */
-	pushw 	%cx		/* -16: Save sectors on the stack */
	movzbw	%dh, %ax	/* dh = max head */
	incw	%ax		/* From 0-based max to count */
-	pushw 	%ax		/* -18: Save heads on the stack */
+	pushw 	%ax		/* -16: Save heads on the stack */
+	andw 	$0x3f, %cx	/* Sector count */
+	pushw 	%cx		/* -18: Save sectors on the stack */
	mulw	%cx		/* Heads*sectors -> sectors per cylinder */
	pushw	%bx		/* -20: EBIOS flag */

The other part of the changeset proposed on 25 Mar 2017 is now committed as
It fixes the problem that an early decision against LBA addressing after
INT 13 AH 41 could push a non-zero CX value to the stack, which
isolinux.bin would pop and interpret as instruction to use LBA addressing.
(isolinux.bin is wrong here. It should only use LBA if bit 0 of the
 popped CX is set. But even that could be wrongly sent from MBR if not
 the "Clear EBIOS flag" fix is applied.)

Have a nice day :)


Reply to: