wok rev 25516

memtest64: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 19 11:36:17 2023 +0000 (21 months ago)
parents 8acc87b18a99
children 5cb11e361a0a
files memtest64/receipt memtest64/stuff/unpackx.S
line diff
     1.1 --- a/memtest64/receipt	Sun Feb 19 09:52:04 2023 +0000
     1.2 +++ b/memtest64/receipt	Sun Feb 19 11:36:17 2023 +0000
     1.3 @@ -10,6 +10,8 @@
     1.4  WEB_SITE="https://www.memtest.org/"	# https://github.com/memtest86plus/memtest86plus/
     1.5  WGET_URL="https://memtest.org/download/v$VERSION/mt86plus_${VERSION}.binaries.zip"
     1.6  
     1.7 +BUILD_DEPENDS="xz lz4 lzsa"
     1.8 +
     1.9  # What is the latest version available today?
    1.10  current_version()
    1.11  {
     2.1 --- a/memtest64/stuff/unpackx.S	Sun Feb 19 09:52:04 2023 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,323 +0,0 @@
     2.4 -#define SYSTEM		0x10000
     2.5 -#define SETUP		14
     2.6 -#define SYSSIZE		0x1F4
     2.7 -#define SETUPSIZE	0x1F1
     2.8 -
     2.9 -#define KEEP_BOOTSECTOR		0
    2.10 -#define LINUX_HEADER		0
    2.11 -#define UPDATE_SYSSIZE		1
    2.12 -#define FLAT16			1	// lzma case
    2.13 -#define FLAT16OUT		0
    2.14 -#define COPYTOHIGHMEM		0
    2.15 -#define UPDATE_CODE32_START	0
    2.16 -#define DOUBLE_PACKED		0
    2.17 -#define SAVEREGS		0 
    2.18 -#define ELKS			0
    2.19 -
    2.20 -	.text
    2.21 -	.code16
    2.22 -	.org	0
    2.23 -
    2.24 -#if KEEP_BOOTSECTOR
    2.25 -#undef UPDATE_SYSSIZE
    2.26 -#define UPDATE_SYSSIZE		0
    2.27 -#endif
    2.28 -#if ELKS
    2.29 -	.arch	i8086
    2.30 -#define FLAT16			1
    2.31 -#define KEEP_BOOTSECTOR		1
    2.32 -#define LINUX_HEADER		0
    2.33 -#define SAVEREGS		0 
    2.34 -#define TOPSEG		0x2000
    2.35 -#else
    2.36 -#define TOPSEG		0x8000
    2.37 -#endif
    2.38 -
    2.39 -.macro	pusham
    2.40 -#if ELKS
    2.41 -	pushw	%ax
    2.42 -//	movw	%sp, %ax
    2.43 -//	incw	%ax		// emulate popa behaviour
    2.44 -//	incw	%ax
    2.45 -	pushw	%cx
    2.46 -	pushw	%dx
    2.47 -	pushw	%bx
    2.48 -//	pushw	%ax		// %sp
    2.49 -	pushw	%bp
    2.50 -	pushw	%si
    2.51 -	pushw	%di
    2.52 -#else
    2.53 -	pushaw
    2.54 -#endif
    2.55 -.endm 
    2.56 -
    2.57 -.macro	popam
    2.58 -#if ELKS
    2.59 -	popw	%di
    2.60 -	popw	%si
    2.61 -	popw	%bp
    2.62 -//	popw	%ax
    2.63 -	popw	%bx
    2.64 -	popw	%dx
    2.65 -	popw	%cx
    2.66 -	popw	%ax
    2.67 -#else
    2.68 -	popaw
    2.69 -#endif
    2.70 -.endm 
    2.71 -
    2.72 -.macro	pushm	val
    2.73 -#if ELKS
    2.74 -	movw	\val, %ax
    2.75 -	pushw	%ax
    2.76 -#else
    2.77 -	pushw	\val
    2.78 -#endif
    2.79 -.endm 
    2.80 -
    2.81 -.macro	shrwm	cnt, reg
    2.82 -#if ELKS
    2.83 -	.rept	\cnt
    2.84 -	shrw	$1, \reg
    2.85 -	.endr
    2.86 -#else
    2.87 -	shrw	$\cnt, \reg
    2.88 -#endif
    2.89 -.endm
    2.90 -
    2.91 -	.globl	_start
    2.92 -_start:
    2.93 -#if LINUX_HEADER
    2.94 -	jmp	start2
    2.95 -	.ascii	"HdrS"		// 202 magic
    2.96 -	.word	0x200		// 206 version 2.00
    2.97 -	.long	0		// 208 realmode_swtch
    2.98 -	.word	SYSTEM/16	// 20C start_sys_seg
    2.99 -	.word	0		// 20E kernel_version
   2.100 -	.byte	0		// 210 type_of_loader
   2.101 -	.byte	0		// 211 loadflags
   2.102 -	.word	0		// 212 setup_move_size
   2.103 -	.long	SYSTEM		// 214 code32_start
   2.104 -	.long	0		// 218 ramdisk_image
   2.105 -	.long	0		// 21C ramdisk_size
   2.106 -	.long	0		// 220 bootsect_kludge
   2.107 -start2:
   2.108 -#endif
   2.109 -#if SAVEREGS
   2.110 -	pushfw
   2.111 -	pushw	%cs
   2.112 -	pushw	$0
   2.113 -	pusham
   2.114 -	xorw	%si, %si
   2.115 -	pushw	%ds
   2.116 -	pushw	%es
   2.117 -	cld
   2.118 -#else
   2.119 -	pushw	%cs			// return adress is %cs:0
   2.120 -	xorw	%si, %si
   2.121 -	pushw	%si
   2.122 -#endif	// SAVEREGS
   2.123 -	pushw	%ds			// <A> bootsector+setup segment
   2.124 -#if FLAT16
   2.125 -# 1- move 9000..9020+stp -> TOPSEG
   2.126 -	pushm	$TOPSEG
   2.127 -	popw	%es
   2.128 -# if SAVEREGS
   2.129 -setup_word:
   2.130 -	movw	$SETUP*256+256, %cx
   2.131 -	pushw	%cx			// <B> bootsector+setup words
   2.132 -# endif
   2.133 -	pushw	%es			// <C> TOPSEG
   2.134 -	pushw	%es
   2.135 -# if SAVEREGS
   2.136 -	xorw	%di, %di		// %ds:%si = 9000:0000		%es:%di = TOPSEG:0
   2.137 -	pushm	$0x200+cont
   2.138 -	rep
   2.139 -	  movsw
   2.140 -	lret
   2.141 -cont:
   2.142 -# else
   2.143 -	movw	$-0x200, %di
   2.144 -	call	jumpinto
   2.145 -# endif
   2.146 -# 2- move 1000..1000+sys -> TOPSEG+stp
   2.147 -	pushm	$0x1000
   2.148 -	popw	%ds
   2.149 -	xorw	%si, %si		// %ds:%si = 1000:0
   2.150 -	subw	%di, %cx		// %cx = 64K - setupsz
   2.151 -	rep
   2.152 -	  movsb
   2.153 -# 3- unlz(TOPSEG+stp:end, 1000-stp:0)
   2.154 -setup_seg:
   2.155 -	pushm	$0x1000-(SETUP*32)-32
   2.156 -	popw	%es
   2.157 -#else		// FLAT16
   2.158 -# 1- move 9020..9020+unpack -> 0700 and jump into
   2.159 -	movw	$0x700, %cx		// Up to 3.5KB for unpacker (unlzma is << 1KB)
   2.160 -	movw	%cx, %es		// Use 7000 .. 7E00, keep up to 23 elks setup sectors
   2.161 -	pushw	%es
   2.162 -	xorw	%di, %di		// %ds:%si = 9000:0000	%es:%di = 0700:0000
   2.163 -	pushm	$0x200+cont
   2.164 -# if SAVEREGS
   2.165 -	rep
   2.166 -	  movsw
   2.167 -	lret
   2.168 -# else
   2.169 -	jmp	jumpinto
   2.170 -# endif
   2.171 -cont:
   2.172 -# 2- move 9020..9020+stp -> 9000-sys-stp
   2.173 -	movw	%ds, %dx
   2.174 -setup_byte:
   2.175 -	movb	$SETUP+1, %ch
   2.176 -setup_para:
   2.177 -	subw	$SETUP*32+32+0xF000, %dx
   2.178 -packed_syssize:
   2.179 -	movw	$0+0x1000, %ax
   2.180 -	pushw	%cx			// <B> bootsector+setup words
   2.181 -	subw	%ax, %dx
   2.182 -	movw	%dx, %es
   2.183 -	pushw	%es			// <C> 9000-sys-stp
   2.184 -	xorw	%si, %si
   2.185 -	xorw	%di, %di		// %ds:%si = 9000:0	%es:%di = 9000-sys-stp:0
   2.186 -	rep
   2.187 -	  movsw
   2.188 -# 3- move 1000..1000+sys -> 9000-sys
   2.189 -	movw	%ds, %dx
   2.190 -mvsys:
   2.191 -	decw	%ax
   2.192 -	decw	%dx
   2.193 -	movw	%ax, %ds
   2.194 -	movw	%dx, %es
   2.195 -	xorw	%si, %si
   2.196 -	xorw	%di, %di
   2.197 -	movw	$8, %cx
   2.198 -	rep
   2.199 -	  movsw
   2.200 -	cmpw	$0x1000, %ax
   2.201 -	jne	mvsys
   2.202 -# 4- unlz(9000-sys-stp:end, 1000-stp:0)
   2.203 -setup_seg:
   2.204 -	pushm	$0x1000-(SETUP*32)-32
   2.205 -	popw	%es
   2.206 -#endif		// FLAT16
   2.207 -	popw	%ds			// <C>
   2.208 -#if FLAT16 && SAVEREGS == 0
   2.209 -	movw	$end-_start, %si	// %ds:%si = TOPSSEG:compressed
   2.210 -#else
   2.211 -	movw	$0x200+end-_start, %si	// %ds:%si = 9000-sys-stp:compressed
   2.212 -#endif
   2.213 -#if KEEP_BOOTSECTOR
   2.214 -setup_keep:
   2.215 -	xorw	%di, %di
   2.216 -#else
   2.217 -# if UPDATE_SYSSIZE
   2.218 -setup_syssize:
   2.219 -	movw	$0x1F4, %di		// %es:%di = 1000-setup-bootsector:SYSSIZE
   2.220 -# else
   2.221 -	movw	$0x200, %di
   2.222 -# endif
   2.223 -#endif
   2.224 -	pushw	%di
   2.225 -	pushw	%es
   2.226 -#if DOUBLE_PACKED
   2.227 -double_packed:
   2.228 -	pushm	$0x4000
   2.229 -	popw	%es
   2.230 -	pushw	%di
   2.231 -	pushw	%es
   2.232 -	call	unpack
   2.233 -	popw	%ds
   2.234 -	popw	%si
   2.235 -	popw	%es
   2.236 -	popw	%di
   2.237 -	pushw	%di
   2.238 -	pushw	%es
   2.239 -#endif
   2.240 -	call	unpack
   2.241 -#if COPYTOHIGHMEM
   2.242 -# if FLAT16OUT
   2.243 -	movw	$0x9310+1, %ax		// from 1000:FFFF
   2.244 -# else
   2.245 -#  if 0
   2.246 -	movw	%es, %ax
   2.247 -	shrw	$12, %ax
   2.248 -	orw	$0x9310, %ax
   2.249 -#  else
   2.250 -	movw	$0x9310+7, %ax		// from 7000:FFFF
   2.251 -#  endif
   2.252 -# endif
   2.253 -	pushw	%ss
   2.254 -	popw	%es
   2.255 -	movw	$8, %cx
   2.256 -zero1:
   2.257 -	pushw	$0			// 2E..20
   2.258 -	loop	zero1
   2.259 -src:		
   2.260 -	pushw	%cx			// 1E, 16
   2.261 -	pushw	%ax			// 1A: dst %ax:%cx, 12: src %ax:%cx
   2.262 -	pushw	%cx
   2.263 -	pushw	$-1			// 18, 10: full 64K segment
   2.264 -	subb	$0x10, %al
   2.265 -	jnc	src
   2.266 -	movb	$8, %cl
   2.267 -zero2:
   2.268 -	pushw	$0			// 0E..00
   2.269 -	loop	zero2
   2.270 -	movw	%sp, %si
   2.271 -syslp:
   2.272 -	movb	$0x80, %ch	
   2.273 -	movb	$0x87, %ah
   2.274 -	int	$0x15
   2.275 -# if FLAT16OUT == 0
   2.276 -	decb	%es:0x1C(%si)
   2.277 -	decb	%es:0x14(%si)
   2.278 -	jne	syslp			// down to 1000:0000
   2.279 -# endif
   2.280 -	addw	$0x30, %sp
   2.281 -#endif	// COPYTOHIGHMEM
   2.282 -	popw	%ds
   2.283 -	popw	%si			// %ds:%si = 1000-setup-bootsector:SYSSIZE / 0
   2.284 -#if UPDATE_CODE32_START
   2.285 -update_code32_start:
   2.286 -//	movb	$1, 0x216
   2.287 -#endif
   2.288 -#if FLAT16 == 0 || SAVEREGS
   2.289 -	popw	%cx			// <B> bootsector+setup words
   2.290 -#endif
   2.291 -	popw	%es			// <A> bootsector+setup segment
   2.292 -	movw	%si, %di
   2.293 -jumpinto:
   2.294 -#if FLAT16 && SAVEREGS == 0
   2.295 -setup_word:
   2.296 -	movw	$SETUP*256+256, %cx
   2.297 -#endif
   2.298 -# 5- move 1000-stp..1000 -> 9000
   2.299 -	rep
   2.300 -	  movsw
   2.301 -#if SAVEREGS
   2.302 -	popw	%es
   2.303 -	popw	%ds
   2.304 -	popam
   2.305 -	iret
   2.306 -#else
   2.307 -	lret
   2.308 -#endif
   2.309 -
   2.310 -unpack:
   2.311 -#define NO_LZMA_HEADER
   2.312 -#define NO_LZSA2_HEADER
   2.313 -#define NO_LZSA1_HEADER
   2.314 -#define NO_LZ4_HEADER
   2.315 -#if ELKS
   2.316 -#define ONLY8086	1
   2.317 -#endif
   2.318 -#if defined(FLAT16OUT) && FLAT16OUT == 0
   2.319 -#undef FLAT16OUT
   2.320 -#endif
   2.321 -#if defined(FLAT16) && FLAT16 == 0
   2.322 -#undef FLAT16
   2.323 -#endif
   2.324 -#include "uncompress.S"
   2.325 -
   2.326 -end: