[syslinux] where to swap

Martin Str|mberg ams at ludd.ltu.se
Sat Mar 25 12:30:05 PDT 2017


On Sat, Mar 25, 2017 at 06:51:50PM +0100, Geert Stappers via Syslinux wrote:
> It is good to see this
> ----- Forwarded message from syslinux-bot for Martin Str|mberg <ams at ludd.ltu.se> -----
> Date: Sat, 25 Mar 2017 05:54:09 -0700
> From: syslinux-bot for Martin Str|mberg <ams at ludd.ltu.se>
> Subject: [syslinux:master] mbr/isohdpfx.S: correct pointer for heads/sectors
> Commit-ID:  48e94f4fa7b3c32cbd43b6e57c64bc933f76d059
> Gitweb:     http://www.syslinux.org/commit/48e94f4fa7b3c32cbd43b6e57c64bc933f76d059
> Author:     Martin Str|mberg <ams at ludd.ltu.se>
...
> diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
> index 17e1efe..a693ccb 100644
> --- a/mbr/isohdpfx.S
> +++ b/mbr/isohdpfx.S
> @@ -48,8 +48,8 @@ isolinux_start_hybrid		= 0x7c00+64+4
>  stack		= 0x7c00
>  partoffset	= (stack-8)
>  driveno		= (stack-14)
> -heads		= (stack-16)
> -sectors		= (stack-18)
> +sectors		= (stack-16)
> +heads		= (stack-18)
>  ebios_flag	= (stack-20)
>  secpercyl	= (stack-24)

Yes. It is. However by now we know that that correction is wrong. You
need to revert that and use the one in
<http://www.syslinux.org/archives/2017-March/025706.html>. Here pasted
(so might not apply cleanly):

diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 17e1efe..14eca14 100644
--- a/mbr/isohdpfx.S
+++ b/mbr/isohdpfx.S
@@ -151,7 +151,7 @@ next:

   /* Check to see if we have EBIOS */
      pushw %dx	      /* drive number */
-    movb      $0x41, %ah      /* %al == 0 already */
+    movb      $0x41, %ah
     movw      $0x55aa, %bx
     xorw     %cx, %cx
     xorb %dh, %dh
@@ -167,20 +167,22 @@ next:
       read_sector_cbios: movb $0x42, %ah ;  jmp read_common */
     movl	 $0xeb42b4+((read_common-read_sector_cbios-4) << 24), (read_sector_cbios)
-	jmp	1f
+	jmp	2f
1:
+	xor	%cx, %cx	/* Clear EBIOS flag. */
+2:
	popw	%dx
 	pushw	%cx		/* EBIOS flag */

	/* 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 */


Given David's last report the part:
-       jmp     1f
+       jmp     2f
1:
+       xor     %cx, %cx        /* Clear EBIOS flag. */
+2:

can be ignored. His BIOS isn't corrputing CX (which I
thought). However that part doesn't hurt if it remains.


-- 
MartinS


More information about the Syslinux mailing list