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> To: Syslinux commits mailing list <syslinux-commits at zytor.com> Cc: ams at ludd.ltu.se Subject: [syslinux:master] mbr/isohdpfx.S: correct pointer for heads/sectors X-Mailer: Syslinux-git-log-daemon Commit-ID: 48e94f4fa7b3c32cbd43b6e57c64bc933f76d059 Gitweb: http://www.syslinux.org/commit/48e94f4fa7b3c32cbd43b6e57c64bc933f76d059 Author: Martin Str|mberg <ams at ludd.ltu.se> AuthorDate: Sat, 25 Mar 2017 08:15:04 -0400 Committer: Gene Cumm <gene.cumm at gmail.com> CommitDate: Sat, 25 Mar 2017 08:15:10 -0400 mbr/isohdpfx.S: correct pointer for heads/sectors sectors is pushed first then heads but pointers were in reverse order. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- mbr/isohdpfx.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) _______________________________________________ Syslinux-commits mailing list Syslinux-commits at zytor.com http://www.zytor.com/mailman/listinfo/syslinux-commits ----- End forwarded message ----- And please see also the patch in http://www.syslinux.org/archives/2017-March/025706.html In that patch is the push to stack order swapped. So my question is: Where to swap? Groeten Geert Stappers -- Leven en laten leven
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
Hi, Martin Str|mberg wrote:> 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.I think it still has good reason to exist. The test cmpw $0xaa55, %bx jne 1f could cause a jump which could push a non-zero CX to the stack. (Whatever reason there might be not to get the 0xaa55 signature but to get non-zero CX.) I have now updated the Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857597#55 Have a nice day :) Thomas
Maybe Matching Threads
- where to swap
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC
- fwd: [syslinux:syslinux-4.xx] mbr/isohdpfx.S: correct stack for heads/sectors
- "isolinux.bin missing or corrupt" when booting USB flash drive in old PC