wok diff BootProg/stuff/boot32.asm @ rev 24942
BootProg: clear cmdline
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Apr 20 15:10:50 2022 +0000 (2022-04-20) |
parents | 7c0170dd3ecc |
children | 810e3d0a38f7 |
line diff
1.1 --- a/BootProg/stuff/boot32.asm Wed Feb 23 11:49:52 2022 +0000 1.2 +++ b/BootProg/stuff/boot32.asm Wed Apr 20 15:10:50 2022 +0000 1.3 @@ -265,7 +265,6 @@ 1.4 mov ds, bp ; bp=ds=seg the file is loaded to 1.5 1.6 add bp, [bx+08h] ; bp = image base 1.7 - mov ax, [bx+06h] ; ax = reloc items 1.8 mov di, [bx+18h] ; di = reloc table pointer 1.9 1.10 cmp word [bx], 5A4Dh ; "MZ" signature? 1.11 @@ -275,9 +274,9 @@ 1.12 ;; Setup and run a .COM program ;; 1.13 ;; Set CS=DS=ES=SS SP=0 IP=100h ;; 1.14 ;; AX=0ffffh BX=0 CX=0 DX=drive ;; 1.15 +;; and cmdline=void ;; 1.16 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.17 1.18 - mov ax, 0ffffh ; both FCB in the PSP don't have a valid drive identifier 1.19 mov di, 100h ; ip 1.20 mov bp, ImageLoadSeg-10h ; "org 100h" stuff :) 1.21 mov ss, bp 1.22 @@ -289,7 +288,7 @@ 1.23 ;; Relocate, setup and run a .EXE program ;; 1.24 ;; Set CS:IP, SS:SP, DS, ES and AX according ;; 1.25 ;; to wiki.osdev.org/MZ#Initial_Program_State ;; 1.26 -;; AX=0ffffh BX=0 CX=0 DX=drive ;; 1.27 +;; AX=0ffffh BX=0 CX=0 DX=drive cmdline=void ;; 1.28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.29 1.30 ReloCycle: 1.31 @@ -300,13 +299,11 @@ 1.32 scasw ; point to next entry 1.33 1.34 RelocateEXE: 1.35 - dec ax ; 32768 max (128KB table) 1.36 - jns ReloCycle ; leave with ax=0ffffh: both FCB in the 1.37 - ; PSP don't have a valid drive identifier 1.38 - les si, [bx+0Eh] 1.39 - add si, bp 1.40 - mov ss, si ; ss for EXE 1.41 - mov sp, es ; sp for EXE 1.42 + dec word [bx+06h] ; reloc items, 32768 max (128KB table) 1.43 + jns ReloCycle 1.44 + 1.45 + add [bx+0Eh], bp 1.46 + lss sp, [bx+0Eh] ; ss:sp for EXE 1.47 1.48 lea si, [bp-10h] ; ds and es both point to the segment 1.49 push si ; containing the PSP structure 1.50 @@ -319,6 +316,9 @@ 1.51 push di 1.52 push ds 1.53 pop es 1.54 + xor ax, ax 1.55 + mov [80h], ax ; clear cmdline 1.56 + dec ax ; both FCB in the PSP don't have a valid drive identifier 1.57 1.58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.59 ;; Set the magic numbers so the program knows that it ;; 1.60 @@ -431,6 +431,12 @@ 1.61 ReadSectorNext: 1.62 ret 1.63 1.64 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.65 +;; Fill free space with zeroes ;; 1.66 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.67 + 1.68 + times (512-13-20-($-$$)) db 0 1.69 + 1.70 ;;;;;;;;;;;;;;;;;;;;;;;;;; 1.71 ;; Error Messaging Code ;; 1.72 ;;;;;;;;;;;;;;;;;;;;;;;;;; 1.73 @@ -452,12 +458,6 @@ 1.74 hlt 1.75 jmp short Stop 1.76 1.77 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.78 -;; Fill free space with zeroes ;; 1.79 -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.80 - 1.81 - times (512-13-($-$$)) db 0 1.82 - 1.83 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1.84 ;; Name of the file to load and run ;; 1.85 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;