[syslinux] "isolinux.bin missing or corrupt" when booting USB flash drive in old PC
Martin Str|mberg
ams at ludd.ltu.se
Wed Mar 22 12:36:03 PDT 2017
On Wed, Mar 22, 2017 at 12:06:12PM +0100, Thomas Schmitt via Syslinux wrote:
> There is a suspicious discrepancy in the code:
>
> heads = (stack-16)
> sectors = (stack-18)
>
> ...
> /* here we computer CHS values or just do some dummy computation for EBIOS */
> 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 */
> mulw %cx /* Heads*sectors -> sectors per cylinder */
>
> Does "-16: Save sectors on the stack" contradict "sectors = (stack-18)" ?
Yes.
Congratulations Thomas, you've found the bug! Very well done. Thank you.
Changing the code to
sectors = (stack-16)
heads = (stack-18)
lets my always fail EBIOS detection version to boot the iso.
Please David if you see this, try this.
Patch:
diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S
index 6d8ab36..5a8b267 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)
--
MartinS
More information about the Syslinux
mailing list