wok rev 24034

Openssh (8.5p1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Apr 08 09:21:26 2021 +0000 (2021-04-08)
parents 2984cf98c782
children 1b5e36efea1d
files codec2/receipt linld/stuff/src/A20.ASM linld/stuff/src/COMMON.H linld/stuff/src/CRTL.ASM linld/stuff/src/HIMEM.CPP linld/stuff/src/HIMEM.INC linld/stuff/src/ISO9660.CPP linld/stuff/src/ISO9660.H linld/stuff/src/ISOSTATE.INC linld/stuff/src/JUMP.ASM linld/stuff/src/LINK.CMD linld/stuff/src/MEMCPY32.ASM linld/stuff/src/MEMTOP.ASM linld/stuff/src/VCPI.ASM linld/stuff/src/XMM.ASM linld/stuff/src/_BEG.ASM linld/stuff/src/pipehole.awk lz4/receipt lzham_codec/receipt nwipe/receipt openssh-pam/receipt openssh/receipt radare2/receipt sftp-server/receipt sslh/receipt upx/receipt zstd/receipt
line diff
     1.1 --- a/codec2/receipt	Wed Apr 07 15:56:56 2021 +0100
     1.2 +++ b/codec2/receipt	Thu Apr 08 09:21:26 2021 +0000
     1.3 @@ -15,7 +15,7 @@
     1.4  current_version()
     1.5  {
     1.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
     1.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
     1.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
     1.9  }
    1.10  
    1.11  # Rules to configure and make the package.
     2.1 --- a/linld/stuff/src/A20.ASM	Wed Apr 07 15:56:56 2021 +0100
     2.2 +++ b/linld/stuff/src/A20.ASM	Thu Apr 08 09:21:26 2021 +0000
     2.3 @@ -2,7 +2,7 @@
     2.4  ;****** This file is distributed under GPL
     2.5  ;***************************************************************
     2.6                  ideal
     2.7 -		%PAGESIZE 1000
     2.8 +		%PAGESIZE 255
     2.9                  %crefref
    2.10                  %noincl
    2.11                  %nomacs
     3.1 --- a/linld/stuff/src/COMMON.H	Wed Apr 07 15:56:56 2021 +0100
     3.2 +++ b/linld/stuff/src/COMMON.H	Thu Apr 08 09:21:26 2021 +0000
     3.3 @@ -1,7 +1,7 @@
     3.4  //#define WITH_XMM_ALLOC	add himem.sys driver
     3.5 +//#define INT15_E820	add int15/eax=E820 driver
     3.6  //#define LARGE_ZIMAGE	may load system in high memory temporarily 
     3.7 -//#define INT15_E820	add int15/eax=E820 driver
     3.8 -//#define RAW_ISO9660	raw filename support with ';1' or '.' trailers
     3.9 +#define CLEAN_ISO9660	remove ';1' or '.' trailers for  non rockridge name
    3.10  #define BASIC_ISO9660	non rockridge support
    3.11  #define ROCKRIDGE	iso 9660 posix name support
    3.12  #define ISO9660		iso= support
    3.13 @@ -26,7 +26,7 @@
    3.14  #define CPU64
    3.15  #endif
    3.16  #endif
    3.17 -#if defined(ROCKRIDGE) || defined(BASIC_ISO9660) || defined(RAW_ISO9660)
    3.18 +#if defined(ROCKRIDGE) || defined(BASIC_ISO9660) || defined(CLEAN_ISO9660)
    3.19  #ifndef ISO9660
    3.20  #define ISO9660
    3.21  #endif
     4.1 --- a/linld/stuff/src/CRTL.ASM	Wed Apr 07 15:56:56 2021 +0100
     4.2 +++ b/linld/stuff/src/CRTL.ASM	Thu Apr 08 09:21:26 2021 +0000
     4.3 @@ -2,7 +2,7 @@
     4.4  ;****** This file is distributed under GPL
     4.5  ;***************************************************************
     4.6                  ideal
     4.7 -		%PAGESIZE 1000
     4.8 +		%PAGESIZE 255
     4.9                  %crefref
    4.10                  %noincl
    4.11                  %nomacs
    4.12 @@ -47,6 +47,258 @@
    4.13  
    4.14          segment _TEXT byte public use16 'CODE'
    4.15  
    4.16 +		ifdef	VCPI
    4.17 +                p386
    4.18 +;***************************************************************
    4.19 +
    4.20 +struc   data_himem			;struct data_himem {
    4.21 +first		dd	?		;   0  u32 first;	*must* be the first one	assume zero'd in bss
    4.22 +cacheidx	dw	?		;   4  int cacheidx;	quad *			assume zero'd in bss
    4.23 +pageidx		dw	?		;   6  int pageidx;	byte *			assume zero'd in bss
    4.24 +cache		dd	1024 dup(?)	;   8  int cache;
    4.25 +page		dd	1024 dup(?)	;4104  int page;
    4.26 +ends	data_himem			;};
    4.27 +
    4.28 +		include	"himem.inc"
    4.29 +
    4.30 +;***************************************************************
    4.31 +;_fastcall u32* malloc_bufv_or_die(si:struct image_himem *m);
    4.32 +;***************************************************************
    4.33 +        global  @malloc_bufv_or_die$qp11image_himem:near
    4.34 +        proc    @malloc_bufv_or_die$qp11image_himem near
    4.35 +
    4.36 +                p386
    4.37 +		;mov	ecx,[(image_himem si).size]
    4.38 +		;shr	ecx,20			; pages index size = size >> 20
    4.39 +		;mov	ax,cx
    4.40 +		;add	ax,size data_himem-4096
    4.41 +		mov	ax,size data_himem
    4.42 +		call	malloc_or_die
    4.43 +		;mov	cx,4096+4095		; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE;
    4.44 +		mov	ecx,4096+4095		; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE;
    4.45 +		add	ecx,[(image_himem si).size]
    4.46 +		shr	ecx,12
    4.47 +		mov	[(image_himem si).bufv],ax	; update m->bufv
    4.48 +		xchg	ax,di
    4.49 +@@vcpi_alloc:
    4.50 +                mov     ax,0DE04h		; allocate a 4K page => EDX
    4.51 +                int     67h
    4.52 +		or	ah,ah
    4.53 +		mov	bx,offset vcpi_alloc_err
    4.54 +		jnz	jmpdie
    4.55 +; for (i = cnt-1; i >= 0; i--)
    4.56 +; if (edx < pm.fallback+pm.size) again
    4.57 +		mov	bx,offset _imgs.fallback+size image_himem
    4.58 +		mov	eax,[bx-2+6-size image_himem]	; pm.size
    4.59 +		add	eax,[bx-2+2-size image_himem]
    4.60 +		cmp	eax,edx		; pm.fallback+pm.size <= edx ?
    4.61 +		ja	@@vcpi_alloc
    4.62 +		mov	eax,ecx
    4.63 +		dec	eax
    4.64 +		shl	eax,12		; i*_4k
    4.65 +; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again
    4.66 +		add	eax,[bx-2+2]	; +initrd.fallback
    4.67 +		cmp	eax,edx		; initrd.fallback+i*_4k > edx ?
    4.68 +		ja	@@initrdok
    4.69 +		mov	eax,[bx-2+6]	; initrd.size
    4.70 +		add	eax,[bx-2+2]	; +initrd.fallback
    4.71 +		cmp	eax,edx		; initrd.fallback+initrd.size > edx ?
    4.72 +@@ja_vcpi_alloc:
    4.73 +		ja	@@vcpi_alloc
    4.74 +@@initrdok:
    4.75 +		cmp	[(data_himem di).first],0	; zero'd in bss
    4.76 +		jne	@@notfirst
    4.77 +		mov	[(data_himem di).first],edx
    4.78 +@@notfirst:
    4.79 +		mov	bx,[(data_himem di).cacheidx]	; zero'd in bss
    4.80 +		cmp	bh,4
    4.81 +		jae	@@nextpage
    4.82 +		shl	bx,2
    4.83 +		inc	[(data_himem di).cacheidx]
    4.84 +		mov	[(data_himem bx+di).cache],edx	; cache[cacheidx++] = edx
    4.85 +		loopd	@@vcpi_alloc
    4.86 +		mov	[(data_himem bx+di).cache],ecx	; last is 0
    4.87 +@@nextpage:
    4.88 +		and	[(data_himem di).cacheidx],0
    4.89 +		mov	bx,[(data_himem di).pageidx]	; zero'd in bss
    4.90 +		mov	[(data_himem bx+di).page],edx
    4.91 +		add	[(data_himem di).pageidx],4
    4.92 +		push	cx
    4.93 +		lea	cx,[(data_himem di).cache]
    4.94 +		ifdef	NO386
    4.95 +		push	edx
    4.96 +		pop	ax			; to es:ax
    4.97 +		pop	es
    4.98 +		endif
    4.99 +		call	storepage		; storepage(edx/es:ax,cx)	
   4.100 +		pop	cx
   4.101 +		or	ecx,ecx			; clear C
   4.102 +		jnz	@@ja_vcpi_alloc
   4.103 +
   4.104 +        endp    @malloc_bufv_or_die$qp11image_himem
   4.105 +
   4.106 +;***************************************************************
   4.107 +;_fastcall void reset_bufv(di:u32 *p);
   4.108 +;***************************************************************
   4.109 +        global  @reset_bufv$qpul:near
   4.110 +        proc    @reset_bufv$qpul near
   4.111 +
   4.112 +		mov	[curdata],di
   4.113 +		and	[dword (data_himem di).cacheidx],0	; and pageidx=0
   4.114 +		ret
   4.115 +
   4.116 +        endp    @reset_bufv$qpul
   4.117 +
   4.118 +;***************************************************************
   4.119 +;u32* di=prev_bufv();
   4.120 +;u32* di=prev_bufv();
   4.121 +;***************************************************************
   4.122 +        global  _prev_bufv:near
   4.123 +        global  _next_bufv:near
   4.124 +        proc    _prev_bufv near
   4.125 +
   4.126 +		stc
   4.127 +		db	73h			; jnc
   4.128 +_next_bufv:
   4.129 +		clc
   4.130 +		push	si
   4.131 +		mov	bx,0
   4.132 +		org	$-2
   4.133 +curdata		dw	?
   4.134 +		sbb	ax,ax
   4.135 +		cmc
   4.136 +		adc	ax,[(data_himem bx).cacheidx]	; -1/+1
   4.137 +		mov	si,3ffh
   4.138 +		and	si,ax
   4.139 +		mov	[(data_himem bx).cacheidx],si
   4.140 +		shl	si,2
   4.141 +		xor	ecx,ecx
   4.142 +		test	ax,0fc00h
   4.143 +		jz	@@gotpage		; FFFF / 0400
   4.144 +		xchg	al,ah			; FFFC / 0004
   4.145 +		and	al,0fch
   4.146 +		add	[(data_himem bx).pageidx],ax
   4.147 +		mov	di,[(data_himem bx).pageidx]
   4.148 +		lea	di,[(data_himem bx+di).page]
   4.149 +		mov	edx,ds
   4.150 +		shl	edx,4
   4.151 +		lea	cx,[(data_himem bx).cache]		
   4.152 +		add	edx,ecx
   4.153 +		mov	eax,[di]
   4.154 +		or	eax,eax
   4.155 +		jz	@@ret
   4.156 +		mov	cx,4096			; get page
   4.157 +		call	memcpy_imagez		; memcpy_imagez(edx,eax,ecx)
   4.158 +@@gotpage:
   4.159 +		lea	ax,[(data_himem bx+si).cache]		
   4.160 +		or	si,[(data_himem bx).pageidx]	; !pageidx && !cacheidx
   4.161 +		jnz	@@notfirst2
   4.162 +		xchg	ax,bx				; &first
   4.163 +@@notfirst2:
   4.164 +		xchg	ax,di
   4.165 +@@ret:
   4.166 +		pop	si
   4.167 +		ret
   4.168 +
   4.169 +        endp    _prev_bufv
   4.170 +		endif
   4.171 +
   4.172 +		ifdef	NO386
   4.173 +                p8086
   4.174 +		endif
   4.175 +
   4.176 +;***************************************************************
   4.177 +;_fastcall void memcpy_image_initrd(si:struct image_himem *m);
   4.178 +;_fastcall void memcpy_image_kernel(si:struct image_himem *m);
   4.179 +;_fastcall void memcpy_image(bx:struct image_himem *m);
   4.180 +;***************************************************************
   4.181 +	global	@memcpy_image_initrd$qv:near
   4.182 +@memcpy_image_initrd$qv:
   4.183 +		lea	bx,[si+size image_himem]
   4.184 +		db	0A9h			; test	ax,imm
   4.185 +	global	@memcpy_image_kernel$qv:near
   4.186 +@memcpy_image_kernel$qv:
   4.187 +		mov	bx,si
   4.188 +        proc    @memcpy_image$qp11image_himem near
   4.189 +
   4.190 +		ifndef	NO386
   4.191 +		mov	edx,[(image_himem bx).fallback]
   4.192 +		mov	eax,[(image_himem bx).buf]
   4.193 +		cmp	eax,edx			; if (m->fallback != m->buf)
   4.194 +		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   4.195 +		mov	ecx,[(image_himem bx).size]
   4.196 +		else
   4.197 +		les	cx,[((image_himem bx).buf)]
   4.198 +		mov	dx,es
   4.199 +		les	ax,[((image_himem bx).fallback)]
   4.200 +		cmp	ax,cx			; if (m->fallback != m->buf)
   4.201 +		jnz	@@do
   4.202 +		cmp	dx,[word ((image_himem bx).fallback)+2]
   4.203 +		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   4.204 +@@do:
   4.205 +		push	[((image_himem bx).size)]
   4.206 +		xor	bx,bx
   4.207 +call_memcpy32:					; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   4.208 +		push	dx			; [word ((image_himem bx).buf)+2]
   4.209 +		push	cx			; [word ((image_himem bx).buf)]
   4.210 +		push	bx
   4.211 +		push	es			; push es:ax
   4.212 +		push	ax
   4.213 +		jmp	@@memcpy
   4.214 +		endif
   4.215 +memcpy_imagez:					; memcpy_imagez(edx,eax,ecx)
   4.216 +		p386
   4.217 +		push	ecx
   4.218 +		push	eax
   4.219 +		push	0
   4.220 +		ifndef	NO386
   4.221 +call_memcpy32:					; call_memcpy32(to=edx,fromseg,fromofs,size)
   4.222 +		endif
   4.223 +		push	edx
   4.224 +		ifdef	NO386
   4.225 +                p8086
   4.226 +		endif
   4.227 +@@memcpy:
   4.228 +		extrn	memcpy32:near
   4.229 +		call	near memcpy32
   4.230 +@@skip:
   4.231 +		ret
   4.232 +
   4.233 +		global	movedend:near
   4.234 +movedend:
   4.235 +
   4.236 +        endp    @memcpy_image$qp11image_himem
   4.237 +
   4.238 +;***************************************************************
   4.239 +;_fastcall void storepage(di:u32 *dst);
   4.240 +;***************************************************************
   4.241 +        global  @storepage$qpul:near
   4.242 +        proc    @storepage$qpul near
   4.243 +
   4.244 +		ifndef	NO386
   4.245 +		mov	edx,[di]
   4.246 +		else
   4.247 +		les	ax,[dword di]
   4.248 +		endif
   4.249 +		mov	cx,offset _buf4k
   4.250 +storepage:					; storepage(edx,cx)
   4.251 +		ifndef	NO386
   4.252 +		push	0
   4.253 +		push	4096
   4.254 +		push	0
   4.255 +		push	cx
   4.256 +		push	ds			; call_memcpy32(to=edx,fromseg,fromofs,size)
   4.257 +		else
   4.258 +		xor	dx,dx
   4.259 +		push	dx			; 0
   4.260 +		mov	bx,4096
   4.261 +		push	bx			; 4096
   4.262 +		mov	bx,ds			; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   4.263 +		endif
   4.264 +		jmp	call_memcpy32
   4.265 +
   4.266 +        endp    @storepage$qpul
   4.267 +
   4.268  ;***************************************************************
   4.269  ;_fastcall void strcatb(bx:const char* a, ax:const char* b);
   4.270  ;***************************************************************
   4.271 @@ -347,37 +599,37 @@
   4.272  	ifdef ISO9660
   4.273  		ifdef ISOHOOK
   4.274  ;***************************************************************
   4.275 -;_fastcall int strhead(bx:const char* a, ax:const char* b);
   4.276 +;_fastcall int strhead(ax:const char* a, bx:const char* b);
   4.277  ;***************************************************************
   4.278          global  @strhead$qpxzct1:near
   4.279          proc    @strhead$qpxzct1 near
   4.280  
   4.281  @@loop:
   4.282 -		xchg	ax,bx
   4.283 -                mov	dl,[bx]			; dl = *b++
   4.284 +                mov	dh,[bx]			; dh = *b++
   4.285                  inc	bx
   4.286  		xchg	ax,bx
   4.287 -		or	dl,dl			; clear C
   4.288 -		jz	failifc			; return 0, bx=a tail
   4.289 -                xor	dl,[bx]			; dl -= *a++
   4.290 +		or	dh,dh			; clear C
   4.291 +		jz	failifc			; return 0, bx=a tail, dh=0
   4.292 +                xor	dh,[bx]			; dh -= *a++
   4.293  		jne	fail			; return -1
   4.294                  inc	bx
   4.295 +		xchg	ax,bx
   4.296                  jmp	@@loop
   4.297  
   4.298  	endp	@strhead$qpxzct1
   4.299  
   4.300  
   4.301  ;***************************************************************
   4.302 -;_fastcall int strcmp(bx:const char* a, ax:const char* b);
   4.303 +;_fastcall int strcmp(ax:const char* a, bx:const char* b);
   4.304  ;***************************************************************
   4.305          global  @strcmp$qpxzct1:near
   4.306          proc    @strcmp$qpxzct1 near
   4.307  
   4.308  		call	@strhead$qpxzct1
   4.309  		jne	fail			; return -1
   4.310 -		xor	dl,[bx]			; clear C
   4.311 +		xor	dh,[bx]			; clear C
   4.312  		jne	fail			; return -1
   4.313 -		jmp	failifc			; return 0
   4.314 +		jmp	failifc			; return 0, dh=0
   4.315  
   4.316          endp    @strcmp$qpxzct1
   4.317  
   4.318 @@ -411,6 +663,274 @@
   4.319  	endif
   4.320  
   4.321  ;***************************************************************
   4.322 +;_fastcall void puts(bx:const char* s):
   4.323 +;***************************************************************
   4.324 +        global  @puts$qpxzc:near
   4.325 +
   4.326 +;        global  puts:near			; puts(bx)
   4.327 +@putsz:
   4.328 +		call	@putc
   4.329 +@puts$qpxzc:
   4.330 +puts:
   4.331 +		mov	dl,[bx]
   4.332 +		inc	bx
   4.333 +		or	dl,dl
   4.334 +		jne	@putsz
   4.335 +		mov	dl,10
   4.336 +@putc:
   4.337 +		cmp	dl,10
   4.338 +		jne	@putcz
   4.339 +		call	@putcz2
   4.340 +@putcz2:
   4.341 +		xor	dl,7		; 10^13  1010^1101
   4.342 +@putcz:
   4.343 +		mov	ah,2
   4.344 +do_int21h:
   4.345 +		int	21h
   4.346 +		ret
   4.347 +
   4.348 +
   4.349 +;***************************************************************
   4.350 +;_fastcall char* malloc_or_die(ax:unsigned size);
   4.351 +;***************************************************************
   4.352 +xchg_heap_top:
   4.353 +		xchg	ax,[bx]
   4.354 +		ret
   4.355 +
   4.356 +        proc    @malloc_or_die$qui near
   4.357 +
   4.358 +malloc_or_die: 				; ax = malloc_or_die(ax)
   4.359 +		extrn	_heap_top
   4.360 +		mov	bx,offset _heap_top
   4.361 +		add	ax,[bx]
   4.362 +		jnc	xchg_heap_top
   4.363 +		mov	bx,offset msg_malloc
   4.364 +
   4.365 +        endp    @malloc_or_die$qui
   4.366 +
   4.367 +
   4.368 +;***************************************************************
   4.369 +;_fastcall int die(bx:const char* msg);
   4.370 +;int exit(ax:int status);
   4.371 +;int abort(void);
   4.372 +;***************************************************************
   4.373 +	global	@die$qpxzc:near
   4.374 +	proc	@die$qpxzc near
   4.375 +@die$qpxzc:
   4.376 +        global  die:near			; die(bx)
   4.377 +die:
   4.378 +		call	puts
   4.379 +        global  @exit$qv:near
   4.380 +@exit$qv:
   4.381 +_exit:
   4.382 +		extrn	_imgs:image_himem
   4.383 +		mov	cx,[(word _imgs.buf)+2]	; no_exit ?
   4.384 +                mov	ah,4Ch
   4.385 +		jcxz	do_int21h
   4.386 +		mov	bx, offset msg_hang
   4.387 +		call	puts
   4.388 +;        global  _abort:near
   4.389 +_abort:
   4.390 +		cli
   4.391 +		hlt
   4.392 +		jmp	_abort
   4.393 +
   4.394 +	endp	@die$qpxzc
   4.395 +
   4.396 +;***************************************************************
   4.397 +;_fastcall void open_image(si:struct image_himem *m, ax:const char *name);
   4.398 +;***************************************************************
   4.399 +
   4.400 +        global  @open_image$qp11image_himempxzc:near
   4.401 +        proc    @open_image$qp11image_himempxzc near
   4.402 +
   4.403 +                mov	[(image_himem si).state],ax
   4.404 +		push	ax
   4.405 +@@next:
   4.406 +		call	next_chunk
   4.407 +		ifndef	NO386
   4.408 +		add	eax,3
   4.409 +		and	al,0FCh
   4.410 +		add	[(image_himem si).size],eax	; m->size += m->chunk_size	size zero'd in bss
   4.411 +		or	eax,eax
   4.412 +		else
   4.413 +		add	ax,3
   4.414 +		adc	dx,0
   4.415 +		and	al,0FCh
   4.416 +		add	[word (image_himem si).size],ax	; m->size += m->chunk_size	size zero'd in bss
   4.417 +		adc	[word ((image_himem si).size)+2],dx
   4.418 +		or	ax,dx
   4.419 +		endif
   4.420 +		jnz	@@next
   4.421 +                pop	[(image_himem si).state]
   4.422 +
   4.423 +        endp    @open_image$qp11image_himempxzc
   4.424 +
   4.425 +
   4.426 +;***************************************************************
   4.427 +;static long next_chunk(struct image_himem *si);
   4.428 +;***************************************************************
   4.429 +        proc    next_chunk near
   4.430 +
   4.431 +		ifndef	NO_CLOSE
   4.432 +		mov	ax,[(image_himem si).fd]
   4.433 +		call	close
   4.434 +		endif
   4.435 +		ifndef	NO386
   4.436 +		xor	eax,eax
   4.437 +		else
   4.438 +		xor	ax,ax
   4.439 +		cwd
   4.440 +		endif
   4.441 +		mov	[(image_himem si).fd],ax
   4.442 +		mov	bx,[(image_himem si).state]
   4.443 +		cmp	al,[bx]			; ""
   4.444 +		jz	@@end
   4.445 +		dec	bx
   4.446 +		push	di
   4.447 +@@scan:
   4.448 +		inc	bx
   4.449 +		mov	al,[bx]
   4.450 +		mov	di,bx
   4.451 +		or	al,al
   4.452 +		jz	@@eos
   4.453 +		sub	al,','
   4.454 +		jnz	@@scan
   4.455 +		inc	bx
   4.456 +@@eos:
   4.457 +		xchg	[(image_himem si).state],bx	; set start of string
   4.458 +		mov	[current_file],bx
   4.459 +		xchg	[di],ax			; set temp eos (ax == 0)
   4.460 +		push	ax
   4.461 +		call	@open$qpxzc
   4.462 +		pop	[word di]		; restore string
   4.463 +		pop	di
   4.464 +		jnc	@@opened
   4.465 +loadfailure:
   4.466 +;***************************************************************
   4.467 +;_fastcall void loadfailure(void);
   4.468 +;***************************************************************
   4.469 +	global	@loadfailure$qv:near
   4.470 +@loadfailure$qv:
   4.471 +		mov	bx,0
   4.472 +		org	$-2
   4.473 +current_file	dw	?
   4.474 +		call	puts
   4.475 +		mov	bx,offset loaderr
   4.476 +jmpdie:
   4.477 +		jmp	die
   4.478 +@@opened:
   4.479 +		mov	[(image_himem si).fd],ax
   4.480 +		ifndef	NO_CLOSE
   4.481 +		mov	[(image_himem si).fd2close],ax
   4.482 +		endif
   4.483 +	ifdef ISO9660
   4.484 +		ifndef	NO386
   4.485 +		mov	eax,[_isostate.filesize]
   4.486 +		else
   4.487 +		les	ax,[_isostate.filesize]
   4.488 +		mov	dx,es
   4.489 +		endif
   4.490 +	else
   4.491 +		mov	bl,02h			; SEEK_END
   4.492 +		call	lseek0
   4.493 +		ifndef	NO386
   4.494 +		push	eax
   4.495 +		mov	ax,[(image_himem si).fd]
   4.496 +		call	rewind
   4.497 +		pop	eax
   4.498 +		else
   4.499 +		push	ax
   4.500 +		push	dx
   4.501 +		mov	ax,[(image_himem si).fd]
   4.502 +		call	rewind
   4.503 +		pop	dx
   4.504 +		pop	ax
   4.505 +		endif
   4.506 +	endif
   4.507 +@@end:
   4.508 +		ifndef	NO386
   4.509 +		mov	[(image_himem si).chunk_size],eax
   4.510 +		else
   4.511 +		mov	[word (image_himem si).chunk_size],ax
   4.512 +		mov	[word ((image_himem si).chunk_size)+2],dx
   4.513 +		endif
   4.514 +		ret
   4.515 +
   4.516 +        endp    next_chunk
   4.517 +
   4.518 +
   4.519 +;***************************************************************
   4.520 +;_fastcall int read_image(si:struct image_himem *m);
   4.521 +;***************************************************************
   4.522 +        global  @read_image$qp11image_himem:near
   4.523 +        proc    @read_image$qp11image_himem near
   4.524 +
   4.525 +		push	di
   4.526 +		xor	di,di
   4.527 +@@loop:
   4.528 +		ifndef	NO386
   4.529 +		xor	ecx,ecx
   4.530 +		mov	ch,4096/256
   4.531 +		sub	cx,di
   4.532 +		mov	eax,[(image_himem si).chunk_size]
   4.533 +		cmp	ecx,eax
   4.534 +		jb	@@szok
   4.535 +		else
   4.536 +		mov	cx,4096
   4.537 +		sub	cx,di
   4.538 +		mov	ax,[word (image_himem si).chunk_size]
   4.539 +		cmp	cx,ax
   4.540 +		jb	@@szok
   4.541 +		cmp	[word ((image_himem si).chunk_size)+2],0	; hi m->chunk_size
   4.542 +		jne	@@szok
   4.543 +		endif
   4.544 +		xchg	ax,cx
   4.545 +@@szok:
   4.546 +		jcxz	image_done
   4.547 +		lea	dx,[di+_buf4k]
   4.548 +		mov	bx,[(image_himem si).fd]
   4.549 +		call	@read$cxdxbx
   4.550 +		jb	image_done
   4.551 +		add	di,ax
   4.552 +		ifndef	NO386
   4.553 +		cwde				; ax < 8000h
   4.554 +		cdq
   4.555 +		sub	[(image_himem si).chunk_size],eax
   4.556 +		else
   4.557 +		cwd				; ax < 8000h
   4.558 +		sub	[word (image_himem si).chunk_size],ax
   4.559 +		sbb	[word ((image_himem si).chunk_size)+2],dx
   4.560 +		endif
   4.561 +@@fill:
   4.562 +		test	al,3
   4.563 +		je	@@filled
   4.564 +		mov	[di+_buf4k],dl
   4.565 +		inc	di
   4.566 +		inc	ax
   4.567 +		jmp	@@fill
   4.568 +@@filled:
   4.569 +		ifndef	NO386
   4.570 +		sub	[(image_himem si).remaining],eax
   4.571 +		or	edx,[word (image_himem si).chunk_size]
   4.572 +		else
   4.573 +		sub	[word (image_himem si).remaining],ax
   4.574 +		sbb	[word ((image_himem si).remaining)+2],dx
   4.575 +		mov	ax,[word (image_himem si).chunk_size]
   4.576 +		or	ax,[word ((image_himem si).chunk_size)+2]
   4.577 +		endif
   4.578 +		jnz	@@same_chunk
   4.579 +		call	next_chunk
   4.580 +@@same_chunk:
   4.581 +		jmp	@@loop
   4.582 +image_done:
   4.583 +		xchg	ax,di
   4.584 +                pop	di
   4.585 +		ret
   4.586 +
   4.587 +        endp    @read_image$qp11image_himem
   4.588 +
   4.589 +;***************************************************************
   4.590  ;_fastcall const char **argstr(bx:const char *s, ax:const char keywords[], dx:const char **var);
   4.591  ;_fastcall unsigned long *argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var);
   4.592  ;***************************************************************
   4.593 @@ -583,534 +1103,6 @@
   4.594  
   4.595  	endp	@argstr$qpxzcxt1ppxzc
   4.596  
   4.597 -;***************************************************************
   4.598 -;_fastcall void puts(bx:const char* s):
   4.599 -;***************************************************************
   4.600 -        global  @puts$qpxzc:near
   4.601 -
   4.602 -;        global  puts:near			; puts(bx)
   4.603 -@putsz:
   4.604 -		call	@putc
   4.605 -@puts$qpxzc:
   4.606 -puts:
   4.607 -		mov	dl,[bx]
   4.608 -		inc	bx
   4.609 -		or	dl,dl
   4.610 -		jne	@putsz
   4.611 -		mov	dl,10
   4.612 -@putc:
   4.613 -		cmp	dl,10
   4.614 -		jne	@putcz
   4.615 -		call	@putcz2
   4.616 -@putcz2:
   4.617 -		xor	dl,7		; 10^13  1010^1101
   4.618 -@putcz:
   4.619 -		mov	ah,2
   4.620 -do_int21h:
   4.621 -		int	21h
   4.622 -		ret
   4.623 -
   4.624 -
   4.625 -		include	"himem.inc"
   4.626 -
   4.627 -;***************************************************************
   4.628 -;_fastcall char* malloc_or_die(ax:unsigned size);
   4.629 -;***************************************************************
   4.630 -xchg_heap_top:
   4.631 -		xchg	ax,[bx]
   4.632 -		ret
   4.633 -
   4.634 -        proc    @malloc_or_die$qui near
   4.635 -
   4.636 -malloc_or_die: 				; ax = malloc_or_die(ax)
   4.637 -		extrn	_heap_top
   4.638 -		mov	bx,offset _heap_top
   4.639 -		add	ax,[bx]
   4.640 -		jnc	xchg_heap_top
   4.641 -		mov	bx,offset msg_malloc
   4.642 -
   4.643 -        endp    @malloc_or_die$qui
   4.644 -
   4.645 -
   4.646 -;***************************************************************
   4.647 -;_fastcall int die(bx:const char* msg);
   4.648 -;int exit(ax:int status);
   4.649 -;int abort(void);
   4.650 -;***************************************************************
   4.651 -	global	@die$qpxzc:near
   4.652 -	proc	@die$qpxzc near
   4.653 -@die$qpxzc:
   4.654 -        global  die:near			; die(bx)
   4.655 -die:
   4.656 -		call	puts
   4.657 -        global  @exit$qv:near
   4.658 -@exit$qv:
   4.659 -_exit:
   4.660 -		extrn	_imgs:image_himem
   4.661 -		mov	cx,[(word _imgs.buf)+2]	; no_exit ?
   4.662 -                mov	ah,4Ch
   4.663 -		jcxz	do_int21h
   4.664 -		mov	bx, offset msg_hang
   4.665 -		call	puts
   4.666 -;        global  _abort:near
   4.667 -_abort:
   4.668 -		cli
   4.669 -		hlt
   4.670 -		jmp	_abort
   4.671 -
   4.672 -	endp	@die$qpxzc
   4.673 -
   4.674 -;***************************************************************
   4.675 -;_fastcall void open_image(si:struct image_himem *m, ax:const char *name);
   4.676 -;***************************************************************
   4.677 -
   4.678 -        global  @open_image$qp11image_himempxzc:near
   4.679 -        proc    @open_image$qp11image_himempxzc near
   4.680 -
   4.681 -                mov	[(image_himem si).state],ax
   4.682 -		push	ax
   4.683 -@@next:
   4.684 -		call	next_chunk
   4.685 -		ifndef	NO386
   4.686 -		add	eax,3
   4.687 -		and	al,0FCh
   4.688 -		add	[(image_himem si).size],eax	; m->size += m->chunk_size
   4.689 -		or	eax,eax
   4.690 -		else
   4.691 -		add	ax,3
   4.692 -		adc	dx,0
   4.693 -		and	al,0FCh
   4.694 -		add	[word (image_himem si).size],ax	; m->size += m->chunk_size
   4.695 -		adc	[word ((image_himem si).size)+2],dx
   4.696 -		or	ax,dx
   4.697 -		endif
   4.698 -		jnz	@@next
   4.699 -                pop	[(image_himem si).state]
   4.700 -
   4.701 -        endp    @open_image$qp11image_himempxzc
   4.702 -
   4.703 -
   4.704 -;***************************************************************
   4.705 -;static long next_chunk(struct image_himem *si);
   4.706 -;***************************************************************
   4.707 -        proc    next_chunk near
   4.708 -
   4.709 -		ifndef	NO_CLOSE
   4.710 -		mov	ax,[(image_himem si).fd]
   4.711 -		call	close
   4.712 -		endif
   4.713 -		ifndef	NO386
   4.714 -		xor	eax,eax
   4.715 -		else
   4.716 -		xor	ax,ax
   4.717 -		cwd
   4.718 -		endif
   4.719 -		mov	[(image_himem si).fd],ax
   4.720 -		mov	bx,[(image_himem si).state]
   4.721 -		cmp	al,[bx]			; ""
   4.722 -		jz	@@end
   4.723 -		dec	bx
   4.724 -		push	di
   4.725 -@@scan:
   4.726 -		inc	bx
   4.727 -		mov	al,[bx]
   4.728 -		mov	di,bx
   4.729 -		or	al,al
   4.730 -		jz	@@eos
   4.731 -		sub	al,','
   4.732 -		jnz	@@scan
   4.733 -		inc	bx
   4.734 -@@eos:
   4.735 -		xchg	[(image_himem si).state],bx	; set start of string
   4.736 -		mov	[current_file],bx
   4.737 -		xchg	[di],ax			; set temp eos (ax == 0)
   4.738 -		push	ax
   4.739 -		call	@open$qpxzc
   4.740 -		pop	[word di]		; restore string
   4.741 -		pop	di
   4.742 -		jnc	@@opened
   4.743 -loadfailure:
   4.744 -;***************************************************************
   4.745 -;_fastcall void loadfailure(void);
   4.746 -;***************************************************************
   4.747 -	global	@loadfailure$qv:near
   4.748 -@loadfailure$qv:
   4.749 -		mov	bx,0
   4.750 -		org	$-2
   4.751 -current_file	dw	?
   4.752 -		call	puts
   4.753 -		mov	bx,offset loaderr
   4.754 -jmpdie:
   4.755 -		jmp	die
   4.756 -@@opened:
   4.757 -		mov	[(image_himem si).fd],ax
   4.758 -		ifndef	NO_CLOSE
   4.759 -		mov	[(image_himem si).fd2close],ax
   4.760 -		endif
   4.761 -	ifdef ISO9660
   4.762 -		ifndef	NO386
   4.763 -		mov	eax,[_isostate.filesize]
   4.764 -		else
   4.765 -		mov	ax,[word _isostate.filesize]
   4.766 -		mov	dx,[(word _isostate.filesize)+2]
   4.767 -		endif
   4.768 -	else
   4.769 -		mov	bl,02h			; SEEK_END
   4.770 -		call	lseek0
   4.771 -		ifndef	NO386
   4.772 -		push	eax
   4.773 -		mov	ax,[(image_himem si).fd]
   4.774 -		call	rewind
   4.775 -		pop	eax
   4.776 -		else
   4.777 -		push	ax
   4.778 -		push	dx
   4.779 -		mov	ax,[(image_himem si).fd]
   4.780 -		call	rewind
   4.781 -		pop	dx
   4.782 -		pop	ax
   4.783 -		endif
   4.784 -	endif
   4.785 -@@end:
   4.786 -		ifndef	NO386
   4.787 -		mov	[(image_himem si).chunk_size],eax
   4.788 -		else
   4.789 -		mov	[word (image_himem si).chunk_size],ax
   4.790 -		mov	[word ((image_himem si).chunk_size)+2],dx
   4.791 -		endif
   4.792 -		ret
   4.793 -
   4.794 -        endp    next_chunk
   4.795 -
   4.796 -		ifdef	VCPI
   4.797 -;***************************************************************
   4.798 -
   4.799 -struc   data_himem			;struct data_himem {
   4.800 -first		dd	?		;   0  u32 first;	*must* be the first one
   4.801 -cacheidx	dw	?		;   4  int cacheidx;	quad *
   4.802 -pageidx		dw	?		;   6  int pageidx;	byte *
   4.803 -cache		dd	1024 dup(?)	;   8  int cache;
   4.804 -page		dd	1024 dup(?)	;4104  int page;
   4.805 -ends	data_himem			;};
   4.806 -
   4.807 -;***************************************************************
   4.808 -;_fastcall u32* malloc_bufv_or_die(si:struct image_himem *m);
   4.809 -;***************************************************************
   4.810 -        global  @malloc_bufv_or_die$qp11image_himem:near
   4.811 -        proc    @malloc_bufv_or_die$qp11image_himem near
   4.812 -
   4.813 -                p386
   4.814 -		push	si
   4.815 -		;mov	ecx,[(image_himem si).size]
   4.816 -		;shr	ecx,20			; pages index size = size >> 20
   4.817 -		;mov	ax,cx
   4.818 -		;add	ax,size data_himem-4096
   4.819 -		mov	ax,size data_himem
   4.820 -		call	malloc_or_die
   4.821 -		;mov	cx,4096+4095		; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE;
   4.822 -		mov	ecx,4096+4095		; cnt = 1+(m->size+PAGE_MASK)/PAGE_SIZE;
   4.823 -		add	ecx,[(image_himem si).size]
   4.824 -		shr	ecx,12
   4.825 -		mov	[curdata],ax
   4.826 -		mov	[(image_himem si).bufv],ax	; update m->bufv
   4.827 -		xchg	ax,si
   4.828 -@@vcpi_alloc:
   4.829 -                mov     ax,0DE04h		; allocate a 4K page => EDX
   4.830 -                int     67h
   4.831 -		or	ah,ah
   4.832 -		mov	bx,offset vcpi_alloc_err
   4.833 -		jnz	jmpdie
   4.834 -; for (i = cnt-1; i >= 0; i--)
   4.835 -; if (edx < pm.fallback+pm.size) again
   4.836 -		mov	bx,offset _imgs.fallback+size image_himem
   4.837 -		mov	eax,[bx-2+6-size image_himem]	; pm.size
   4.838 -		add	eax,[bx-2+2-size image_himem]
   4.839 -		cmp	eax,edx		; pm.fallback+pm.size <= edx ?
   4.840 -		ja	@@vcpi_alloc
   4.841 -		mov	eax,ecx
   4.842 -		dec	eax
   4.843 -		shl	eax,12		; i*_4k
   4.844 -; if (edx >= initrd.fallback+i*_4k && edx < initrd.fallback+initrd.size) again
   4.845 -		add	eax,[bx-2+2]	; +initrd.fallback
   4.846 -		cmp	eax,edx		; initrd.fallback+i*_4k > edx ?
   4.847 -		ja	@@initrdok
   4.848 -		mov	eax,[bx-2+6]	; initrd.size
   4.849 -		add	eax,[bx-2+2]	; +initrd.fallback
   4.850 -		cmp	eax,edx		; initrd.fallback+initrd.size > edx ?
   4.851 -@@ja_vcpi_alloc:
   4.852 -		ja	@@vcpi_alloc
   4.853 -@@initrdok:
   4.854 -		cmp	[(data_himem si).first],0
   4.855 -		jne	@@notfirst
   4.856 -		mov	[(data_himem si).first],edx
   4.857 -@@notfirst:
   4.858 -		mov	bx,[(data_himem si).cacheidx]
   4.859 -		cmp	bh,4
   4.860 -		jae	@@nextpage
   4.861 -		shl	bx,2
   4.862 -		inc	[(data_himem si).cacheidx]
   4.863 -		mov	[(data_himem bx+si).cache],edx	; cache[cacheidx++] = edx
   4.864 -		loopd	@@vcpi_alloc
   4.865 -		mov	[(data_himem bx+si).cache],ecx	; last is 0
   4.866 -@@nextpage:
   4.867 -		and	[(data_himem si).cacheidx],0
   4.868 -		mov	bx,[(data_himem si).pageidx]
   4.869 -		mov	[(data_himem bx+si).page],edx
   4.870 -		add	[(data_himem si).pageidx],4
   4.871 -		push	cx
   4.872 -		lea	cx,[(data_himem si).cache]
   4.873 -		ifdef	NO386
   4.874 -		push	edx
   4.875 -		pop	ax			; to es:ax
   4.876 -		pop	es
   4.877 -		endif
   4.878 -		call	storepage		; storepage(edx/es:ax,cx)	
   4.879 -		pop	cx
   4.880 -		or	ecx,ecx			; clear C
   4.881 -		jnz	@@ja_vcpi_alloc
   4.882 -		mov	[dword (data_himem si).cacheidx],ecx
   4.883 -		xchg	ax,si
   4.884 -		pop	si
   4.885 -		ret
   4.886 -		ifdef	NO386
   4.887 -                p8086
   4.888 -		endif
   4.889 -
   4.890 -        endp    @malloc_bufv_or_die$qp11image_himem
   4.891 -		endif
   4.892 -
   4.893 -
   4.894 -;***************************************************************
   4.895 -;_fastcall void memcpy_image_initrd(si:struct image_himem *m);
   4.896 -;_fastcall void memcpy_image_kernel(si:struct image_himem *m);
   4.897 -;_fastcall void memcpy_image(bx:struct image_himem *m);
   4.898 -;***************************************************************
   4.899 -	global	@memcpy_image_initrd$qv:near
   4.900 -@memcpy_image_initrd$qv:
   4.901 -		lea	bx,[si+size image_himem]
   4.902 -		db	0A9h			; test	ax,imm
   4.903 -	global	@memcpy_image_kernel$qv:near
   4.904 -@memcpy_image_kernel$qv:
   4.905 -		mov	bx,si
   4.906 -        proc    @memcpy_image$qp11image_himem near
   4.907 -
   4.908 -		ifndef	NO386
   4.909 -		mov	edx,[(image_himem bx).fallback]
   4.910 -		mov	eax,[(image_himem bx).buf]
   4.911 -		cmp	eax,edx			; if (m->fallback != m->buf)
   4.912 -		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   4.913 -		mov	ecx,[(image_himem bx).size]
   4.914 -		else
   4.915 -		les	cx,[((image_himem bx).buf)]
   4.916 -		mov	dx,es
   4.917 -		les	ax,[((image_himem bx).fallback)]
   4.918 -		cmp	ax,cx			; if (m->fallback != m->buf)
   4.919 -		jnz	@@do
   4.920 -		cmp	dx,[word ((image_himem bx).fallback)+2]
   4.921 -		jz	@@skip			;   memcpy32(m->fallback,0,m->buf,m->size)
   4.922 -@@do:
   4.923 -		push	[((image_himem bx).size)]
   4.924 -		xor	bx,bx
   4.925 -call_memcpy32:					; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   4.926 -		push	dx			; [word ((image_himem bx).buf)+2]
   4.927 -		push	cx			; [word ((image_himem bx).buf)]
   4.928 -		push	bx
   4.929 -		push	es			; push es:ax
   4.930 -		push	ax
   4.931 -		jmp	@@memcpy
   4.932 -		endif
   4.933 -memcpy_imagez:					; memcpy_imagez(edx,eax,ecx)
   4.934 -		p386
   4.935 -		push	ecx
   4.936 -		push	eax
   4.937 -		push	0
   4.938 -		ifndef	NO386
   4.939 -call_memcpy32:					; call_memcpy32(to=edx,fromseg,fromofs,size)
   4.940 -		endif
   4.941 -		push	edx
   4.942 -		ifdef	NO386
   4.943 -                p8086
   4.944 -		endif
   4.945 -@@memcpy:
   4.946 -		extrn	memcpy32:near
   4.947 -		call	near memcpy32
   4.948 -@@skip:
   4.949 -		ret
   4.950 -
   4.951 -        endp    @memcpy_image$qp11image_himem
   4.952 -
   4.953 -;***************************************************************
   4.954 -;_fastcall void storepage(di:u32 *dst);
   4.955 -;***************************************************************
   4.956 -        global  @storepage$qpul:near
   4.957 -        proc    @storepage$qpul near
   4.958 -
   4.959 -		ifndef	NO386
   4.960 -		mov	edx,[di]
   4.961 -		else
   4.962 -		les	ax,[dword di]
   4.963 -		endif
   4.964 -		mov	cx,offset _buf4k
   4.965 -storepage:					; storepage(edx,cx)
   4.966 -		ifndef	NO386
   4.967 -		push	0
   4.968 -		push	4096
   4.969 -		push	0
   4.970 -		push	cx
   4.971 -		push	ds			; call_memcpy32(to=edx,fromseg,fromofs,size)
   4.972 -		else
   4.973 -		xor	dx,dx
   4.974 -		push	dx			; 0
   4.975 -		mov	bx,4096
   4.976 -		push	bx			; 4096
   4.977 -		mov	bx,ds			; call_memcpy32(to=es:ax,fromseg=bx,fromofs=dx:cx,size)
   4.978 -		endif
   4.979 -		jmp	call_memcpy32
   4.980 -
   4.981 -        endp    @storepage$qpul
   4.982 -
   4.983 -		ifdef	VCPI
   4.984 -                p386
   4.985 -;***************************************************************
   4.986 -;_fastcall void reset_bufv(di:u32 *p);
   4.987 -;***************************************************************
   4.988 -        global  @reset_bufv$qpul:near
   4.989 -        proc    @reset_bufv$qpul near
   4.990 -
   4.991 -		mov	[curdata],di
   4.992 -		and	[dword (data_himem di).cacheidx],0	; and pageidx=0
   4.993 -		ret
   4.994 -
   4.995 -        endp    @reset_bufv$qpul
   4.996 -
   4.997 -;***************************************************************
   4.998 -;u32* di=prev_bufv();
   4.999 -;u32* di=prev_bufv();
  4.1000 -;***************************************************************
  4.1001 -        global  _prev_bufv:near
  4.1002 -        global  _next_bufv:near
  4.1003 -        proc    _prev_bufv near
  4.1004 -
  4.1005 -		stc
  4.1006 -		db	73h			; jnc
  4.1007 -_next_bufv:
  4.1008 -		clc
  4.1009 -		push	si
  4.1010 -		mov	bx,0
  4.1011 -		org	$-2
  4.1012 -curdata		dw	?
  4.1013 -		sbb	ax,ax
  4.1014 -		cmc
  4.1015 -		adc	ax,[(data_himem bx).cacheidx]	; -1/+1
  4.1016 -		mov	si,3ffh
  4.1017 -		and	si,ax
  4.1018 -		mov	[(data_himem bx).cacheidx],si
  4.1019 -		shl	si,2
  4.1020 -		xor	ecx,ecx
  4.1021 -		test	ax,0fc00h
  4.1022 -		jz	@@gotpage		; FFFF / 0400
  4.1023 -		xchg	al,ah			; FFFC / 0004
  4.1024 -		and	al,0fch
  4.1025 -		add	[(data_himem bx).pageidx],ax
  4.1026 -		mov	di,[(data_himem bx).pageidx]
  4.1027 -		lea	di,[(data_himem bx+di).page]
  4.1028 -		mov	edx,ds
  4.1029 -		shl	edx,4
  4.1030 -		lea	cx,[(data_himem bx).cache]		
  4.1031 -		add	edx,ecx
  4.1032 -		mov	eax,[di]
  4.1033 -		or	eax,eax
  4.1034 -		jz	@@ret
  4.1035 -		mov	cx,4096			; get page
  4.1036 -		call	memcpy_imagez		; memcpy_imagez(edx,eax,ecx)
  4.1037 -@@gotpage:
  4.1038 -		lea	ax,[(data_himem bx+si).cache]		
  4.1039 -		or	si,[(data_himem bx).pageidx]	; !pageidx && !cacheidx
  4.1040 -		jnz	@@notfirst2
  4.1041 -		xchg	ax,bx				; &first
  4.1042 -@@notfirst2:
  4.1043 -		xchg	ax,di
  4.1044 -@@ret:
  4.1045 -		pop	si
  4.1046 -		ret
  4.1047 -
  4.1048 -        endp    _prev_bufv
  4.1049 -		endif
  4.1050 -
  4.1051 -		ifdef	NO386
  4.1052 -                p8086
  4.1053 -		endif
  4.1054 -
  4.1055 -;***************************************************************
  4.1056 -;_fastcall int read_image(si:struct image_himem *m);
  4.1057 -;***************************************************************
  4.1058 -        global  @read_image$qp11image_himem:near
  4.1059 -        proc    @read_image$qp11image_himem near
  4.1060 -
  4.1061 -		push	di
  4.1062 -		xor	di,di
  4.1063 -@@loop:
  4.1064 -		ifndef	NO386
  4.1065 -		xor	ecx,ecx
  4.1066 -		mov	ch,4096/256
  4.1067 -		sub	cx,di
  4.1068 -		mov	eax,[(image_himem si).chunk_size]
  4.1069 -		cmp	ecx,eax
  4.1070 -		jb	@@szok
  4.1071 -		else
  4.1072 -		mov	cx,4096
  4.1073 -		sub	cx,di
  4.1074 -		mov	ax,[word (image_himem si).chunk_size]
  4.1075 -		cmp	cx,ax
  4.1076 -		jb	@@szok
  4.1077 -		cmp	[word ((image_himem si).chunk_size)+2],0	; hi m->chunk_size
  4.1078 -		jne	@@szok
  4.1079 -		endif
  4.1080 -		xchg	ax,cx
  4.1081 -@@szok:
  4.1082 -		jcxz	image_done
  4.1083 -		lea	dx,[di+_buf4k]
  4.1084 -		mov	bx,[(image_himem si).fd]
  4.1085 -		call	@read$cxdxbx
  4.1086 -		jb	image_done
  4.1087 -		add	di,ax
  4.1088 -		ifndef	NO386
  4.1089 -		cwde				; ax < 8000h
  4.1090 -		cdq
  4.1091 -		sub	[(image_himem si).chunk_size],eax
  4.1092 -		else
  4.1093 -		cwd				; ax < 8000h
  4.1094 -		sub	[word (image_himem si).chunk_size],ax
  4.1095 -		sbb	[word ((image_himem si).chunk_size)+2],dx
  4.1096 -		endif
  4.1097 -@@fill:
  4.1098 -		test	al,3
  4.1099 -		je	@@filled
  4.1100 -		mov	[di+_buf4k],dl
  4.1101 -		inc	di
  4.1102 -		inc	ax
  4.1103 -		jmp	@@fill
  4.1104 -@@filled:
  4.1105 -		ifndef	NO386
  4.1106 -		sub	[(image_himem si).remaining],eax
  4.1107 -		or	edx,[word (image_himem si).chunk_size]
  4.1108 -		else
  4.1109 -		sub	[word (image_himem si).remaining],ax
  4.1110 -		sbb	[word ((image_himem si).remaining)+2],dx
  4.1111 -		mov	ax,[word (image_himem si).chunk_size]
  4.1112 -		or	ax,[word ((image_himem si).chunk_size)+2]
  4.1113 -		endif
  4.1114 -		jnz	@@same_chunk
  4.1115 -		call	next_chunk
  4.1116 -@@same_chunk:
  4.1117 -		jmp	@@loop
  4.1118 -image_done:
  4.1119 -		xchg	ax,di
  4.1120 -                pop	di
  4.1121 -		ret
  4.1122 -
  4.1123 -        endp    @read_image$qp11image_himem
  4.1124 -
  4.1125  
  4.1126          ends    _TEXT
  4.1127  
     5.1 --- a/linld/stuff/src/HIMEM.CPP	Wed Apr 07 15:56:56 2021 +0100
     5.2 +++ b/linld/stuff/src/HIMEM.CPP	Thu Apr 08 09:21:26 2021 +0000
     5.3 @@ -59,6 +59,7 @@
     5.4  	pushf
     5.5  	;cli
     5.6  	push	ds
     5.7 +	push	es
     5.8  	push	cs
     5.9  	pop	ds
    5.10  # ifdef NO386
    5.11 @@ -88,11 +89,12 @@
    5.12          // Move initrd
    5.13          memcpy_image_initrd();
    5.14  #ifdef VCPI
    5.15 -    } else { //vcpi
    5.16 +    } else { //vcpi	FIXME: LARGE_ZIMAGE case
    5.17  #if defined(__BORLANDC__) && defined(NO386)
    5.18  #pragma option -3
    5.19  	asm{
    5.20  		.386p
    5.21 +		pushad
    5.22  	}
    5.23  #endif
    5.24          // Move kernel
    5.25 @@ -125,6 +127,9 @@
    5.26                  memcpy_image_initrd();
    5.27              } while(q != m[INITRD].bufv);
    5.28          }
    5.29 +	asm{
    5.30 +		popad
    5.31 +        }
    5.32      }
    5.33  #endif
    5.34      asm {
    5.35 @@ -136,6 +141,7 @@
    5.36  # else
    5.37  	popa
    5.38  # endif
    5.39 +	pop	es
    5.40  	pop	ds
    5.41  	popf
    5.42      }
     6.1 --- a/linld/stuff/src/HIMEM.INC	Wed Apr 07 15:56:56 2021 +0100
     6.2 +++ b/linld/stuff/src/HIMEM.INC	Thu Apr 08 09:21:26 2021 +0000
     6.3 @@ -1,11 +1,11 @@
     6.4 -struc   image_himem		;struct image_himem {
     6.5 -fd		dw	?	; 0    int fd;
     6.6 -fallback	dd	?	; 2    u32 fallback;
     6.7 -size		dd	?	; 6    u32 size;
     6.8 -remaining	dd	?	;10    u32 remaining;
     6.9 -buf		dd	?	;14    u32 buf;
    6.10 -bufv		dw	?	;18    u32 *bufv;
    6.11 -chunk_size	dd	?	;20    u32 chunk_size;
    6.12 -state		dw	?	;24    u16 state;
    6.13 -fd2close	dw	?	;26    u16 fd2close;
    6.14 -ends	image_himem		;};
    6.15 +struc   image_himem			;struct image_himem {
    6.16 +fd		dw	?		; 0    int fd;
    6.17 +fallback	dd	?		; 2    u32 fallback;
    6.18 +size		dd	?		; 6    u32 size;	// assume zero'd in bss
    6.19 +remaining	dd	?		;10    u32 remaining;
    6.20 +buf		dd	?		;14    u32 buf;
    6.21 +bufv		dw	?		;18    u32 *bufv;
    6.22 +chunk_size	dd	?		;20    u32 chunk_size;
    6.23 +state		dw	?		;24    u16 state;
    6.24 +fd2close	dw	?		;26    u16 fd2close;
    6.25 +ends	image_himem			;};
     7.1 --- a/linld/stuff/src/ISO9660.CPP	Wed Apr 07 15:56:56 2021 +0100
     7.2 +++ b/linld/stuff/src/ISO9660.CPP	Thu Apr 08 09:21:26 2021 +0000
     7.3 @@ -15,7 +15,7 @@
     7.4  	x->dirsize = filesize2dirsize(* (unsigned long *) (buf2k + 0xA6)); \
     7.5  }
     7.6  
     7.7 -#ifdef RAW_ISO9660
     7.8 +#if !defined(BASIC_ISO9660) && defined(CLEAN_ISO9660)
     7.9  #define BASIC_ISO9660
    7.10  #endif
    7.11  #if !defined(BASIC_ISO9660) && !defined(ROCKRIDGE)
    7.12 @@ -68,7 +68,7 @@
    7.13  # endif
    7.14  	if (((* (short *) p) & 0xFEFF) -1 != 0) {
    7.15  		s = p + 1; p += *p;
    7.16 -# ifndef RAW_ISO9660
    7.17 +# ifdef CLEAN_ISO9660
    7.18  		if (* (short *) (p-1) == 0x313B) p-=2; // remove ;1
    7.19  		if (*p != '.') p++;
    7.20  # endif
     8.1 --- a/linld/stuff/src/ISO9660.H	Wed Apr 07 15:56:56 2021 +0100
     8.2 +++ b/linld/stuff/src/ISO9660.H	Thu Apr 08 09:21:26 2021 +0000
     8.3 @@ -13,11 +13,12 @@
     8.4  	unsigned long fileofs;
     8.5  	unsigned long filesize;
     8.6  	unsigned long filepos;
     8.7 -	char *filename;
     8.8 -	dirsizetype curdirsize, dirsize;
     8.9 +	dirsizetype dirsize;
    8.10  typedef unsigned dirpagetype;
    8.11  	dirpagetype dirpage;           
    8.12 +	dirsizetype curdirsize;
    8.13  	unsigned long curdirofs;
    8.14 +	char *filename;
    8.15  	char _64bits;
    8.16  	char c;
    8.17  	int entrysize;
     9.1 --- a/linld/stuff/src/ISOSTATE.INC	Wed Apr 07 15:56:56 2021 +0100
     9.2 +++ b/linld/stuff/src/ISOSTATE.INC	Thu Apr 08 09:21:26 2021 +0000
     9.3 @@ -1,22 +1,22 @@
     9.4  
     9.5  ;typedef unsigned dirsizetype;
     9.6  struc		isostate		; struct isostate {
     9.7 -curpos		dw	?		; 0	unsigned curpos;
     9.8 -filename2open	dw	?		; 2	char *filename2open;
     9.9 -fd		dw	?		; 4	int fd;
    9.10 -fileofs		dd	?		; 6	unsigned long fileofs;
    9.11 -filesize	dd	?		;10	unsigned long filesize;
    9.12 -filepos		dd	?		;14	unsigned long filepos;
    9.13 -filename	dw	?		;18	char *filename;
    9.14 -curdirsize	dw	?		;20	dirsizetype curdirsize;
    9.15 -dirsize		dw	?		;22	dirsizetype dirsize;
    9.16 -dirpape		dw	?		;24	unsigned short dirpage;
    9.17 -curdirofs	dd	?		;26	unsigned long curdirofs;
    9.18 -_64bits		db	?		;30	char _64bits;
    9.19 +curpos		dw	?		; 0L	unsigned curpos;		// assume zero'd in bss
    9.20 +filename2open	dw	?		; 2I	char *filename2open;
    9.21 +fd		dw	?		; 4X	int fd;				// assume zero'd in bss
    9.22 +fileofs		dd	?		; 6O	unsigned long fileofs;
    9.23 +filesize	dd	?		;10O	unsigned long filesize;
    9.24 +filepos		dd	?		;14O	unsigned long filepos;
    9.25 +dirsize		dw	?		;18S	dirsizetype dirsize;		//\
    9.26 +dirpage		dw	?		;20S	unsigned short dirpage;		///
    9.27 +curdirsize	dw	?		;22L	dirsizetype curdirsize;
    9.28 +curdirofs	dd	?		;24L	unsigned long curdirofs;	// assume zero'd in bss
    9.29  ;overlap
    9.30 -c		db	?		;31	char c;
    9.31 -entrysize	dw	?		;32	int entrysize;
    9.32 -tmp		dw	?		;34	const char *tmp;
    9.33 +filename	dw	?		;28U	char *filename;
    9.34 +_64bits		db	?		;30U	char _64bits;
    9.35 +c		db	?		;31U	char c;
    9.36 +entrysize	dw	?		;32U	int entrysize;
    9.37 +tmp		dw	?		;34U	const char *tmp;
    9.38  ends		isostate		; } isostate;
    9.39  
    9.40 -ISOSTATE_OVERLAP	=	5
    9.41 +ISOSTATE_OVERLAP	=	8
    10.1 --- a/linld/stuff/src/JUMP.ASM	Wed Apr 07 15:56:56 2021 +0100
    10.2 +++ b/linld/stuff/src/JUMP.ASM	Thu Apr 08 09:21:26 2021 +0000
    10.3 @@ -2,7 +2,7 @@
    10.4  ;****** This file is distributed under GPL
    10.5  ;***************************************************************
    10.6                  ideal
    10.7 -		%PAGESIZE 1000
    10.8 +		%PAGESIZE 255
    10.9                  %crefref
   10.10                  %noincl
   10.11                  %nomacs
   10.12 @@ -87,7 +87,6 @@
   10.13  ;void boot_kernel();
   10.14  ;****** Never returns
   10.15  ;***************************************************************
   10.16 -	global	_boot_kernel:near
   10.17          proc    _boot_kernel near
   10.18          
   10.19  		ifdef	NO386
   10.20 @@ -165,7 +164,13 @@
   10.21  		include	"himem.inc"
   10.22  
   10.23  		extrn	_imgs:image_himem
   10.24 +		ifdef	NO386
   10.25 +		les	ax,[_imgs.fallback]	; src ofs = pm.fallback
   10.26 +		push	es
   10.27 +		push	ax
   10.28 +		else
   10.29  		push	[_imgs.fallback]	; src ofs = pm.fallback
   10.30 +		endif
   10.31  
   10.32  		;in	al,70h
   10.33  		;or	al,80h			; disable NMI
   10.34 @@ -183,7 +188,7 @@
   10.35  
   10.36  		ifdef	NO386
   10.37  		mov	ax,ss
   10.38 -		add	ax,900h
   10.39 +		add	ax,800h+(4096/16)
   10.40  		push	ax			; topseg()+0x0900
   10.41  		else
   10.42  		push	9800h+(4096/16)		; 4096 bytes for cmdline
   10.43 @@ -199,9 +204,12 @@
   10.44  		xor	di,di
   10.45  		rep
   10.46  		  movsb
   10.47 -		call	near @@isbzimage	; movsb; pop cs ; ds=es=ss
   10.48 +		call	near @@isbzimage	; pop cs ; ds=es=ss
   10.49  		endif
   10.50  
   10.51 +		;mov	es,cx
   10.52 +		;mov	[es:15*4+2],cs		; update int15/88h hook
   10.53 +
   10.54  		extrn   memcpy32:near
   10.55  		call	memcpy32
   10.56  
    11.1 --- a/linld/stuff/src/LINK.CMD	Wed Apr 07 15:56:56 2021 +0100
    11.2 +++ b/linld/stuff/src/LINK.CMD	Thu Apr 08 09:21:26 2021 +0000
    11.3 @@ -1,1 +1,1 @@
    11.4 -_beg.obj linld.obj jump.obj memtop.obj memcpy32.obj vcpi.obj xmm.obj a20.obj crtl.obj load.obj himem.obj iso9660.obj _end.obj, linld
    11.5 +_beg.obj linld.obj jump.obj memtop.obj memcpy32.obj vcpi.obj a20.obj crtl.obj xmm.obj load.obj himem.obj iso9660.obj _end.obj, linld
    12.1 --- a/linld/stuff/src/MEMCPY32.ASM	Wed Apr 07 15:56:56 2021 +0100
    12.2 +++ b/linld/stuff/src/MEMCPY32.ASM	Thu Apr 08 09:21:26 2021 +0000
    12.3 @@ -2,7 +2,7 @@
    12.4  ;****** This file is distributed under GPL
    12.5  ;***************************************************************
    12.6                  ideal
    12.7 -		%PAGESIZE 1000
    12.8 +		%PAGESIZE 255
    12.9                  %crefref
   12.10                  %noincl
   12.11                  %nomacs
   12.12 @@ -24,6 +24,12 @@
   12.13  				;3+ NOPs also work fine (chkd on 386)
   12.14  endm
   12.15  
   12.16 +macro   addzx_e rm,i
   12.17 +        db      66h
   12.18 +        add     rm,i
   12.19 +        dw      0
   12.20 +endm
   12.21 +
   12.22          segment _TEXT byte public use16 'CODE'
   12.23  
   12.24  ;***************************************************************
   12.25 @@ -41,18 +47,19 @@
   12.26  
   12.27  ;****** Init ***************************************************
   12.28  
   12.29 +		push	bp
   12.30 +		mov	bp,sp
   12.31 +		;cld
   12.32 +                pushf
   12.33 +                push    ds
   12.34 +
   12.35  			ifndef	NO386
   12.36  
   12.37 -		enter	0,0
   12.38 -		;cld
   12.39 -                pushf
   12.40 -                push    ds es
   12.41  		pushad				; struct declared in VCPI.ASM
   12.42  		mov	cl,4
   12.43                  movzx   esi,[srcseg]
   12.44                  shl     esi,cl
   12.45                  add     esi,[srcofs]
   12.46 -                mov     [srcofs],esi		; for memcpy_vcpi
   12.47                  mov     edi,[dstofs]
   12.48  
   12.49  	ifndef	pm_only
   12.50 @@ -60,9 +67,8 @@
   12.51  		shr	eax,cl
   12.52  		mov	edx,edi
   12.53  		shr	edx,cl
   12.54 -		mov	ecx,esi
   12.55 -		or	ecx,edi
   12.56 -		shr	ecx,20			; >1mb ?
   12.57 +		lea	ecx,[eax+edx]
   12.58 +		shr	ecx,16			; >1mb ?
   12.59                  jnz     @@pmcopy
   12.60  @@movlp:
   12.61  		mov	ds,ax
   12.62 @@ -84,13 +90,8 @@
   12.63  @@pmcopy:
   12.64  			else
   12.65  
   12.66 -		push	bp
   12.67 -		mov	bp,sp
   12.68 -		;cld
   12.69 -                pushf
   12.70 -                push    ds es
   12.71  		push	si
   12.72 -		xor	bx,bx
   12.73 +		push	di
   12.74  		xor	si,si
   12.75  		mov	ax,[srcseg]
   12.76  		extrn	N_LXLSH@4:near
   12.77 @@ -98,32 +99,31 @@
   12.78  		add	[word srcofs],ax
   12.79  		adc	[word srcofs+2],dx
   12.80  @@2flat:
   12.81 -		les	ax,[dword si+srcofs]	; srcofs, dstofs
   12.82 -		mov	dx,es
   12.83 +		les	dx,[dword si+srcofs]	; srcofs, dstofs
   12.84 +		mov	di,dx			; dstofs
   12.85 +		mov	ax,es
   12.86  		mov	cl,4
   12.87  @@loop:
   12.88 -		shr	dx,1
   12.89 -		rcr	ax,1
   12.90 +		shr	ax,1			; high
   12.91 +		rcr	dx,1			; low
   12.92  		loop	@@loop
   12.93 -		or	bx,dx			; >=1mb flag
   12.94 -		push	ax			; srcseg, dstseg
   12.95 +		push	dx			; srcseg, dstseg
   12.96 +		xchg	ax,bx			; save/restore high srcreg
   12.97  		xor	si,-6
   12.98  		jnz	@@2flat
   12.99 +		or	bx,ax			; srcseg & dstseg < 1mb ? clear C
  12.100  		pop	dx			; dstseg
  12.101  		pop	ax			; srcseg
  12.102 -		cmp	bx,si			; <1mb ?
  12.103 -                jne     @@pmcopy
  12.104 -		push	di
  12.105 -@@movlp:
  12.106 +                jnz	@@pmcopy
  12.107 +@@movlp:					; bx=cx=0
  12.108  		mov	ds,ax
  12.109  		mov	es,dx
  12.110  		inc	ax
  12.111  		inc	dx
  12.112  		mov	cl,0Fh
  12.113  		mov	si,cx
  12.114 -		mov	di,cx
  12.115 +		and	di,cx
  12.116  		and	si,[word srcofs]
  12.117 -		and	di,[word dstofs]
  12.118  		inc	cx
  12.119                  sub     [word sz],cx
  12.120  		;jae	@@movpara
  12.121 @@ -134,9 +134,10 @@
  12.122  @@movpara:
  12.123              rep movsb
  12.124  		jae	@@movlp
  12.125 +@@pmcopy:
  12.126  		pop	di
  12.127 -		jmp	@@done16
  12.128 -@@pmcopy:
  12.129 +		pop	si
  12.130 +		jc	@@done16
  12.131                  p386
  12.132  		pushad				; struct declared in VCPI.ASM
  12.133                  mov     esi,[srcofs]
  12.134 @@ -146,6 +147,7 @@
  12.135  
  12.136                  mov     ecx,[sz]
  12.137                  jecxz   @@done
  12.138 +                cli
  12.139  
  12.140  		ifdef	VCPI
  12.141  		smsw	ax
  12.142 @@ -158,11 +160,22 @@
  12.143  		jmp	@@done
  12.144  		endif
  12.145  @@real_mode:
  12.146 -                cli
  12.147  oldGDTR		=	(pword srcseg)	; don't need src seg/ofs anymore
  12.148                  sgdt    [oldGDTR]
  12.149  
  12.150  ;****** Load gdtr **********************************************
  12.151 +		ifdef	LARGE_ZIMAGE
  12.152 +		local	rflags: word, rds: word, \
  12.153 +			reax: dword, recx: dword, redx: dword, rebx: dword, \
  12.154 +			resp: dword, rebp: dword, resi: dword, redi: dword, \
  12.155 +			GDTR: pword = LOCAL_SIZE
  12.156 +		mov	eax,cs
  12.157 +		shl	eax,4
  12.158 +		addzx_e	ax,<offset gdt_memcpy>
  12.159 +		push	eax		; gdt_base_memcpy
  12.160 +		push	-1		; gdt_limit
  12.161 +		endif
  12.162 +
  12.163                  lgdt    [GDTR]
  12.164  
  12.165  ;****** Go into pm *********************************************
  12.166 @@ -192,21 +205,16 @@
  12.167  		lcr0	eax
  12.168  ;****** Return *************************************************
  12.169                  lgdt    [oldGDTR]
  12.170 +		ifdef	LARGE_ZIMAGE
  12.171 +		add	sp,6
  12.172 +		endif
  12.173  @@done:
  12.174                  popad
  12.175                  p8086
  12.176  @@done16:
  12.177 -			ifdef	NO386
  12.178 -		pop	si
  12.179 -			endif
  12.180 -                pop     es ds
  12.181 +                pop     ds
  12.182  		popf			; restore I & D
  12.183 -			ifndef	NO386
  12.184 -                p386
  12.185 -		leave
  12.186 -			else
  12.187  		pop	bp
  12.188 -			endif
  12.189                  ret	14
  12.190  
  12.191  ;****** Const data *********************************************
  12.192 @@ -224,16 +232,15 @@
  12.193  		;	base_med  P  S D A  G ??l_hi  base_hi
  12.194  		;	           Pl E W    D
  12.195  		endif
  12.196 +		ifndef	LARGE_ZIMAGE
  12.197  label	GDTR	pword
  12.198  gdt_limit	dw	0ffffh
  12.199  		global	gdt_base_memcpy:word
  12.200  gdt_base_memcpy dw	offset gdt_memcpy,0
  12.201 +		endif
  12.202  
  12.203          endp    memcpy32
  12.204  
  12.205 -		global	movedend:near
  12.206 -movedend:
  12.207 -
  12.208          ends    _TEXT
  12.209  
  12.210          end
    13.1 --- a/linld/stuff/src/MEMTOP.ASM	Wed Apr 07 15:56:56 2021 +0100
    13.2 +++ b/linld/stuff/src/MEMTOP.ASM	Thu Apr 08 09:21:26 2021 +0000
    13.3 @@ -2,7 +2,7 @@
    13.4  ;****** This file is distributed under GPL
    13.5  ;***************************************************************
    13.6                  ideal
    13.7 -		%PAGESIZE 1000
    13.8 +		%PAGESIZE 255
    13.9                  %crefref
   13.10                  %noincl
   13.11                  %nomacs
    14.1 --- a/linld/stuff/src/VCPI.ASM	Wed Apr 07 15:56:56 2021 +0100
    14.2 +++ b/linld/stuff/src/VCPI.ASM	Thu Apr 08 09:21:26 2021 +0000
    14.3 @@ -24,7 +24,7 @@
    14.4  
    14.5  
    14.6                  ideal
    14.7 -		%PAGESIZE 1000
    14.8 +		%PAGESIZE 255
    14.9                  %crefref
   14.10                  %noincl
   14.11                  %nomacs
    15.1 --- a/linld/stuff/src/XMM.ASM	Wed Apr 07 15:56:56 2021 +0100
    15.2 +++ b/linld/stuff/src/XMM.ASM	Thu Apr 08 09:21:26 2021 +0000
    15.3 @@ -2,7 +2,7 @@
    15.4  ;****** This file is distributed under GPL
    15.5  ;***************************************************************
    15.6                  ideal
    15.7 -		%PAGESIZE 1000
    15.8 +		%PAGESIZE 255
    15.9                  %crefref
   15.10                  %noincl
   15.11                  %nomacs
    16.1 --- a/linld/stuff/src/_BEG.ASM	Wed Apr 07 15:56:56 2021 +0100
    16.2 +++ b/linld/stuff/src/_BEG.ASM	Thu Apr 08 09:21:26 2021 +0000
    16.3 @@ -2,7 +2,7 @@
    16.4  ;****** This file is distributed under GPL
    16.5  ;***************************************************************
    16.6                  ideal
    16.7 -		%PAGESIZE 1000
    16.8 +		%PAGESIZE 255
    16.9                  %crefref
   16.10                  %noincl
   16.11                  %nomacs
   16.12 @@ -89,6 +89,8 @@
   16.13  		alloc_image
   16.14  		endif
   16.15  
   16.16 +;BSS_OVERLAP_BOOT	=	1
   16.17 +
   16.18  		ifndef	BSS_OVERLAP_BOOT
   16.19  
   16.20  		ifdef	room_for_isostate
   16.21 @@ -143,10 +145,20 @@
   16.22                  js	endcpu86   	;it is not a 386+, try ELKS & co
   16.23  		endif
   16.24                  p386
   16.25 +		ifdef	VCPI
   16.26                  mov     edx,cs
   16.27                  shl     edx,4		; edx for prepare_vcpi
   16.28 +		else
   16.29 + 		 ifndef	LARGE_ZIMAGE
   16.30 +                mov     edx,cs
   16.31 +                shl     edx,4		; edx for memcpy32
   16.32 +		 endif
   16.33 +		endif
   16.34 +		ifndef	LARGE_ZIMAGE
   16.35  		extrn	gdt_base_memcpy:word	; gdt_base for memcpy32
   16.36  		add	[dword gdt_base_memcpy],edx
   16.37 +		endif
   16.38 +
   16.39  ; Check for vm
   16.40                  smsw    ax      ;SMSW cannot be trapped! :-)
   16.41                  and     al,1	;MSW_PE
   16.42 @@ -260,12 +272,8 @@
   16.43  
   16.44  ;***************************************************************
   16.45  
   16.46 -		org	$-4				; _himem_buf
   16.47 -
   16.48  		ifdef	BSS_OVERLAP_BOOT
   16.49 -		mov	al,0
   16.50 -		mov	di,100h
   16.51 -		mov	cx,offset clean-100h
   16.52 +		mov	di,offset clean-100h
   16.53  
   16.54  		org	$-(CMDNUMCNT*4)			; alloc_cmdnum
   16.55  
   16.56 @@ -283,17 +291,16 @@
   16.57  		endif
   16.58  
   16.59  		alloc_cmdnum
   16.60 +clean:
   16.61 +		mov	[di+0FFh],bh
   16.62 +		dec	di
   16.63 +		jnz	clean
   16.64  		endif
   16.65  
   16.66 +		org	$-4				; _himem_buf
   16.67  		global	_himem_buf:dword
   16.68  _himem_buf	dd	?
   16.69  
   16.70 -		ifdef	BSS_OVERLAP_BOOT
   16.71 -clean:
   16.72 -		rep
   16.73 -		  stosb
   16.74 -		endif
   16.75 -
   16.76  ;***************************************************************
   16.77  		extrn	_bss_end:word
   16.78  		mov	di,offset _bss_end
    17.1 --- a/linld/stuff/src/pipehole.awk	Wed Apr 07 15:56:56 2021 +0100
    17.2 +++ b/linld/stuff/src/pipehole.awk	Thu Apr 08 09:21:26 2021 +0000
    17.3 @@ -7,7 +7,10 @@
    17.4  	if (/^@.*:$/ || /	endp$/) afterjmp=0
    17.5  	if (/^	\.386p$/) is386=1
    17.6  	if (file == "" && /debug	S/) { file=$3; gsub(/\"/,"",file) }
    17.7 -	if (/debug	S/) print "	%PAGESIZE 1000"
    17.8 +	if (/debug	S/) {
    17.9 +		print "	%PAGESIZE 255"
   17.10 +		print "	include	common.inc"
   17.11 +	}
   17.12  	 if (file == "linld.cpp") {
   17.13  	if (/\[si/ || /si,/ || /,si/) sub(/si/,"di")
   17.14  	else if (/\[di/ || /di,/ || /,di/) sub(/di/,"si")
   17.15 @@ -67,7 +70,7 @@
   17.16  	}
   17.17  	if (ishimem == 1) {
   17.18  		if (/do \{/) ishimem=2
   17.19 -		if (/bx,si/ || /push	bp/ || /bp,sp/ || /push	di/ || /push	si/) next
   17.20 +		if (/bx,si/ || /di,ax/ || /push	bp/ || /bp,sp/ || /push	di/ || /push	si/) next
   17.21  		if (/sp,2/ || /bp\+4/) next
   17.22  	}
   17.23  	if (ishimem == 2) {
   17.24 @@ -252,6 +255,16 @@
   17.25  	}
   17.26  	 } # file == "load.cpp"
   17.27  	 if (file == "iso9660.cpp") {
   17.28 +	if (swapsidi == 1) {
   17.29 +		if (/\[si/) sub(/\[si/,"[di")
   17.30 +		else (/\[di/) sub(/\[di/,"[si")
   17.31 +		if (/\+si/) sub(/\+si/,"+di")
   17.32 +		else (/\+di/) sub(/\+di/,"+si")
   17.33 +		if (/,si/) sub(/,si/,",di")
   17.34 +		else if (/,di/) sub(/,di/,",si")
   17.35 +		if (/si,/) sub(/si,/,"di,")
   17.36 +		else if (/di,/) sub(/di,/,"si,")
   17.37 +	}
   17.38  	if (/di,offset DGROUP:_buf2k/) { si="si"; di="di" }
   17.39  	if (/si,offset DGROUP:_buf2k/) { si="di"; di="si" }
   17.40  	if (/leave/ || /enter/ || /bp/ || /sub	sp,/) next
   17.41 @@ -260,22 +273,32 @@
   17.42  	if (/ptr \[.i\+6\],eax/) next
   17.43  	if (/x,word ptr \[.i\+32\]/) next
   17.44  	if (/add	word ptr \[.i\],ax/) sub(/ax/,"cx")
   17.45 -	if (/ax,word ptr \[si\+22\]/) sub(/mov	ax,/,"les	ax,d")
   17.46 -	if (/ax,word ptr \[si\+24\]/) next
   17.47 -	if (/word ptr \[si\+27\],ax/) sub(/ax/,"es")
   17.48 +	if (/ax,word ptr \[si\+18\]/) sub(/mov	ax,/,"les	ax,d")
   17.49 +	if (/ax,word ptr \[si\+20\]/) next
   17.50 +	if (/word ptr \[si\+25\],ax/) sub(/ax/,"es")
   17.51  	sub(/di,word ptr DGROUP:_isostate\+2/,"di,word ptr [si+2]")
   17.52 +	if (/-257/) isiso=22
   17.53 +	if (isiso == 22) {
   17.54 +		sub(/-257/,"-257	; clear C")
   17.55 +		if (/je/) {
   17.56 +			print "	cbw"
   17.57 +			print "	xchg	ax,bx"
   17.58 +			print "	xchg	ax,dx		; .. or ."
   17.59 +			$0="	je	returnC"
   17.60 +		}
   17.61 +	}
   17.62  	if (/p = buf2k \+ 32 \+ x->curpos/) isiso=21
   17.63 -	sub(/-257/,"-257	; clear C")
   17.64  	if (isiso == 21) { # ISO9660.LST
   17.65  		if (/ax,/) next
   17.66 -		if (/si,ax/) {
   17.67 -			print "	add	ax,32"
   17.68 -			$0="	xchg	ax,si"
   17.69 -		}
   17.70 +		if (/.i,ax/) sub(/mov/,"xchg")
   17.71  		if (/# else/) isiso=0
   17.72  	}
   17.73 -	if (/cx,si/) {
   17.74 -		if (isiso == 0) print "	inc	" di
   17.75 +	if (/cx,.i/) {
   17.76 +		if (isiso == 0) {
   17.77 +			print "	ifndef	CLEAN_ISO9660"
   17.78 +			print "	inc	" di
   17.79 +			print "	mov	cx," di
   17.80 +		}
   17.81  		isiso=20
   17.82  	}
   17.83  	if (isiso == 20) { # ISO9660.LST
   17.84 @@ -283,13 +306,33 @@
   17.85  			isiso=12
   17.86  			next
   17.87  		}
   17.88 +		if (/add	.i,ax/ || /cbw/) next
   17.89 +		if (/cmp/) sub(/\[/,"[bx+")
   17.90  		if (/inc	cx/) next
   17.91 -		if (/al,byte ptr/) $0="	;inc	ax"
   17.92 +		if (/sub/) sub(/.i/,"bx")
   17.93 +		sub(/inc	.i/,"inc	bx")
   17.94 +		if (/al,byte ptr/) {
   17.95 +			next
   17.96 +		}
   17.97 +		sub(/i-1\],12603/,"i],12603")
   17.98 +		if (/bx\+.i\],46/) {
   17.99 +			print "	inc	" di
  17.100 +			print "	mov	cx," di
  17.101 +		}
  17.102  		if (/i],0/) {
  17.103 -			sub(/,0/,",ah	; clear C")
  17.104 -			sub(/mov/,"and")
  17.105 +			print "	ifndef	CLEAN_ISO9660"
  17.106 +			print "	inc	" di
  17.107 +			print "	mov	cx," di
  17.108 +			print "	endif"
  17.109 +			print "seteos:"
  17.110 +			sub(/,0/,",bh	; clear C")
  17.111 +			sub(/mov	byte ptr \[/,"and	byte ptr [bx+")
  17.112  		}
  17.113 -		sub(/cx/,"dx")
  17.114 +		if (/cx,.i/) next
  17.115 +		if (/\}/) {
  17.116 +			print "	xchg	ax,cx"
  17.117 +		}
  17.118 +		if (/cx,5/) $0="	lea	dx,[" di "+5]" 
  17.119  		if (/filename = s;/) {
  17.120  			isiso=0
  17.121  		}
  17.122 @@ -297,15 +340,16 @@
  17.123  	if (isiso == 19) { # ISO9660.LST
  17.124  		if (/short @2@310/) $0="	jc	restoreC"
  17.125  		if (/si\+32/ || /ax,dx/ || /ax,di/ || /cmp	ax,-1/ || /sub	ax,/) next
  17.126 -		sub(/dx,/,"ax,")
  17.127 -		if (/ax,word ptr \[si\+18\]/) sub(/ax/,"bx")
  17.128 +		if (/ax,word ptr \[si\+28\]/) next
  17.129  		if (/bx,offset/) sub(/bx/,"ax")
  17.130 +		sub(/dx,/,"bx,")
  17.131  		if (/short @2@282/) sub(/je/,"jnc")
  17.132 -		if (/\[si\+35\],0/) sub(/,0/,",ch")
  17.133 +		if (/\[si\+30\],0/) $0="	;or	cl,cl"
  17.134 +		if (/short @2@478/) sub(/je/,"jcxz")
  17.135  		if (/@strcmp\$qpxzct1/) {
  17.136  			print
  17.137  			print "restoreC:"
  17.138 -			$0="	mov	byte ptr [di],cl	; c"
  17.139 +			$0="	mov	byte ptr [di],dl	; c"
  17.140  			isiso=1
  17.141  		}
  17.142  	}
  17.143 @@ -313,9 +357,9 @@
  17.144  		if (/endif/) isiso=1
  17.145  	}
  17.146  	if (isiso == 17) { # ISO9660.LST
  17.147 -		if (/si\+22/) {
  17.148 +		if (/si\+18/) {
  17.149  			print "next:"
  17.150 -			print "	mov	word ptr [si+24],bx"
  17.151 +			print "	mov	word ptr [si+20],bx"
  17.152  			print
  17.153  			isiso=0
  17.154  		}	
  17.155 @@ -339,7 +383,7 @@
  17.156  		if (/cmp/) {
  17.157  			print "	mov	bx,word ptr [si+7]"
  17.158  			print "	mov	ax,word ptr [si+11]"
  17.159 -			print "	dec	cx"
  17.160 +			print "	dec	dx"
  17.161  			print "	jns	next"
  17.162  		}
  17.163  		if (/isolseek/) isiso=1
  17.164 @@ -350,11 +394,16 @@
  17.165  	if (isiso == 15) { # ISO9660.LST
  17.166  		if (/xor/) {
  17.167  			print	"returnC:"
  17.168 -			print	"	sbb	ax,ax"
  17.169 +			print	"	sbb	dx,dx"
  17.170  			print	"return:"
  17.171  			next
  17.172  		}
  17.173 -		if (/i\+18\],cx/) sub(/cx/,"dx")
  17.174 +		if (/i\+28\],cx/) {
  17.175 +			print	"	ifndef BASIC_ISO9660"
  17.176 +			print	"	xchg	ax,dx"
  17.177 +			print	"	endif"
  17.178 +			next
  17.179 +		}
  17.180  		if (/@1@422:/) next
  17.181  		if (/\[di\],47/) isiso=17
  17.182  	}
  17.183 @@ -371,10 +420,10 @@
  17.184  	}
  17.185  	if (/p = buf2k \+ 34/) isiso=13
  17.186  	if (isiso == 13) { # ISO9660.LST
  17.187 -		if (/cbw/) $0="	;cbw"
  17.188 +		#if (/cbw/) $0="	;cbw"
  17.189  		if (/i,.i/) $0="	xchg	ax,bx"
  17.190  		if (/i,ax/) $0="	xchg	ax," di 
  17.191 -		if (/i,70/ || /word ptr \[.i\+32\]/) next
  17.192 +		if (/i,70/ || /ptr \[.i\+32\]/) next
  17.193  		if (/register len/) {
  17.194  			isiso=12
  17.195  		}
  17.196 @@ -382,16 +431,28 @@
  17.197  	if (isiso == 12) { # ISO9660.LST
  17.198  		if (/.i\+2/) sub(/al/,"bl")
  17.199  		if (/cbw/) next
  17.200 -		sub(/dx,ax/,"bh,0")
  17.201 +		if (/dx,ax/) next
  17.202  		if (/bx,dx/) next
  17.203  		sub(/i,dx/,"i,bx")
  17.204  		sub(/cx,/,"dx,")
  17.205 -		if (/bx\+.i\],0/) sub(/,0/,",bh")
  17.206 +		if (/bx\+.i\],0/) {
  17.207 +			sub(/,0/,",bh")
  17.208 +		}
  17.209 +		if (/jmp/) {
  17.210 +			print
  17.211 +			$0="	endif"
  17.212 +		}
  17.213 +		if (/jne/) {
  17.214 +			print "	ifdef	BASIC_ISO9660"
  17.215 +			print "	lea	cx,[" di "+5]" 
  17.216 +			print "	je	seteos"
  17.217 +			print "	else"
  17.218 +		}
  17.219  		if (/while/) isiso=120
  17.220  	}
  17.221  	if (isiso == 120) { # ISO9660.LST
  17.222 -		sub(/ax/,"bx")
  17.223 -		if (/cmp	bx,/) $0="	cmp	" di ",bx"
  17.224 +		sub(/ax/,"cx")
  17.225 +		if (/cmp	cx,/) $0="	cmp	" di ",cx"
  17.226  		sub(/jae/,"jb")
  17.227  		if (/endif/) isiso=0
  17.228  	}
  17.229 @@ -421,11 +482,37 @@
  17.230  	}
  17.231  	if (/filesize =/) isiso=8
  17.232  	if (isiso == 8) { # ISO9660.LST
  17.233 -		if (/ax,/) next
  17.234 +		if (/ax,/ || /cbw/) next
  17.235  		sub(/mov	dx,/,"les	dx,d")
  17.236  		sub(/\],ax/,"],es")
  17.237  		sub(/cx,/,"dx,")
  17.238 -		if (/sub/) isiso=0
  17.239 +		if (/DGROUP:s@\+/) {
  17.240 +			print
  17.241 +			next
  17.242 +		}
  17.243 +		if (/i\+33]/) {
  17.244 +			print "	ifdef	ROCKRIDGE"
  17.245 +			print "	 ifdef	BASIC_ISO9660"
  17.246 +			print "	add	" di ",32"
  17.247 +			print "	mov	ax,[" di "]"
  17.248 +			print "	 else"
  17.249 +			print "	mov	ax,[" di "+32]"
  17.250 +			print "	 endif"
  17.251 +			print "	mov	bl,ah"
  17.252 +			print "	mov	bh,0"
  17.253 +			print "	else"
  17.254 +			print "	mov	al,[" di "+33]"
  17.255 +			print "	cbw"
  17.256 +			$0="	endif"
  17.257 +		}
  17.258 +		if (/sub/) {
  17.259 +			print "	ifdef	ROCKRIDGE"
  17.260 +			print "	sub	dx,bx"
  17.261 +			print "	else"
  17.262 +			print 
  17.263 +			$0="	endif"
  17.264 +			isiso=0
  17.265 +		}
  17.266  	}
  17.267  	if (/entrysize =/) isiso=5
  17.268  	if (isiso == 5) { # ISO9660.LST
  17.269 @@ -454,17 +541,31 @@
  17.270  		sub(/cmp	byte ptr \[.i\]/,"sub	al")
  17.271  		if (/inc	/) { r=$2; print; next }
  17.272  		if (/al,0/) print "	mov	al,[" r "]"
  17.273 +		if (/word ptr \[si\],-1/) $0="	not	word ptr [si]	; zero'd in BSS"
  17.274 +		sub(/al,32/,"ax,32")
  17.275 +		if (/byte ptr \[si\+30\],al/) $0="	xchg	ax,cx"
  17.276  		if (/al,byte ptr \[/) next
  17.277  		if (/byte ptr \[.*\],0/) next
  17.278  		if (/byte ptr \[si\+31\],al/) next
  17.279  	}
  17.280 -	if (/ptr .isoreaddir/) isiso=1
  17.281 +	if (/ptr .isoreaddir/) {
  17.282 +		print "	ifdef	ISOHOOK"
  17.283 +		print "	push	cx"
  17.284 +		print
  17.285 +		print "	pop	cx"
  17.286 +		print "	else"
  17.287 +		print
  17.288 +		$0="	endif"
  17.289 +		isiso=1
  17.290 +	}
  17.291  	if (isiso == 1) { # ISO9660.LST
  17.292 -		if (/xor/) isiso=18
  17.293 +		if (/xor/) {
  17.294 +			$0="	xor	cl,32"
  17.295 +			isiso=18
  17.296 +		}
  17.297  		if (/n = name;/) {
  17.298  			isiso=19
  17.299 -			print "	xchg	ax,cx"
  17.300 -			print "	xchg	cl,byte ptr [di]	; c"
  17.301 +			print "	xchg	dl,byte ptr [di]	; c"
  17.302  		}
  17.303  		sub(/jne/,"jnc")
  17.304  		if (/short @2@450/) $0="	jc	returnC"
  17.305 @@ -479,7 +580,12 @@
  17.306  		if (/@2@142$/) print "	inc	di"
  17.307  	}
  17.308  	if (/i\+34\]/) next
  17.309 -	sub(/di,offset DGROUP:_isostate/,"di,si")
  17.310 +	if (/di,offset DGROUP:_isostate/) {
  17.311 +		sub(/mov/,";mov")
  17.312 +		sub(/di,/,"si,")
  17.313 +		swapsidi=1
  17.314 +	}
  17.315 +	if (/^	ret/) swapsidi=0
  17.316  	 } # file == "iso9660.cpp"
  17.317  	if (wascall) {
  17.318  		if (rcall != "") {
    18.1 --- a/lz4/receipt	Wed Apr 07 15:56:56 2021 +0100
    18.2 +++ b/lz4/receipt	Thu Apr 08 09:21:26 2021 +0000
    18.3 @@ -16,7 +16,7 @@
    18.4  current_version()
    18.5  {
    18.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    18.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
    18.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
    18.9  }
   18.10  
   18.11  # Rules to configure and make the package.
    19.1 --- a/lzham_codec/receipt	Wed Apr 07 15:56:56 2021 +0100
    19.2 +++ b/lzham_codec/receipt	Thu Apr 08 09:21:26 2021 +0000
    19.3 @@ -17,7 +17,7 @@
    19.4  current_version()
    19.5  {
    19.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    19.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
    19.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
    19.9  }
   19.10  
   19.11  # Rules to configure and make the package.
    20.1 --- a/nwipe/receipt	Wed Apr 07 15:56:56 2021 +0100
    20.2 +++ b/nwipe/receipt	Thu Apr 08 09:21:26 2021 +0000
    20.3 @@ -16,7 +16,7 @@
    20.4  current_version()
    20.5  {
    20.6  	wget -O - $WEB_SITE/releases 2>/dev/null | \
    20.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
    20.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
    20.9  }
   20.10  
   20.11  # Rules to configure and make the package.
    21.1 --- a/openssh-pam/receipt	Wed Apr 07 15:56:56 2021 +0100
    21.2 +++ b/openssh-pam/receipt	Thu Apr 08 09:21:26 2021 +0000
    21.3 @@ -1,7 +1,7 @@
    21.4  # SliTaz package receipt.
    21.5  
    21.6  PACKAGE="openssh-pam"
    21.7 -VERSION="8.4p1"
    21.8 +VERSION="8.5p1"
    21.9  CATEGORY="security"
   21.10  SHORT_DESC="Openbsd Secure Shell using PAM."
   21.11  MAINTAINER="pascal.bellard@slitaz.org"
    22.1 --- a/openssh/receipt	Wed Apr 07 15:56:56 2021 +0100
    22.2 +++ b/openssh/receipt	Thu Apr 08 09:21:26 2021 +0000
    22.3 @@ -1,7 +1,7 @@
    22.4  # SliTaz package receipt.
    22.5  
    22.6  PACKAGE="openssh"
    22.7 -VERSION="8.4p1"
    22.8 +VERSION="8.5p1"
    22.9  CATEGORY="security"
   22.10  SHORT_DESC="Openbsd Secure Shell."
   22.11  MAINTAINER="pascal.bellard@slitaz.org"
    23.1 --- a/radare2/receipt	Wed Apr 07 15:56:56 2021 +0100
    23.2 +++ b/radare2/receipt	Thu Apr 08 09:21:26 2021 +0000
    23.3 @@ -13,7 +13,7 @@
    23.4  current_version()
    23.5  {
    23.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    23.7 -	sed '/archive.[0-9].*tar/!d;s|.*archive/\(.*\).tar.*|\1|;q'
    23.8 +	sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
    23.9  }
   23.10  
   23.11  # Rules to configure and make the package.
    24.1 --- a/sftp-server/receipt	Wed Apr 07 15:56:56 2021 +0100
    24.2 +++ b/sftp-server/receipt	Thu Apr 08 09:21:26 2021 +0000
    24.3 @@ -1,7 +1,7 @@
    24.4  # SliTaz package receipt.
    24.5  
    24.6  PACKAGE="sftp-server"
    24.7 -VERSION="8.4p1"
    24.8 +VERSION="8.5p1"
    24.9  CATEGORY="security"
   24.10  TAGS="ssh"
   24.11  SHORT_DESC="Openbsd Secure FTP server."
    25.1 --- a/sslh/receipt	Wed Apr 07 15:56:56 2021 +0100
    25.2 +++ b/sslh/receipt	Thu Apr 08 09:21:26 2021 +0000
    25.3 @@ -16,6 +16,12 @@
    25.4  BUILD_DEPENDS="libwrap-dev libwrap libconfig-dev libcap-dev"
    25.5  SUGGESTED="iptables"
    25.6  
    25.7 +current_version()
    25.8 +{
    25.9 +	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
   25.10 +	sed '/tags.*tar/!d;s|.*tags/v\(.*\).tar.*|\1|;q'
   25.11 +}
   25.12 +
   25.13  # Rules to configure and make the package.
   25.14  compile_rules()
   25.15  {
    26.1 --- a/upx/receipt	Wed Apr 07 15:56:56 2021 +0100
    26.2 +++ b/upx/receipt	Thu Apr 08 09:21:26 2021 +0000
    26.3 @@ -18,7 +18,7 @@
    26.4  current_version()
    26.5  {
    26.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    26.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
    26.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
    26.9  }
   26.10  
   26.11  # Rules to configure and make the package.
    27.1 --- a/zstd/receipt	Wed Apr 07 15:56:56 2021 +0100
    27.2 +++ b/zstd/receipt	Thu Apr 08 09:21:26 2021 +0000
    27.3 @@ -18,7 +18,7 @@
    27.4  current_version()
    27.5  {
    27.6  	wget -O - ${WGET_URL%/arch*}/releases 2>/dev/null | \
    27.7 -	sed '/archive.*tar/!d;s|.*archive/v\(.*\).tar.*|\1|;q'
    27.8 +	sed '/archive.*tar/!d;s|.*/v\(.*\).tar.*|\1|;q'
    27.9  }
   27.10  
   27.11  # Rules to configure and make the package.