wok diff linld/stuff/src/_BEG.ASM @ rev 24013
linld: add quick boot switch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Feb 18 08:56:43 2021 +0000 (2021-02-18) |
parents | 5c1ce90eb1d6 |
children | 61df94a0fa43 |
line diff
1.1 --- a/linld/stuff/src/_BEG.ASM Tue Jan 12 07:47:12 2021 +0000 1.2 +++ b/linld/stuff/src/_BEG.ASM Thu Feb 18 08:56:43 2021 +0000 1.3 @@ -29,7 +29,7 @@ 1.4 1.5 segment _BSS byte public use16 'BSS' 1.6 1.7 - ifdef BIG_CMDLINE 1.8 + ifdef ISOHOOK 1.9 extrn _big_cmdline:byte 1.10 db 254 dup(?) 1.11 endif 1.12 @@ -77,7 +77,7 @@ 1.13 1.14 ; Check for oldies 1.15 push bx ; < 286 : flags[12..15] are forced 1 1.16 - popf ; = 286 : flags[12..15] are forced 0 1.17 + popf ; = 286 : flags[12..15] are forced 0, cld 1.18 pushf ; > 286 : only flags[15] is forced 0 1.19 pop dx 1.20 add dh,bh ; NS=386+, S+NC=286, S+C=86/186 1.21 @@ -118,15 +118,12 @@ 1.22 ;*************************************************************** 1.23 label check_vcpi near 1.24 p386 1.25 - push ds 1.26 -; Check whether it is safe to call 67h (we trust only known EMM managers) 1.27 - push si 1.28 - pop ds 1.29 - mov ax,[word 67h*4] 1.30 - or ax,[word 67h*4+2] 1.31 - pop ds 1.32 +; Check whether it is safe to call 67h 1.33 + xor eax,eax 1.34 + mov es,ax 1.35 + cmp [dword es:67h*4],eax 1.36 je no_vcpi 1.37 - mov ax,0DE00h ; check for vcpi present 1.38 + mov ah,0DEh ; check for vcpi present 1.39 int 67h 1.40 or ah,ah 1.41 jnz no_vcpi 1.42 @@ -183,7 +180,7 @@ 1.43 org $-2 1.44 _heap_top dw ? 1.45 mov si,80h 1.46 - ifdef BIG_CMDLINE 1.47 + ifdef ISOHOOK 1.48 mov bx,offset _big_cmdline 1.49 cmp [byte si],2 1.50 jnb @@user_args 1.51 @@ -192,7 +189,7 @@ 1.52 endif 1.53 lodsb ; size 0..127 1.54 cbw 1.55 - ifdef BIG_CMDLINE 1.56 + ifdef ISOHOOK 1.57 inc ax 1.58 jnz short_cmdline 1.59 mov si,bx 1.60 @@ -235,43 +232,6 @@ 1.61 inc bx 1.62 dec cx 1.63 jmp arglp 1.64 -argdone: 1.65 - ;mov [word bx+di],0 ; argv[argc] = 0 1.66 - lea ax,[bx+di+2] 1.67 - mov [_heap_top],ax 1.68 - push di ; argv 1.69 - shr bx,1 1.70 - push bx ; argc 1.71 - ifndef filearg 1.72 - mov bx,[di+2] ; argv[1] 1.73 - extrn openargs:near 1.74 - call near openargs 1.75 - jc argend 1.76 - pop bx ; trash argc, argv >> 1Kb ! 1.77 - pop cx ; sizemax=argv 1.78 -read_cmdline: 1.79 - mov dx,di 1.80 - push dx 1.81 - xchg ax,bx 1.82 - extrn @read$cxdxbx:near ; read(fd=bx,buffer=dx,size=cx) 1.83 - call near @read$cxdxbx 1.84 - pop si ; si=buffer=argv 1.85 - add di,ax 1.86 - ifndef NO_CLOSE 1.87 - extrn close:near 1.88 - call near close 1.89 - endif 1.90 - jmp argbuild 1.91 -argend: 1.92 - endif 1.93 - 1.94 -;*************************************************************** 1.95 - extrn _main:near 1.96 - call _main 1.97 - ;never return 1.98 - 1.99 -;*************************************************************** 1.100 - 1.101 1.102 ;*************************************************************** 1.103 ;_fastcall void set_cmdline(bx:const char *filename); 1.104 @@ -308,6 +268,46 @@ 1.105 endp _topseg 1.106 endif 1.107 1.108 +;*************************************************************** 1.109 +argdone: 1.110 + ;mov [word bx+di],0 ; argv[argc] = 0 1.111 + lea ax,[bx+di+2] 1.112 + mov [_heap_top],ax 1.113 + ;push di ; argv 1.114 + ;shr bx,1 1.115 + ;push bx ; argc 1.116 + ifndef filearg 1.117 + mov bx,[di+2] ; argv[1] 1.118 + extrn openargs:near 1.119 + call near openargs 1.120 + jc argend 1.121 + ;pop bx ; trash argc, argv >> 1Kb ! 1.122 + ;pop cx ; sizemax=argv 1.123 + dec cx ; sizemax=0ffffh 1.124 +read_cmdline: 1.125 + mov dx,di 1.126 + push dx 1.127 + xchg ax,bx 1.128 + extrn @read$cxdxbx:near ; read(fd=bx,buffer=dx,size=cx) 1.129 + call near @read$cxdxbx 1.130 + pop si ; si=buffer=argv 1.131 + add di,ax 1.132 + ifndef NO_CLOSE 1.133 + extrn close:near 1.134 + call near close 1.135 + endif 1.136 + jmp argbuild 1.137 +argend: 1.138 + endif 1.139 + 1.140 +;*************************************************************** 1.141 +; extrn _main:near 1.142 +; call _main 1.143 + ;never return 1.144 + 1.145 +;*************************************************************** 1.146 + 1.147 + 1.148 ends _TEXT 1.149 1.150