# HG changeset patch # User Pascal Bellard # Date 1489049662 -3600 # Node ID fd4b65b5c1de989696b8b1cf679f35d1a40d6d8b # Parent e619bff66a024f5d96b7e94e6ef78642398d4bd1 syslinux/iso2exe: follow boot flag (again) diff -r e619bff66a02 -r fd4b65b5c1de syslinux/stuff/iso2exe/bootiso.S --- a/syslinux/stuff/iso2exe/bootiso.S Wed Mar 08 15:32:40 2017 +0100 +++ b/syslinux/stuff/iso2exe/bootiso.S Thu Mar 09 09:54:22 2017 +0100 @@ -1,5 +1,6 @@ .text .code16 + .arch i8086 .org 0 CODESZ = 0x8000 // 16 sectors = 32Kb @@ -121,7 +122,7 @@ .org 0x01B8 ////////////////////////// partition boot code //////////////////////////////// -// assume CS=DS=SS=0 BX=7C00 DL= SI=7DBE +// assume CS=DS=SS=0 AH=00 BX=7C00 CX=0100 DL= SI=7DBE .org 0x7C00 jmp bootpartition @@ -134,28 +135,31 @@ popw %di movw $table,%si call movepartition + movw $patch-16,%di movb $4,%cl - movw $table-16,%di + movb $16,%al next: - addw $16,%di + addw %ax,%di cmpb %ch,(%di) // boot flag ? loope next pushw %ds pushw %ds - pushl 8(%di) + pushw 10(%di) + pushw 8(%di) pushw %ds pushw %bx - pushw $1 - pushw $0x10 + movb $1,%cl + pushw %cx + pushw %ax movw %sp,%si // assume %ds = %ss + pushw %bx + cmpw %ax,2(%di) // empty or isolinux partition ? + jbe default movb $0x42,%ah - pushw %bx - cmpw $63,2(%di) // empty or isolinux partition ? - jbe default int $0x13 default: ret - .org 0x7DEF + .org 0x7DF0 bootpartition: pushw %ds popw %es @@ -163,12 +167,12 @@ movw %bx,%di movsw movsb - movw $partcode+0x100,%di + movw $0x7E00,%di pushw %di movepartition: - movw $66/2,%cx + movb $66,%cl // 0142 and 0042 rep - movsw + movsb ret .org 0x7E00 @@ -207,6 +211,7 @@ popfw // restore flags (IOPL) addb %ah, %bh // test F0 and 00 cases js is86 // NS=386+, NC=286 + .arch i486 is386: smsww %ax // not privileged andb $1, %al @@ -220,6 +225,7 @@ //movb $EXESTR(realmodemsg), %al realmode: call *%bp + .arch i8086 is86: movw comstart-end_header(%di), %si // .com address pushw %di @@ -228,6 +234,7 @@ movsw ret + .arch i486 CallVCPI: int $0x67 testb %ah, %ah diff -r e619bff66a02 -r fd4b65b5c1de syslinux/stuff/iso2exe/iso2exe.sh --- a/syslinux/stuff/iso2exe/iso2exe.sh Wed Mar 08 15:32:40 2017 +0100 +++ b/syslinux/stuff/iso2exe/iso2exe.sh Thu Mar 09 09:54:22 2017 +0100 @@ -123,7 +123,7 @@ store 417 $(($i/512)) $1 8 printf "Moving syslinux hybrid boot record at %04X (512 bytes) ...\n" $i ddq if=$2 bs=1 count=512 of=$1 seek=$i conv=notrunc - if [ $(get $((0x7C00)) /tmp/exe$$) -eq 60649 ]; then + if [ $(get $((0x7C00)) /tmp/exe$$) -eq 60905 ]; then ddq if=/tmp/exe$$ bs=1 count=66 skip=$((0x7DBE)) of=$1 seek=$(($i + 0x1BE)) conv=notrunc ddq if=$1 bs=1 count=3 skip=$i of=$1 seek=$(($i + 0x1BE)) conv=notrunc ddq if=/tmp/exe$$ bs=1 count=3 skip=$((0x7C00)) of=$1 seek=$i conv=notrunc @@ -270,7 +270,7 @@ fileofs $f [ $SIZE -eq 0 ] || ddq bs=1 count=$SIZE skip=$OFFSET if="$ISO" >$f - if [ "$f" == "syslinux.mbr" ] && [ $(get 0 "$f") -eq 60649 ]; then + if [ "$f" == "syslinux.mbr" ] && [ $(get 0 "$f") -eq 60905 ]; then ddq bs=1 conv=notrunc if="$f" of="$f" skip=$((0x1BE)) seek=0 count=3 ddq bs=1 skip=$((0x1BE)) count=66 if="$ISO" | \ ddq bs=1 seek=$((0x1BE)) count=66 of="$f" conv=notrunc