wok diff linld/stuff/src/JUMP.ASM @ rev 23804

Up cryptsetup (2.3.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 24 07:30:14 2020 +0000 (2020-05-24)
parents 65ea21135647
children d70f7cc6e3ac
line diff
     1.1 --- a/linld/stuff/src/JUMP.ASM	Sat Nov 09 13:26:32 2019 +0100
     1.2 +++ b/linld/stuff/src/JUMP.ASM	Sun May 24 07:30:14 2020 +0000
     1.3 @@ -92,40 +92,30 @@
     1.4  		endif
     1.5  		;cli				; we start doing destructive things to DOS
     1.6  		extrn	sssp:word
     1.7 -		mov	es,[sssp+2]
     1.8 -		push	es
     1.9 -		pop	ss
    1.10 -		mov	sp,0A000h
    1.11 -		extrn	_csip:dword
    1.12 -		ifdef NO386
    1.13 -		mov	si,offset _csip
    1.14 -		lodsw
    1.15 -		push	[word si]
    1.16 -		push	ax
    1.17 -		else
    1.18 -		push	[dword _csip]
    1.19 -		endif
    1.20 -
    1.21 -		ifdef	NO386
    1.22 -		mov	cx,ss
    1.23 -		add	ch,9
    1.24 -		push	cx			; topseg()+0x0900
    1.25 -		else
    1.26 -		push	9800h+(4096/16)		; 4096 bytes for cmdline
    1.27 -		endif
    1.28 -
    1.29 +		mov	ax,[sssp+2]
    1.30 +		mov	es,ax
    1.31  		extrn	_cmdline:word
    1.32  		mov	si,[_cmdline]
    1.33  		mov	di,8000h
    1.34 -		mov	ch,10h			; 4k
    1.35 +		mov	cx,2000h		; 4k for cmdline + 4k up to sp
    1.36  		rep
    1.37  		  movsb
    1.38 +		push	es
    1.39 +		pop	ss
    1.40 +		mov	sp,di
    1.41  
    1.42 -		mov	cl,0			; load high ?
    1.43 +		mov	dx,2000h
    1.44 +		global	_csip_hilo:word
    1.45 +		org	$-2
    1.46 +_csip_hilo	dw	?
    1.47 +		xchg	al,dh	; 9020 / 9000
    1.48 +		push	ax
    1.49 +		push	dx	; 0000 / 0042
    1.50 +
    1.51 +		mov	cl,1			; load high ?
    1.52  		org	$-1
    1.53 -		global	_pm_high:byte
    1.54 -_pm_high	db	?
    1.55 -		inc	cx
    1.56 +		global	_pm_low:byte
    1.57 +_pm_low		db	?
    1.58  		push	cx
    1.59  		mov	ax,[word ss:024Ch]
    1.60  		xor	ax,2b30h		; ipxe ?
    1.61 @@ -141,29 +131,8 @@
    1.62  
    1.63  @@notipxe:
    1.64  		pop	cx
    1.65 -		pop	es			; min 2048 bytes for stack
    1.66  		loop	@@isbzimage
    1.67  
    1.68 -		; self move
    1.69 -		;cld
    1.70 -		extrn	gdt_data
    1.71 -		mov	cx,offset gdt_data+8
    1.72 -		xor	di,di			;  A000 -9000 -0800(>movedend)
    1.73 -		rep
    1.74 -		  movsb
    1.75 -		mov	si,offset _imgs+2
    1.76 -		lodsw
    1.77 -		xchg	ax,bx			; get pm->fallback low word
    1.78 -		lodsw				; get pm->fallback high word
    1.79 -		ifdef	MOVE_SETUP
    1.80 -		mov	si,0
    1.81 -	global	_rm_offset:word
    1.82 -		org	$-2
    1.83 -_rm_offset	dw	?
    1.84 -		endif
    1.85 -		push	es
    1.86 -		call	near @@isbzimage	; pop cs ; ds=es=ss
    1.87 -
    1.88  		; prepare memcpy32 size & srcofs param to move zImage pm
    1.89  		ifndef	NO386
    1.90  		push	8			; size hi
    1.91 @@ -171,59 +140,100 @@
    1.92  		mov	dx,8
    1.93  		push	dx			; size hi
    1.94  		endif
    1.95 -		push	cx			; size lo=up to 512k
    1.96 -		push	ax			; src ofs hi = pm.fallback
    1.97 +		push	si			; size lo=up to 512k
    1.98 +		push	[dword _imgs+2]		; src ofs = pm.fallback
    1.99  
   1.100  		;in	al,70h
   1.101  		;or	al,80h			; disable NMI
   1.102  		;out	70h,al
   1.103  
   1.104 -		push	bx			; src ofs lo
   1.105 -		xor	di,di
   1.106 -		push	di			; src seg=0
   1.107 +		push	si			; src seg=0
   1.108  		inc	cx
   1.109  		push	cx			; dst ofs hi
   1.110 -		push	di			; dst ofs lo : 64k
   1.111 +		push	si			; dst ofs lo : 64k
   1.112 +
   1.113 +		; self move
   1.114 +		extrn	gdt_data
   1.115 +		mov	cx,offset gdt_data+8
   1.116 +		;xor	di,di			;  A000 -9000 -0800(>movedend)
   1.117 +
   1.118 +		ifdef	NO386
   1.119 +		mov	ax,ss
   1.120 +		add	ax,900h
   1.121 +		push	ax			; topseg()+0x0900
   1.122 +		else
   1.123 +		push	9800h+(4096/16)		; 4096 bytes for cmdline
   1.124 +		endif
   1.125 +		pop	es
   1.126 +		push	es
   1.127 +
   1.128 +		call	near @@movsb@jmp	; movsb; pop cs ; ds=es=ss
   1.129 +
   1.130  		extrn   memcpy32:near
   1.131  		call	memcpy32
   1.132  
   1.133  		ifdef	MOVE_SETUP
   1.134 +		mov	si,0
   1.135 +	global	_rm_offset:word
   1.136 +		org	$-2
   1.137 +_rm_offset	dw	?
   1.138  		;xor	di,di
   1.139 -		mov	cx,8000h
   1.140 +		;mov	cx,8000h
   1.141  		;sub	cx,si
   1.142 -		rep
   1.143 -		  movsb
   1.144 +		;rep
   1.145 +		;  movsb
   1.146  		endif
   1.147  
   1.148  		ifndef  noelks
   1.149 +		ifdef	MOVE_SETUP
   1.150  		ifndef	NO386
   1.151 -		cmp	[dword 1E6h],'SKLE'
   1.152 +		mov	eax,[dword si+1E6h]
   1.153 +		xor	eax,'SKLE'
   1.154 +		else
   1.155 +		mov	ax,[si+1E6h]
   1.156 +		xor	ax,'LE'
   1.157  		jne	@@notelks
   1.158 -		xor	si,si
   1.159 +		mov	ax,[si+1E8h]
   1.160 +		xor	ax,'SK'
   1.161 +		endif
   1.162  		else
   1.163 -		mov	si,1E6h
   1.164 -		lodsw
   1.165 -		cmp	ax,'LE'
   1.166 +		ifndef	NO386
   1.167 +		mov	eax,[dword 1E6h]
   1.168 +		xor	eax,'SKLE'
   1.169 +		else
   1.170 +		mov	ax,[1E6h]
   1.171 +		xor	ax,'LE'
   1.172  		jne	@@notelks
   1.173 -		lodsw
   1.174 +		mov	ax,[1E8h]
   1.175  		xor	ax,'SK'
   1.176 +		endif
   1.177 +		endif
   1.178  		jne	@@notelks
   1.179 -		xchg	ax,si
   1.180 +		mov	cx,100h		; DS=ES=SS=0100
   1.181 +		mov	ss,cx
   1.182 +		push	ss
   1.183 +		pop	es
   1.184 +		mov	cl,20h		; CS=0120
   1.185 +		push	cx
   1.186 +		push	ax		; IP=0000
   1.187  		endif
   1.188  		ifdef	MOVE_SETUP
   1.189 -		mov	ch,1h		; DS=ES=SS=0100
   1.190 +@@notelks:
   1.191 +		mov	ch,7Eh
   1.192 +@@movsb@jmp:
   1.193 +		xor	di,di
   1.194 +		rep
   1.195 +		  movsb
   1.196  		else
   1.197 -		mov	cx,100h		; DS=ES=SS=0100
   1.198 -		endif
   1.199 -		mov	ss,cx
   1.200 -		mov	es,cx
   1.201 -		mov	cl,20h		; CS=0120
   1.202 -		push	cx
   1.203 -		push	si		; IP=0000
   1.204 -		mov	ch,3Fh		; 05h min, 3Fh max
   1.205 +		 ifndef  noelks
   1.206 +		xchg	ax,si
   1.207 +		mov	ch,7Eh		; 0Ah min, 7Eh max
   1.208 +@@movsb@jmp:
   1.209 +		xor	di,di
   1.210  		rep
   1.211 -		  movsw
   1.212 +		  movsb
   1.213  @@notelks:
   1.214 +		 endif
   1.215  		endif
   1.216  @@isbzimage:
   1.217  		push	ss