wok rev 24015

Up tazinst (112)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 25 10:56:54 2021 +0000 (2021-02-25)
parents c1844f1c4954
children 6036f36039ee
files cookutils/receipt linld/stuff/src/CRTL.ASM linld/stuff/src/LINLD.CPP linld/stuff/src/LOAD.CPP linld/stuff/src/MEMTOP.ASM linld/stuff/src/pipehole.awk tazinst-gui/receipt tazinst/receipt
line diff
     1.1 --- a/cookutils/receipt	Fri Feb 19 18:33:17 2021 +0000
     1.2 +++ b/cookutils/receipt	Thu Feb 25 10:56:54 2021 +0000
     1.3 @@ -55,7 +55,7 @@
     1.4  post_install()
     1.5  {
     1.6  	MD5="$(sed '/^SETUP_MD5/!d;s|.*="\(.*\)".*|\1|' \
     1.7 -			$1/etc/slitaz/cook.conf.old)"
     1.8 +			$1/etc/slitaz/cook.conf.old 2> /dev/null)"
     1.9  	sed -i "s|^SETUP_MD5=\"\"|SETUP_MD5=\"$MD5\"|" $1/etc/slitaz/cook.conf
    1.10  	[ -z "$MD5" ] && case "$(cat "$1/etc/hostname" 2> /dev/null)" in
    1.11  	tank*)
     2.1 --- a/linld/stuff/src/CRTL.ASM	Fri Feb 19 18:33:17 2021 +0000
     2.2 +++ b/linld/stuff/src/CRTL.ASM	Thu Feb 25 10:56:54 2021 +0000
     2.3 @@ -33,6 +33,8 @@
     2.4  		public	_isostate
     2.5  _isostate	isostate	<?>
     2.6  		org	$-7
     2.7 +	global	buf4k:byte
     2.8 +label	buf4k	byte
     2.9  _xfer_buf	db	4096	dup (?)
    2.10  filecnt		db	?		; in fact 0 minus file count...
    2.11  nextfilename	dw	?
    2.12 @@ -57,14 +59,12 @@
    2.13  		db	0b8h,20h		; mov	ax,??20h
    2.14  @@cpylp:
    2.15  		lodsb
    2.16 -@@cpyhead:
    2.17                  mov	[bx],al
    2.18                  inc	bx
    2.19  		or	al,al
    2.20                  jne	@@cpylp
    2.21 -strend:
    2.22                  pop	si
    2.23 -@ret:
    2.24 +catret:
    2.25  		ret
    2.26  
    2.27          endp	@strcatb$qpxzct1
    2.28 @@ -74,7 +74,7 @@
    2.29  
    2.30  opendos:
    2.31  	ifdef	LONG_FILENAME
    2.32 -		xchg	ax,cx			; attributes
    2.33 +		;xchg	ax,cx			; attributes
    2.34  		mov	ax,716Ch
    2.35  		push	bx si
    2.36  		mov	si,bx
    2.37 @@ -91,7 +91,7 @@
    2.38  	endif
    2.39  		;mov	cl,0			; attribute mask
    2.40  		call	dos
    2.41 -		jc	openret
    2.42 +		jc	catret
    2.43  openok:
    2.44  		xchg	ax,bx
    2.45  		mov	ax,4202h
    2.46 @@ -105,7 +105,6 @@
    2.47  		cwd
    2.48  		call	seeksetpos0		; filepos = 0
    2.49  		xchg	ax,bx			; fd
    2.50 -openret:
    2.51  		ret
    2.52  
    2.53  ;***************************************************************
    2.54 @@ -120,10 +119,15 @@
    2.55  
    2.56          global  @open$qpxzc:near
    2.57  @open$qpxzc:
    2.58 +		ifdef	LONG_FILENAME
    2.59 +		mov	cx,[_isostate.fd]
    2.60 +		jcxz	opendos
    2.61 +		xchg	ax,cx
    2.62 +		else
    2.63  		mov	ax,[_isostate.fd]
    2.64  		or	ax,ax
    2.65  		je	opendos
    2.66 -openiso:
    2.67 +		endif
    2.68  		ifdef ISOHOOK
    2.69  		cmp	[byte bx],'!'
    2.70  		je	@readmenu$qv
    2.71 @@ -225,7 +229,7 @@
    2.72  
    2.73  		ifdef ISOHOOK
    2.74  ;***************************************************************
    2.75 -;_fastcall void readmenu(void);
    2.76 +;_fastcall int:bx readmenu(void);
    2.77  ;***************************************************************
    2.78  	proc	@readmenu$qv near
    2.79  
    2.80 @@ -269,7 +273,7 @@
    2.81  		mov	bh,42h			; bx=fd cx:dx=offset al=whence
    2.82  dosbx:
    2.83  		xchg	ax,bx
    2.84 -		jmp	dos
    2.85 +		jmp	dos			; bx = fd
    2.86  
    2.87  	endp	@isolseek$qpxul
    2.88  
    2.89 @@ -393,20 +397,77 @@
    2.90  		cmp	al,20h			; EOS or 20h
    2.91  		jne	@@loop			; assume [bx] = '|'
    2.92  @@notsw:
    2.93 -		mov	ax,-1
    2.94 +		mov	al,-1
    2.95  		jne	@@notopt
    2.96  		jmp	@@setnum
    2.97  @@testal:
    2.98 -		inc	ax
    2.99 +		cmp	al,-1
   2.100  		jz	@@loop
   2.101  @@lastal:
   2.102 -		cmp	al,'='+1
   2.103 +		cmp	al,'='
   2.104  		xchg	ax,cx			; return s if failure
   2.105  		jne	@@nokeyword
   2.106  		dec	dx
   2.107  		dec	dx
   2.108  		je	@@done
   2.109 -		call	@strtol$qpxzc
   2.110 +@strtol$qpxzc:
   2.111 +		ifndef	NO386
   2.112 +		xor	ecx,ecx
   2.113 +		xor	ebx,ebx
   2.114 +		else
   2.115 +		xor	bx,bx
   2.116 +		xor	cx,cx
   2.117 +		xor	dx,dx
   2.118 +		endif
   2.119 +		lodsb
   2.120 +		or	al,20h
   2.121 +		cmp	al,'a'
   2.122 +		jb	@@notvga
   2.123 +		sub	al,'o'
   2.124 +@@vgaloop:
   2.125 +		dec	cx
   2.126 +		add	al,6
   2.127 +		jnb	@@vgaloop		; vga=normal,extended,ask
   2.128 +@@vga:
   2.129 +		xchg	ax,cx
   2.130 +		;cwd
   2.131 +		jmp	@@end
   2.132 +@@endstrtol:
   2.133 +		mov	cl,10
   2.134 +		cmp	al,'k'-'a'+10
   2.135 +		je	@@shift
   2.136 +		mov	cl,20
   2.137 +		cmp	al,'m'-'a'+10
   2.138 +		je	@@shift
   2.139 +		mov	cl,30
   2.140 +		cmp	al,'g'-'a'+10
   2.141 +		ifndef	NO386
   2.142 +		jne	@@noshift
   2.143 +@@shift:
   2.144 +		shl	ebx,cl
   2.145 +@@noshift:
   2.146 +		popf
   2.147 +		jnc	@@end2
   2.148 +		neg	ebx
   2.149 +@@end2:
   2.150 +		push	ebx
   2.151 +		pop	ax
   2.152 +		pop	dx
   2.153 +		else
   2.154 +@@shift:
   2.155 +		xchg	ax,bx
   2.156 +		jne	@@noshift
   2.157 +		extrn	N_LXLSH@:near
   2.158 +		call	N_LXLSH@
   2.159 +@@noshift:
   2.160 +		popf
   2.161 +		jne	@@end
   2.162 +		not	dx
   2.163 +		neg	ax
   2.164 +		jne	@@end
   2.165 +		inc	dx
   2.166 +@@end:
   2.167 +		endif
   2.168  @@setnum:
   2.169  		xchg	ax,si
   2.170  		mov	[di+2],dx
   2.171 @@ -417,6 +478,54 @@
   2.172  		pop	di si bx
   2.173  		ret
   2.174  
   2.175 +@@notvga:
   2.176 +		mov	cl,10			; radix
   2.177 +		cmp	al,'-'
   2.178 +		jne	@@radixkeep
   2.179 +		lodsb
   2.180 +@@radixkeep:
   2.181 +		pushf
   2.182 +		cmp	al,'0'
   2.183 +		jne	@@radixok
   2.184 +		mov	cl,8
   2.185 +		lodsb
   2.186 +		or	al,20h
   2.187 +		cmp	al,'x'
   2.188 +		jne	@@radixok
   2.189 +		mov	cl,16
   2.190 +@@strtollp:
   2.191 +		lodsb
   2.192 +@@radixok:
   2.193 +		or	al,20h
   2.194 +		sub	al,'0'
   2.195 +		jb	@@endstrtol
   2.196 +		cmp	al,9
   2.197 +		jbe	@@digitok
   2.198 +		cmp	al,'a'-'0'
   2.199 +		jb	@@endstrtol
   2.200 +		sub	al,'a'-'0'-10
   2.201 +@@digitok:
   2.202 +		cmp	al,cl
   2.203 +		jae	@@endstrtol
   2.204 +		cbw
   2.205 +		ifndef	NO386
   2.206 +		cwde
   2.207 +		xchg	eax,ebx
   2.208 +		mul	ecx
   2.209 +		add	ebx,eax
   2.210 +		else
   2.211 +		push	ax
   2.212 +		xchg	ax,dx
   2.213 +		mul	cx
   2.214 +		xchg	ax,bx
   2.215 +		mul	cx
   2.216 +		add	dx,bx
   2.217 +		pop	bx
   2.218 +		add	bx,ax
   2.219 +		adc	dx,0
   2.220 +		endif
   2.221 +		jmp	@@strtollp
   2.222 +
   2.223  	endp	@argstr$qpxzcxt1ppxzc
   2.224  
   2.225  ;***************************************************************
   2.226 @@ -636,25 +745,21 @@
   2.227  		mov	bx,offset vcpi_alloc_err
   2.228  		jnz	jmpdie
   2.229  ; for (i = cnt-1; i >= 0; i--)
   2.230 +; if (edx < pm.fallback+pm.size) again
   2.231 +		mov	bx,offset _imgs.fallback+size image_himem
   2.232 +		mov	eax,[bx-2+6-size image_himem]	; pm.size
   2.233 +		add	eax,[bx-2+2-size image_himem]
   2.234 +		cmp	eax,edx		; pm.fallback+pm.size <= edx ?
   2.235 +		ja	@@vcpi_alloc
   2.236  		mov	eax,ecx
   2.237  		dec	eax
   2.238  		shl	eax,12		; i*_4k
   2.239 -; if (edx < pm.fallback+i*_4k && edx >= pm.fallback) again
   2.240 -		mov	bx,offset _imgs.fallback
   2.241 -		push	eax
   2.242 -		add	eax,[bx-2+2]
   2.243 -		cmp	eax,edx		; pm.fallback+i*_4k <= edx ?
   2.244 -		pop	eax		; i*_4k
   2.245 -		jbe	@@pmok
   2.246 -		cmp	edx,[bx-2+2]	; edx >= pm.fallback ?
   2.247 -		jae	@@vcpi_alloc
   2.248 -@@pmok:
   2.249  ; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again
   2.250 -		add	eax,[bx-2+2+size image_himem]	; +initrd.fallback
   2.251 +		add	eax,[bx-2+2]	; +initrd.fallback
   2.252  		cmp	eax,edx		; initrd.fallback+i*_4k > edx ?
   2.253  		ja	@@initrdok
   2.254 -		mov	eax,[bx-2+6+size image_himem]	; initrd.size
   2.255 -		add	eax,[bx-2+2+size image_himem]	; +initrd.fallback
   2.256 +		mov	eax,[bx-2+6]	; initrd.size
   2.257 +		add	eax,[bx-2+2]	; +initrd.fallback
   2.258  		cmp	eax,edx		; initrd.fallback+initrd.size > edx ?
   2.259  @@ja_vcpi_alloc:
   2.260  		ja	@@vcpi_alloc
   2.261 @@ -680,10 +785,10 @@
   2.262  		lea	cx,[(data_himem si).cache]
   2.263  		ifdef	NO386
   2.264  		push	edx
   2.265 -		pop	ax			; to dx:ax
   2.266 -		pop	dx
   2.267 +		pop	ax			; to es:ax
   2.268 +		pop	es
   2.269  		endif
   2.270 -		call	storepage		; storepage(edx,cx)	
   2.271 +		call	storepage		; storepage(edx/es:ax,cx)	
   2.272  		pop	cx
   2.273  		or	ecx,ecx			; clear C
   2.274  		jnz	@@ja_vcpi_alloc
   2.275 @@ -718,41 +823,37 @@
   2.276  		cmp	eax,edx			; if (m->fallback != m->buf)
   2.277  		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   2.278  		mov	ecx,[(image_himem bx).size]
   2.279 -memcpy_imagez:					; memcpy_imagez(edx,eax,ecx)
   2.280 -		push	ecx
   2.281 -		push	eax
   2.282 -		push	0
   2.283 -call_memcpy32:
   2.284 -		push	edx
   2.285  		else
   2.286 -		les	ax,[dword ((image_himem bx).fallback)]
   2.287 +		les	cx,[((image_himem bx).buf)]
   2.288  		mov	dx,es
   2.289 -		les	cx,[dword ((image_himem bx).buf)]
   2.290 +		les	ax,[((image_himem bx).fallback)]
   2.291  		cmp	ax,cx			; if (m->fallback != m->buf)
   2.292  		jnz	@@do
   2.293 -		cmp	dx,[word ((image_himem bx).buf)+2]
   2.294 +		cmp	dx,[word ((image_himem bx).fallback)+2]
   2.295  		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   2.296  @@do:
   2.297 -		push	[word ((image_himem bx).size)+2]
   2.298 -		push	[word ((image_himem bx).size)]
   2.299 -		push	es			; [word ((image_himem bx).buf)+2]
   2.300 +		push	[((image_himem bx).size)]
   2.301 +		xor	bx,bx
   2.302 +call_memcpy32:					; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   2.303 +		push	dx			; [word ((image_himem bx).buf)+2]
   2.304  		push	cx			; [word ((image_himem bx).buf)]
   2.305 -		xor	cx,cx
   2.306 -		push	cx
   2.307 -call_memcpy32:
   2.308 -		push	dx			; push dx:ax
   2.309 +		push	bx
   2.310 +		push	es			; push es:ax
   2.311  		push	ax
   2.312  		jmp	@@memcpy
   2.313 +		endif
   2.314  memcpy_imagez:					; memcpy_imagez(edx,eax,ecx)
   2.315  		p386
   2.316  		push	ecx
   2.317  		push	eax
   2.318  		push	0
   2.319 +		ifndef	NO386
   2.320 +call_memcpy32:					; call_memcpy32(to=edx,fromseg,fromofs,size)
   2.321 +		endif
   2.322  		push	edx
   2.323  		ifdef	NO386
   2.324                  p8086
   2.325  		endif
   2.326 -		endif
   2.327  @@memcpy:
   2.328  		extrn	memcpy32:near
   2.329  		call	near memcpy32
   2.330 @@ -771,7 +872,6 @@
   2.331  		mov	edx,[di]
   2.332  		else
   2.333  		les	ax,[dword di]
   2.334 -		mov	dx,es			; to dx:ax
   2.335  		endif
   2.336  		mov	cx,offset _xfer_buf
   2.337  storepage:					; storepage(edx,cx)
   2.338 @@ -779,16 +879,15 @@
   2.339  		push	0
   2.340  		push	4096
   2.341  		push	0
   2.342 +		push	cx
   2.343 +		push	ds			; call_memcpy32(to=edx,fromseg,fromofs,size)
   2.344  		else
   2.345 -		xor	bx,bx
   2.346 -		push	bx
   2.347 -		mov	bh,4096/256
   2.348 -		push	bx
   2.349 -		xor	bx,bx
   2.350 -		push	bx
   2.351 +		xor	dx,dx
   2.352 +		push	dx			; 0
   2.353 +		mov	bx,4096
   2.354 +		push	bx			; 4096
   2.355 +		mov	bx,ds			; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   2.356  		endif
   2.357 -		push	cx
   2.358 -		push	ds
   2.359  		jmp	call_memcpy32
   2.360  
   2.361          endp    @storepage$qpul
   2.362 @@ -939,173 +1038,6 @@
   2.363          endp    @read_image$qp11image_himem
   2.364  
   2.365  
   2.366 -;***************************************************************
   2.367 -;_fastcall unsigned long strtol(const char *s);
   2.368 -;***************************************************************
   2.369 -	proc	@strtol$qpxzc near
   2.370 -
   2.371 -		ifndef	NO386
   2.372 -		xor	ecx,ecx
   2.373 -		xor	eax,eax
   2.374 -		xor	ebx,ebx
   2.375 -		lodsb
   2.376 -		or	al,20h
   2.377 -		cmp	al,'a'
   2.378 -		jb	@@notvga
   2.379 -		sub	al,'o'
   2.380 -@@vgaloop:
   2.381 -		dec	cx
   2.382 -		add	al,6
   2.383 -		jnb	@@vgaloop		; vga=normal,extended,ask
   2.384 -@@vga:
   2.385 -		dec	cx
   2.386 -		xchg	ax,cx
   2.387 -		cwd
   2.388 -		jmp	@@popsiret
   2.389 -@@notvga:
   2.390 -		mov	cl,10			; radix
   2.391 -		cmp	al,'-'
   2.392 -		jne	@@radixkeep
   2.393 -		lodsb
   2.394 -@@radixkeep:
   2.395 -		pushf
   2.396 -		cmp	al,'0'
   2.397 -		jne	@@radixok
   2.398 -		mov	cl,8
   2.399 -		lodsb
   2.400 -		or	al,20h
   2.401 -		cmp	al,'x'
   2.402 -		jne	@@radixok
   2.403 -		mov	cl,16
   2.404 -@@strtollp:
   2.405 -		lodsb
   2.406 -@@radixok:
   2.407 -		or	al,20h
   2.408 -		sub	al,'0'
   2.409 -		jb	@@endstrtol
   2.410 -		cmp	al,9
   2.411 -		jbe	@@digitok
   2.412 -		cmp	al,'a'-'0'
   2.413 -		jb	@@endstrtol
   2.414 -		sub	al,'a'-'0'-10
   2.415 -@@digitok:
   2.416 -		cmp	al,cl
   2.417 -		jae	@@endstrtol
   2.418 -		cbw
   2.419 -		cwde
   2.420 -		xchg	eax,ebx
   2.421 -		mul	ecx
   2.422 -		add	ebx,eax
   2.423 -		jmp	@@strtollp
   2.424 -@@endstrtol:
   2.425 -		mov	cl,10
   2.426 -		cmp	al,'k'-'a'+10
   2.427 -		je	@@shift
   2.428 -		mov	cl,20
   2.429 -		cmp	al,'m'-'a'+10
   2.430 -		je	@@shift
   2.431 -		mov	cl,30
   2.432 -		cmp	al,'g'-'a'+10
   2.433 -		jne	@@noshift
   2.434 -@@shift:
   2.435 -		shl	ebx,cl
   2.436 -@@noshift:
   2.437 -		popf
   2.438 -		jnc	@@end
   2.439 -		neg	ebx
   2.440 -@@end:
   2.441 -		push	ebx
   2.442 -		pop	ax
   2.443 -		pop	dx
   2.444 -@@popsiret:
   2.445 -		else
   2.446 -		xor	bx,bx
   2.447 -		xor	cx,cx
   2.448 -		xor	dx,dx
   2.449 -		lodsb
   2.450 -		or	al,20h
   2.451 -		cmp	al,'a'
   2.452 -		jb	@@notvga
   2.453 -		sub	al,'o'
   2.454 -@@vgaloop:
   2.455 -		dec	cx
   2.456 -		add	al,6
   2.457 -		jnb	@@vgaloop		; vga=normal,extended,ask
   2.458 -@@vga:
   2.459 -		xchg	ax,cx
   2.460 -		;cwd
   2.461 -		jmp	@@end
   2.462 -@@notvga:
   2.463 -		mov	cl,10			; radix
   2.464 -		cmp	al,'-'
   2.465 -		jne	@@radixkeep
   2.466 -		lodsb
   2.467 -@@radixkeep:
   2.468 -		pushf
   2.469 -		cmp	al,'0'
   2.470 -		jne	@@radixok
   2.471 -		mov	cl,8
   2.472 -		lodsb
   2.473 -		or	al,20h
   2.474 -		cmp	al,'x'
   2.475 -		jne	@@radixok
   2.476 -		mov	cl,16
   2.477 -@@strtollp:
   2.478 -		lodsb
   2.479 -@@radixok:
   2.480 -		or	al,20h
   2.481 -		sub	al,'0'
   2.482 -		jb	@@endstrtol
   2.483 -		cmp	al,9
   2.484 -		jbe	@@digitok
   2.485 -		cmp	al,'a'-'0'
   2.486 -		jb	@@endstrtol
   2.487 -		sub	al,'a'-'0'-10
   2.488 -@@digitok:
   2.489 -		cmp	al,cl
   2.490 -		jae	@@endstrtol
   2.491 -		cbw
   2.492 -
   2.493 -		push	ax
   2.494 -		xchg	ax,dx
   2.495 -		mul	cx
   2.496 -		xchg	ax,bx
   2.497 -		mul	cx
   2.498 -		add	dx,bx
   2.499 -		pop	bx
   2.500 -		add	bx,ax
   2.501 -		adc	dx,0
   2.502 -
   2.503 -		jmp	@@strtollp
   2.504 -@@endstrtol:
   2.505 -		mov	cl,10
   2.506 -		cmp	al,'k'-'a'+10
   2.507 -		je	@@shift
   2.508 -		mov	cl,20
   2.509 -		cmp	al,'m'-'a'+10
   2.510 -		je	@@shift
   2.511 -		mov	cl,30
   2.512 -		cmp	al,'g'-'a'+10
   2.513 -@@shift:
   2.514 -		xchg	ax,bx
   2.515 -		jne	@@noshift
   2.516 -		extrn	N_LXLSH@:near
   2.517 -		call	N_LXLSH@
   2.518 -@@noshift:
   2.519 -		popf
   2.520 -		jne	@@end
   2.521 -		not	dx
   2.522 -		neg	ax
   2.523 -		jne	@@end
   2.524 -		inc	dx
   2.525 -@@end:
   2.526 -		endif
   2.527 -strtol_ret:
   2.528 -		ret
   2.529 -
   2.530 -	endp	@strtol$qpxzc
   2.531 -
   2.532 -
   2.533          ends    _TEXT
   2.534  
   2.535          end
     3.1 --- a/linld/stuff/src/LINLD.CPP	Fri Feb 19 18:33:17 2021 +0000
     3.2 +++ b/linld/stuff/src/LINLD.CPP	Thu Feb 25 10:56:54 2021 +0000
     3.3 @@ -16,7 +16,7 @@
     3.4  
     3.5  inline void syntax() {
     3.6      die("Syntax:" NL
     3.7 -        "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] [iso=file]" NL
     3.8 +        "LINLD [image=file] [initrd=files] [vga=mode] [root=num] [mem=max] [cl=cmdline] [iso=file] ..." NL
     3.9          "vga mode: ask,extended,normal or dec/oct/hex number" NL
    3.10          "-64 for cpu64 only" NL
    3.11          "Defaults:" NL
    3.12 @@ -33,7 +33,7 @@
    3.13  	"-b 64m "
    3.14          "initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz "
    3.15  	"\"cl=root=/dev/null video=-32\""
    3.16 -	NL NL "\tLINLD image=memtest"
    3.17 +	NL "\tLINLD memtest"
    3.18  #endif
    3.19      );
    3.20  }
     4.1 --- a/linld/stuff/src/LOAD.CPP	Fri Feb 19 18:33:17 2021 +0000
     4.2 +++ b/linld/stuff/src/LOAD.CPP	Thu Feb 25 10:56:54 2021 +0000
     4.3 @@ -208,7 +208,6 @@
     4.4  
     4.5  // Read initrd if needed
     4.6  void load_initrd() {
     4.7 -    struct image_himem *m = &initrd;
     4.8      if ((int)initrd_name == 0) return;
     4.9  #if defined(__BORLANDC__) && defined(NO386)
    4.10  #pragma option -3
    4.11 @@ -216,6 +215,7 @@
    4.12  	.386p
    4.13      }
    4.14  #endif
    4.15 +    struct image_himem *m = &initrd;
    4.16      open_image(m, initrd_name);
    4.17  
    4.18      if ((m->fallback=(memtop()-m->size)&(~PAGE_MASK))-m[-1].fallback < m[-1].size) {
     5.1 --- a/linld/stuff/src/MEMTOP.ASM	Fri Feb 19 18:33:17 2021 +0000
     5.2 +++ b/linld/stuff/src/MEMTOP.ASM	Thu Feb 25 10:56:54 2021 +0000
     5.3 @@ -23,17 +23,63 @@
     5.4  ;***************************************************************
     5.5          proc    _memtopz near
     5.6  ;***************************************************************
     5.7 +;u32 memtop_e820()
     5.8 +;***************************************************************
     5.9 +;        proc    _memtop_e820 near
    5.10 +
    5.11 +	ifdef	INT15_E820
    5.12 +
    5.13 +struc   e820		;struct e820 {
    5.14 +base		dd	?,?	; 0    u64 base;
    5.15 +length		dd	?,?	; 8    u64 length;
    5.16 +type		db	?,?,?,?	;16    u32 type;	1=available
    5.17 +ends	e820		;};
    5.18 +
    5.19 +                p386
    5.20 +		push	ds
    5.21 +		pop	es
    5.22 +		push	di
    5.23 +		xor	ebx,ebx
    5.24 +@@e820lp:
    5.25 +                mov     eax,0E820h
    5.26 +		mov	edx,534D4150h	; 'SMAP'
    5.27 +		xor	ecx,ecx
    5.28 +		mov	cl,size e820
    5.29 +		extrn	buf4k:byte
    5.30 +		mov	di,offset buf4k
    5.31 +                int     15h
    5.32 +                jc      @@err_e820
    5.33 +		;cmp	eax,534D4150h	; 'SMAP'
    5.34 +                ;jne	@@err_e820
    5.35 +		cmp	[(e820 di).type],1
    5.36 +		jnz	@@notavail
    5.37 +		mov	eax,[(e820 di).base]
    5.38 +		add	eax,[(e820 di).length]
    5.39 +		push	eax
    5.40 +		pop	ax
    5.41 +		pop	dx
    5.42 +		or	dh,dh			; > 16M
    5.43 +		je	@@notavail
    5.44 +		pop	di
    5.45 +		ret
    5.46 +@@notavail:
    5.47 +		or	bx,bx
    5.48 +		jne	@@e820lp
    5.49 +@@err_e820:
    5.50 +		pop	di
    5.51 +	endif
    5.52 +
    5.53 +;        endp    _memtop_e820
    5.54 +
    5.55 +;***************************************************************
    5.56  ;u32 memtop_e801()
    5.57  ;***************************************************************
    5.58  ;        proc    _memtop_e801 near
    5.59  
    5.60                  xor     cx,cx           ;fix to work around buggy
    5.61                  xor     dx,dx           ;  BIOSes which dont clear/set
    5.62 -                stc                     ;  carry on pass/error of
    5.63 -                mov     ax,0E801h
    5.64 -                int     15h
    5.65 -                jc      @@err
    5.66 -
    5.67 +                mov     ax,0E801h	;ax=1kbs in 1-16M bx=64kbs above 16M extended
    5.68 +                int     15h		;cx=1kbs in 1-16M dx=64kbs above 16M configured
    5.69  		xchg	ax,cx		;kludge to handle BIOSes
    5.70  		jcxz	@@use_cxdx	;  which report their extended
    5.71  					;  memory in AX/BX rather than
    5.72 @@ -43,14 +89,14 @@
    5.73  @@use_cxdx:				;now: dx=64k units above 16m
    5.74  					;     ax=1k units above 1m below 16m (max 3c00h)
    5.75                  or	dx,dx
    5.76 -                jz      tokb            ;dx=0 here, ax=kbs above 1m
    5.77 +		jz	@@below16M
    5.78                  xor     ax,ax           ;ignore info on low 16M (assume full)
    5.79 -               ;add     dx,100h         ;account for low 16M
    5.80 -                inc     dh              ;account for low 16M (optimized)
    5.81 +                inc     dh              ;account for low 16M
    5.82                  ret
    5.83 +@@below16M:
    5.84 +		or	ax,ax
    5.85 +                jnz	tokb		;dx=0 here, ax=kbs above 1m
    5.86  @@err:
    5.87 -;                xor     ax,ax
    5.88 -;                cwd
    5.89  ;                ret
    5.90  ;        endp    _memtop_e801
    5.91  
    5.92 @@ -62,9 +108,7 @@
    5.93  
    5.94                  mov     ah,88h
    5.95                  int     15h             ;ax=kbs above 1m
    5.96 -                cmc                     ;  error: cf=1 or ax=0
    5.97 -		sbb	dx,dx
    5.98 -                and     ax,dx           ;
    5.99 +                test	ax,ax		;  error: ax=0
   5.100                  jnz     tokb            ;happens on big mem systems
   5.101  
   5.102  ;***************************************************************
     6.1 --- a/linld/stuff/src/pipehole.awk	Fri Feb 19 18:33:17 2021 +0000
     6.2 +++ b/linld/stuff/src/pipehole.awk	Thu Feb 25 10:56:54 2021 +0000
     6.3 @@ -197,6 +197,8 @@
     6.4  	}
     6.5  	if (/void load_initrd\(\)/) { isload=3; isload2=0 }
     6.6  	if (isload == 3) {  # LOAD.LST
     6.7 +		if (/bx,offset DGROUP:_imgs\+28/ || /push	si/) next
     6.8 +		if (/si,offset DGROUP:_imgs\+28/) print "	push	si"
     6.9  		if (/cmdstr\+4,0/) {
    6.10  			isload2++
    6.11  			print	"	mov	ax,word ptr DGROUP:_cmdstr+4"
    6.12 @@ -207,7 +209,6 @@
    6.13  		if (/mov	ax,word ptr \[si\]/) $0="	lodsw"
    6.14  		if( /jmp/) {
    6.15  			print "load_initrd_ret:"
    6.16 -			print "	pop	si"
    6.17  			print "	ret"
    6.18  			next
    6.19  		}
     7.1 --- a/tazinst-gui/receipt	Fri Feb 19 18:33:17 2021 +0000
     7.2 +++ b/tazinst-gui/receipt	Thu Feb 25 10:56:54 2021 +0000
     7.3 @@ -1,7 +1,7 @@
     7.4  # SliTaz package receipt.
     7.5  
     7.6  PACKAGE="tazinst-gui"
     7.7 -VERSION="110"
     7.8 +VERSION="112"
     7.9  CATEGORY="base-system"
    7.10  SHORT_DESC="SliTaz installer (GUI frontend)"
    7.11  MAINTAINER="domcox@slitaz.org"
     8.1 --- a/tazinst/receipt	Fri Feb 19 18:33:17 2021 +0000
     8.2 +++ b/tazinst/receipt	Thu Feb 25 10:56:54 2021 +0000
     8.3 @@ -1,7 +1,7 @@
     8.4  # SliTaz package receipt.
     8.5  
     8.6  PACKAGE="tazinst"
     8.7 -VERSION="110"
     8.8 +VERSION="112"
     8.9  CATEGORY="base-system"
    8.10  SHORT_DESC="SliTaz installer"
    8.11  MAINTAINER="domcox@slitaz.org"