# HG changeset patch # User Pascal Bellard # Date 1650473829 0 # Node ID 810e3d0a38f75e36a6b34152892e23950740dbd3 # Parent d1f31f5f64019bfb56e738b8426a2711063413fe BootProg: clear cmdline (again) diff -r d1f31f5f6401 -r 810e3d0a38f7 BootProg/stuff/boot32.asm --- a/BootProg/stuff/boot32.asm Wed Apr 20 15:10:50 2022 +0000 +++ b/BootProg/stuff/boot32.asm Wed Apr 20 16:57:09 2022 +0000 @@ -256,6 +256,7 @@ sub di, bp jae FileReadContinue + xor ax, ax pop bp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -316,7 +317,6 @@ push di push ds pop es - xor ax, ax mov [80h], ax ; clear cmdline dec ax ; both FCB in the PSP don't have a valid drive identifier diff -r d1f31f5f6401 -r 810e3d0a38f7 BootProg/stuff/bootex.asm --- a/BootProg/stuff/bootex.asm Wed Apr 20 15:10:50 2022 +0000 +++ b/BootProg/stuff/bootex.asm Wed Apr 20 16:57:09 2022 +0000 @@ -226,12 +226,12 @@ popa ; restore ax, cx, si, di add di, byte 32 - cmp di, bp - jne FindNameCycle ; next root entry + sub bp, byte 32 + jnz FindNameCycle ; next root entry popf ; restore carry="not last sector" flag jc RootDirReadContinue ; continue to the next root dir cluster FindNameFailed: ; end of root directory (dir end reached) -; mov dx, [bx] ; restore BIOS boot drive number + mov dx, [bx] ; restore BIOS boot drive number call Error db "File not found." FindNameFound: @@ -242,16 +242,16 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;; push es - xor bp, bp FileReadContinue: shr bp, 4 ; bytes to paragraphs mov di, es add di, bp ; adjust segment for next sector mov es, di ; es:0 updated - call ReadCluster ; read one cluster of root dir + call ReadCluster ; read one more sector of the boot file sub [bx+FileSize], ebp ja FileReadContinue mov dx, [bx] ; restore BIOS boot drive number + xor ax, ax pop bp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -312,7 +312,6 @@ push di push ds pop es - xor ax, ax mov [80h], ax ; clear cmdline dec ax ; both FCB in the PSP don't have a valid drive identifier @@ -392,8 +391,6 @@ ;; ES:0 -> next address ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -ReadSector: - xor ebp, ebp inc bp diff -r d1f31f5f6401 -r 810e3d0a38f7 BootProg/stuff/bootprog.sh --- a/BootProg/stuff/bootprog.sh Wed Apr 20 15:10:50 2022 +0000 +++ b/BootProg/stuff/bootprog.sh Wed Apr 20 16:57:09 2022 +0000 @@ -5,21 +5,21 @@ Example: $0 /dev/fd0 STARTUP.BIN EOT -ddo="dd of=$1 bs=1 conv=notrunc" +xd="dd of=$1 bs=1 conv=notrunc" while read c o b f; do [ "${FAT:-$(dd if="$1" bs=1 count=5 skip=$c)}" = "$f" ] || continue echo "Install $f bootsector on $1." for a in "$((o+b)) seek=$o count=$((512-o))" "$b count=11"; do - sed '1,/^exit 1/d' $0 | unlzma | $ddo skip=$a + sed '1,/^exit 1/d' $0 | unlzma | $xd skip=$a done [ "$2" ] && echo "Set boot file '$2'" && echo -n "$2" | case "$f" in E*) sed 's| |.|;s| ||g' | cat - /dev/zero;; *) tr a-z A-Z | sed 's|\.| |;s|^\(.\{8\}\) *|\1|;s|$| |' - esac | $ddo seek=499 count=11 + esac | $xd seek=499 count=11 [ "$f" = "EXFAT" ] && dd if="$1" bs=512 count=11 | od -v -An -t u1 -w1 - | LANG=C awk ' BEGIN { a=0;i=-1;m=0xFFFFFFFE } { if (++i!=106 && i!=107 && i!=112) a=or(and(lshift(a,31),m),and(rshift(a,1),m/2))+$1 } -END { b=a/256;c=b/256; for (i=0;i<128;i++) printf "%c%c%c%c",a%256,b%256,c%256,(c/256)%256 }' | $ddo seek=5632 +END { b=a/256;c=b/256; for (i=0;i<128;i++) printf "%c%c%c%c",a%256,b%256,c%256,(c/256)%256 }' | $xd seek=5632 exit 0 done 2>/dev/null <