wok rev 25504

Update some web_site / wget_url
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 05 09:28:51 2023 +0000 (21 months ago)
parents 9fdfc7625dd7
children 20c2ee666646
files adobe-air-sdk/receipt aurorials-theme/receipt btmgr/receipt chocolate-doom/receipt decibel/receipt libav-dev/receipt libav/receipt liblouis-dev/receipt liblouis/receipt libunixODBC/receipt madeirado-theme/receipt memtest/receipt memtest/stuff/pack memtest/stuff/unlz4.S memtest/stuff/unlzsa1.S memtest/stuff/unlzsa2.S memtest/stuff/unpack.S picoblog/receipt pkcs/receipt plop/receipt plop/stuff/pack plop/stuff/unlz4.S plop/stuff/unlzsa1.S plop/stuff/unlzsa2.S plop/stuff/unpack.S polkit-pam/receipt unixODBC-dev/receipt unixODBC/receipt vpnc-cert/receipt vpnc/receipt zonecheck/receipt
line diff
     1.1 --- a/adobe-air-sdk/receipt	Fri Jan 27 10:37:43 2023 +0100
     1.2 +++ b/adobe-air-sdk/receipt	Sun Feb 05 09:28:51 2023 +0000
     1.3 @@ -8,7 +8,7 @@
     1.4  LICENSE="custom"
     1.5  WEB_SITE="https://get.adobe.com/air"
     1.6  TARBALL="$PACKAGE-$VERSION.tar.bz2"
     1.7 -WGET_URL="http://airdownload.adobe.com/air/lin/download/$VERSION/AdobeAIRSDK.tbz2"
     1.8 +WGET_URL="https://airdownload.adobe.com/air/lin/download/$VERSION/AdobeAIRSDK.tbz2"
     1.9  
    1.10  DEPENDS="nss gtk+ libxslt"
    1.11  
     2.1 --- a/aurorials-theme/receipt	Fri Jan 27 10:37:43 2023 +0100
     2.2 +++ b/aurorials-theme/receipt	Sun Feb 05 09:28:51 2023 +0000
     2.3 @@ -8,7 +8,7 @@
     2.4  LICENSE="GPL3"
     2.5  WEB_SITE="http://holkfoor.deviantart.com/art/Aurorials-pack-themes-382752941"
     2.6  TARBALL="$PACKAGE-$VERSION.tar.bz2"
     2.7 -WGET_URL="https://dl.dropboxusercontent.com/s/urt40kxaladwpeu/Aurorials_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
     2.8 +WGET_URL="https://web.archive.org/web/20230120115700/https://dl.dropboxusercontent.com/s/urt40kxaladwpeu/Aurorials_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
     2.9  TAGS="holkfoor openbox slim wallpaper"
    2.10  HOST_ARCH="any"
    2.11  
     3.1 --- a/btmgr/receipt	Fri Jan 27 10:37:43 2023 +0100
     3.2 +++ b/btmgr/receipt	Sun Feb 05 09:28:51 2023 +0000
     3.3 @@ -8,7 +8,7 @@
     3.4  LICENSE="GPL2"
     3.5  TARBALL="$PACKAGE-$VERSION.tar.gz"
     3.6  WEB_SITE="https://$PACKAGE.sourceforge.net/about.html"
     3.7 -WGET_URL="http://$PACKAGE.sourceforge.net/${VERSION%-*}/$TARBALL"
     3.8 +WGET_URL="https://$PACKAGE.sourceforge.net/${VERSION%-*}/$TARBALL"
     3.9  TAGS="boot loader floppy CD"
    3.10  
    3.11  # What is the latest version available today?
     4.1 --- a/chocolate-doom/receipt	Fri Jan 27 10:37:43 2023 +0100
     4.2 +++ b/chocolate-doom/receipt	Sun Feb 05 09:28:51 2023 +0000
     4.3 @@ -6,10 +6,10 @@
     4.4  SHORT_DESC="Doom source port as close as possible to vanilla Doom."
     4.5  MAINTAINER="pascal.bellard@slitaz.org"
     4.6  LICENSE="GPL2"
     4.7 -WEB_SITE="https://chocolate-doom.org/wiki/index.php/Chocolate_Doom"
     4.8 +WEB_SITE="https://www.chocolate-doom.org/wiki/index.php/Chocolate_Doom"
     4.9  
    4.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
    4.11 -WGET_URL="https://chocolate-doom.org/downloads/$VERSION/$TARBALL"
    4.12 +WGET_URL="https://wwww.chocolate-doom.org/downloads/$VERSION/$TARBALL"
    4.13  
    4.14  DEPENDS="libsamplerate libsdl2 libsdl2-mixer libsdl2-net"
    4.15  BUILD_DEPENDS="libsdl2-dev libsdl2-mixer-dev  libsdl2-net-dev"
     5.1 --- a/decibel/receipt	Fri Jan 27 10:37:43 2023 +0100
     5.2 +++ b/decibel/receipt	Sun Feb 05 09:28:51 2023 +0000
     5.3 @@ -10,7 +10,7 @@
     5.4  
     5.5  SOURCE="$PACKAGE-audio-player"
     5.6  TARBALL="$SOURCE-$VERSION.tar.gz"
     5.7 -WGET_URL="${WEB_SITE}uploads/Main/$TARBALL"
     5.8 +WGET_URL="$WEB_SITE/uploads/Main/$TARBALL"
     5.9  
    5.10  DEPENDS="dbus-python gst-python mutagen notify-python pygtk python"
    5.11  BUILD_DEPENDS="findutils gettext"
     6.1 --- a/libav-dev/receipt	Fri Jan 27 10:37:43 2023 +0100
     6.2 +++ b/libav-dev/receipt	Sun Feb 05 09:28:51 2023 +0000
     6.3 @@ -6,7 +6,7 @@
     6.4  SHORT_DESC="Development files for libav."
     6.5  MAINTAINER="al.bobylev@gmail.com"
     6.6  LICENSE="GPL2 GPL3 LGPL2.1 LGPL3"
     6.7 -WEB_SITE="https://www.libav.org/"
     6.8 +WEB_SITE="https://web.archive.org/web/20221220014926/https://www.libav.org/"
     6.9  
    6.10  DEPENDS="libav pkg-config"
    6.11  WANTED="libav"
     7.1 --- a/libav/receipt	Fri Jan 27 10:37:43 2023 +0100
     7.2 +++ b/libav/receipt	Sun Feb 05 09:28:51 2023 +0000
     7.3 @@ -6,7 +6,7 @@
     7.4  SHORT_DESC="Audio and video conversion library."
     7.5  MAINTAINER="al.bobylev@gmail.com"
     7.6  LICENSE="GPL2 GPL3 LGPL2.1 LGPL3"
     7.7 -WEB_SITE="https://www.libav.org/"
     7.8 +WEB_SITE="https://web.archive.org/web/20221220014926/https://www.libav.org/"
     7.9  
    7.10  #TARBALL="$PACKAGE-$VERSION.tar.bz2"
    7.11  #WGET_URL="git|git://github.com/andoma/libav.git"
     8.1 --- a/liblouis-dev/receipt	Fri Jan 27 10:37:43 2023 +0100
     8.2 +++ b/liblouis-dev/receipt	Sun Feb 05 09:28:51 2023 +0000
     8.3 @@ -6,7 +6,7 @@
     8.4  LICENSE="GPL3"
     8.5  SHORT_DESC="Open-source braille translator and back-translator, development files."
     8.6  MAINTAINER="yuripourre@gmail.com"
     8.7 -WEB_SITE="http://liblouis.org/"
     8.8 +WEB_SITE="https://web.archive.org/web/20221220101611/http://liblouis.org/"
     8.9  
    8.10  DEPENDS="liblouis pkg-config"
    8.11  WANTED="liblouis"
     9.1 --- a/liblouis/receipt	Fri Jan 27 10:37:43 2023 +0100
     9.2 +++ b/liblouis/receipt	Sun Feb 05 09:28:51 2023 +0000
     9.3 @@ -6,7 +6,7 @@
     9.4  LICENSE="GPL3"
     9.5  SHORT_DESC="Open-source braille translator and back-translator."
     9.6  MAINTAINER="yuripourre@gmail.com"
     9.7 -WEB_SITE="http://liblouis.org/"
     9.8 +WEB_SITE="https://web.archive.org/web/20221220101611/http://liblouis.org/"
     9.9  
    9.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
    9.11  WGET_URL="https://github.com/$PACKAGE/$PACKAGE/releases/download/v$VERSION/$TARBALL"
    10.1 --- a/libunixODBC/receipt	Fri Jan 27 10:37:43 2023 +0100
    10.2 +++ b/libunixODBC/receipt	Sun Feb 05 09:28:51 2023 +0000
    10.3 @@ -6,7 +6,7 @@
    10.4  SHORT_DESC="ODBC for unix - libraries."
    10.5  MAINTAINER="pascal.bellard@slitaz.org"
    10.6  LICENSE="LGPL2.1"
    10.7 -WEB_SITE="http://www.unixodbc.org/"
    10.8 +WEB_SITE="https://www.unixodbc.org/"
    10.9  
   10.10  WANTED="unixODBC"
   10.11  
    11.1 --- a/madeirado-theme/receipt	Fri Jan 27 10:37:43 2023 +0100
    11.2 +++ b/madeirado-theme/receipt	Sun Feb 05 09:28:51 2023 +0000
    11.3 @@ -8,7 +8,7 @@
    11.4  LICENSE="GPL3"
    11.5  WEB_SITE="http://holkfoor.deviantart.com/art/Madeirado-Pack-Theme-382214228"
    11.6  TARBALL="$PACKAGE-$VERSION.tar.bz2"
    11.7 -WGET_URL="https://dl.dropboxusercontent.com/s/ax6iqx6aa344fsu/Madeirado_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
    11.8 +WGET_URL="https://web.archive.org/web/20230129190806if_/https://dl.dropboxusercontent.com/s/ax6iqx6aa344fsu/Madeirado_GTK2_Openbox_Slim_Wallpaper.tar.bz2"
    11.9  TAGS="holkfoor openbox slim wallpaper"
   11.10  #HOST_ARCH="any" # imagemagick missing in arm
   11.11  
    12.1 --- a/memtest/receipt	Fri Jan 27 10:37:43 2023 +0100
    12.2 +++ b/memtest/receipt	Sun Feb 05 09:28:51 2023 +0000
    12.3 @@ -30,28 +30,36 @@
    12.4  {
    12.5  	file=$1
    12.6  	shift
    12.7 -	for i in lzma lz4 lzsa1 lzsa2 ; do
    12.8 +	for i in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
    12.9  		cp $stuff/*.S $stuff/pack .
   12.10  		sed "s/VERSION/$VERSION/;s|lzma1=|&nice=${1:-64},|" -i pack
   12.11  		while [ -n "$2" ]; do
   12.12  			sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
   12.13  			shift 2
   12.14  		done
   12.15 -		sed -i "s|uncompress|un$i|" unpack.S
   12.16 +		sed -i "s|uncompress|un${i%x2}|" unpack.S
   12.17  		asm bootloader
   12.18  		asm unpack
   12.19  		cp pack pack.bak
   12.20  		./pack --build bootloader.bin unpack.bin
   12.21 -		PACKER=$i ./pack $file $file.$i
   12.22 -		if [ $(stat -c %s $file.$i) -ge $((0x101F0)) ]; then
   12.23 -			rm $file.$i
   12.24 +		PACKER=${i%x2} ./pack $file $file.${i%x2}
   12.25 +		if [ $(stat -c %s $file.${i%x2}) -ge $((0x101F0)) ]; then
   12.26 +			rm $file.${i%x2}
   12.27  			cp pack.bak pack
   12.28 -			sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16 0 // $i|" -i unpack.S
   12.29 +			sed -e "s|^#define FLAT16.*// lzma case|#define FLAT16			0 // ${i%x2}|" -i unpack.S
   12.30  			asm unpack
   12.31  			./pack --build bootloader.bin unpack.bin
   12.32 -			PACKER=$i ./pack $file $file.$i
   12.33 +			PACKER=${i%x2} ./pack $file $file.${i%x2}
   12.34  		fi
   12.35 -		mv unpack.lst unpack.lst.$i
   12.36 +		mv unpack.lst unpack.lst.${i%x2}
   12.37 +		if [ "${i#*x}" = "2" ]; then
   12.38 +			cp pack.bak pack
   12.39 +			sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED	1 // $i|" -i unpack.S
   12.40 +			asm unpack
   12.41 +			./pack --build bootloader.bin unpack.bin
   12.42 +			PACKER=${i%x2} ./pack $file $file.$i
   12.43 +			mv unpack.lst unpack.lst.$i
   12.44 +		fi
   12.45  	done
   12.46  }
   12.47  
    13.1 --- a/memtest/stuff/pack	Fri Jan 27 10:37:43 2023 +0100
    13.2 +++ b/memtest/stuff/pack	Sun Feb 05 09:28:51 2023 +0000
    13.3 @@ -11,6 +11,21 @@
    13.4  	[ -n "$x" ] && sed -i "s/XXXSP/$((514+0x$x))/" $0 || sed -i "/XXXSP/d" $0
    13.5  	x=$(grep -s setup_seg$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
    13.6  	[ -n "$x" ] && sed -i "s/XXXSS/$((513+0x$x))/" $0 || sed -i "/XXXSS/d" $0
    13.7 +	x=$(grep -s setup_keep$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
    13.8 +	if [ -n "$x" ]; then
    13.9 +		sed -i "s/XXXK2 //" $0 
   13.10 +	else
   13.11 +		x=$(grep -s setup_syssize$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   13.12 +		if [ -n "$x" ]; then
   13.13 +			sed -i "s/XXXK2/bs=500 skip=1/" $0
   13.14 +		else
   13.15 +			sed -i "s/XXXK2/bs=512 skip=1/" $0
   13.16 +		fi
   13.17 +	fi
   13.18 +	x=$(grep -s double_packed$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   13.19 +	[ -n "$x" ] && sed -i "s/| compress /&& 2 /" $0
   13.20 +	x=$(grep -s update_code32_start$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   13.21 +	[ -n "$x" ] && sed -i '/XXXU2/d; s| XXXU1||' $0 || sed -i '/XXXU1/d; s| XXXU2||' $0
   13.22  	grep -q BFF401 ${2/.bin/.lst} && sed -i 's/512 skip/500 skip/;s/1000 -/&32 - /' $0
   13.23  	grep -q 83C60D ${2/.bin/.lst} && sed -i 's/ | dd bs=1 skip=13//' $0
   13.24  	helpmsg=$(grep -s helpmsg$ ${1/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   13.25 @@ -40,15 +55,15 @@
   13.26  
   13.27  bits()
   13.28  {
   13.29 -	sed "/define PROP_$1/!d;s|.*PROP_...||" unlzma.S
   13.30 +	sed "/^#define PROP_$1/!d;s|.*PROP_...||" unlzma.S
   13.31  }
   13.32  
   13.33  compress()
   13.34  {
   13.35  	case "$PACKER" in
   13.36  	lz4) lz4 -l --best | tail -c +5 ;;
   13.37 -	lzsa1) cat > /tmp/in$$ ; lzsa -f1 /tmp/in$$ /tmp/out$$ ; tail -c +4 /tmp/out$$ ; rm -f /tmp/in$$ /tmp/out$$ ;;
   13.38 -	lzsa2) cat > /tmp/in$$ ; lzsa -f2 /tmp/in$$ /tmp/out$$ ; tail -c +4 /tmp/out$$ ; rm -f /tmp/in$$ /tmp/out$$ ;;
   13.39 +	lzsa1) cat > /tmp/in$$$1 ; lzsa -f1 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
   13.40 +	lzsa2) cat > /tmp/in$$$1 ; lzsa -f2 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
   13.41  	*) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
   13.42  	esac
   13.43  }
   13.44 @@ -59,18 +74,23 @@
   13.45  	dd if=$1 bs=1 skip=497 seek=497 count=15 of=$2 conv=notrunc
   13.46  	setup="$(echo $(od -j 497 -N 1 -dAn $1))"
   13.47  	[ $setup -eq 0 ] && setup=4
   13.48 +	store $setup $2 497 1
   13.49 +	setup=$((setup+1))
   13.50  	store $setup $2 XXXSB 1
   13.51  	store $setup $2 XXXSW 1
   13.52 -	store $((32 * $setup)) $2 XXXSP
   13.53 -	store $((0x1000 - 32*$setup)) $2 XXXSS 
   13.54 -	dd if=$1 bs=512 skip=1 | compress >>$2
   13.55 +	store $((32*setup+0xF000)) $2 XXXSP
   13.56 +	store $((0x1000 - 32*setup)) $2 XXXSS 
   13.57 +	cp $1 /tmp/un$$ XXXU1
   13.58 +	store 1 /tmp/un$$ 534 1 XXXU1
   13.59 +	dd if=/tmp/un$$ XXXK2 | compress >>$2 XXXU1
   13.60 +	rm -f /tmp/un$$ XXXU1
   13.61 +	dd if=$1 XXXK2 | compress >>$2 XXXU2
   13.62  	size=$(stat -c %s $2)
   13.63 -	syssize=$((($size-512*($setup+1)+15)/16))
   13.64 -	store $(($syssize + 0x1000)) $2 XXXP
   13.65 +	syssize=$(((size-512*setup+15)/16))
   13.66 +	store $((syssize + 0x1000 + 0x1000)) $2 XXXP
   13.67  	store $syssize $2 500
   13.68 -	store 4 $2 497 1
   13.69 -	store $((($size+511)/512)) $2 4
   13.70 -	store $((($size+15)/16)) $2 14
   13.71 +	store $(((size+511)/512)) $2 4
   13.72 +	store $(((size+15)/16)) $2 14
   13.73  	echo -e "$3" | dd conv=notrunc bs=1 seek=YYY of=$2 count=ZZZ
   13.74  }
   13.75  
    14.1 --- a/memtest/stuff/unlz4.S	Fri Jan 27 10:37:43 2023 +0100
    14.2 +++ b/memtest/stuff/unlz4.S	Sun Feb 05 09:28:51 2023 +0000
    14.3 @@ -54,7 +54,7 @@
    14.4  	subl	$1+2, %edx	// count token & string address
    14.5  	jle	lz4main
    14.6  	lodsw			// get string address
    14.7 -	xchgw	%ax, %bx
    14.8 +	xchg	AX, BX
    14.9  	call	lz4len		// get string length
   14.10  	add	$4, CX
   14.11  #if !defined(FLAT32) && !defined(FLAT16OUT)
   14.12 @@ -91,7 +91,7 @@
   14.13  	xchg	AX, SI
   14.14  	mov	DI, SI
   14.15  	sub	BX, SI
   14.16 -	rep movsb %es(SI), %es(DI)
   14.17 +	rep movsb %es:(SI), %es:(DI)
   14.18  	xchg	AX, SI
   14.19  #endif
   14.20  	jmp	lz4chunk
    15.1 --- a/memtest/stuff/unlzsa1.S	Fri Jan 27 10:37:43 2023 +0100
    15.2 +++ b/memtest/stuff/unlzsa1.S	Sun Feb 05 09:28:51 2023 +0000
    15.3 @@ -69,12 +69,13 @@
    15.4  	jne	lzsa1chunk	// 64Kb block
    15.5  # endif
    15.6  	jcxz	lzsa1quit	// bail if we hit EOD
    15.7 -	movw	%cx, %dx
    15.8 +	pushw	%cx
    15.9  # if !defined(FLAT32) && !defined(FLAT16)
   15.10  	xorw	%cx, %cx
   15.11  	call	normalize
   15.12  # define NeedNormalize
   15.13  # endif
   15.14 +	popw	%dx
   15.15  	addw	%si, %dx
   15.16  #endif
   15.17  lzsa1chunk:			// uncompress chunk
   15.18 @@ -83,7 +84,7 @@
   15.19  	shrb	$4, %al		// shift literals length into place
   15.20  	movw	$LITERALS_RUN_LEN*256+MIN_LITERALS_SIZE, %cx
   15.21  	call	lzsa1len	// %ch = LITERALS_RUN_LEN
   15.22 -#if defined(NeedNormalize) && defined(PARANOIA)
   15.23 +#if defined(NeedNormalize)
   15.24  	call	lzsa1movLit	// copy %cx literals from %ds:%si to %es:%di
   15.25  #else
   15.26  	rep	movsb		// copy %cx literals from %ds:%si to %es:%di
   15.27 @@ -121,11 +122,12 @@
   15.28  axok:
   15.29  .macro norm	reg
   15.30  	movw	%si, \reg
   15.31 +	subw	%si, %dx
   15.32  	andw	$0xF, %si
   15.33 +	addw	%si, %dx
   15.34  	shrw	$4, \reg
   15.35  	addw	\reg, %ax
   15.36  	movw	%ax, %ds
   15.37 -lzsa1movLit:
   15.38  	movw	%di, \reg
   15.39  	andw	$0xF, %di
   15.40  	shrw	$4, \reg
   15.41 @@ -133,12 +135,14 @@
   15.42  	addw	\reg, %ax
   15.43  	movw	%ax, %es
   15.44  .endm 
   15.45 +	pushw	%dx
   15.46  # if defined(NeedNormalize) || defined(PARANOIA)
   15.47  	call	lzsa1movStr	// copy string
   15.48  # else
   15.49  	norm	%bp
   15.50  	rep movsb
   15.51  # endif
   15.52 +	popw	%dx
   15.53  	popw	%si
   15.54  	popw	%ds
   15.55  #else
   15.56 @@ -178,7 +182,8 @@
   15.57  	incw	%ch
   15.58  # endif
   15.59  normalize:
   15.60 -	movw	%ds, %bp
   15.61 +lzsa1movLit:
   15.62 +	movw	%ds, %ax
   15.63  lzsa1movStr:
   15.64  	norm	%bp
   15.65  # if defined(PARANOIA)
    16.1 --- a/memtest/stuff/unlzsa2.S	Fri Jan 27 10:37:43 2023 +0100
    16.2 +++ b/memtest/stuff/unlzsa2.S	Sun Feb 05 09:28:51 2023 +0000
    16.3 @@ -76,10 +76,11 @@
    16.4  # endif
    16.5  	jcxz	lzsa2quit	// bail if we hit EOD
    16.6  # if !defined(FLAT16)
    16.7 -	movw	%cx, %dx
    16.8 +	pushw	%cx
    16.9  	xorw	%cx, %cx
   16.10  	call	normalize
   16.11  # define NeedNormalize
   16.12 +	popw	%dx
   16.13  	addw	%si, %dx
   16.14  # else
   16.15  	movw	%si, %dx
   16.16 @@ -99,7 +100,7 @@
   16.17  	movw	$LITERALS_RUN_LEN+256*MIN_LITERALS_SIZE, %cx
   16.18  	shrb	%cl, %al	// shift literals length into place
   16.19  	call	lzsa2len	// %cl = LITERALS_RUN_LEN
   16.20 -#if defined(NeedNormalize) && defined(PARANOIA)
   16.21 +#if defined(NeedNormalize)
   16.22  	pushw	%bp
   16.23  	call	lzsa2movLit	// copy %cx literals from %ds:%si to %es:%di
   16.24  	popw	%bp
   16.25 @@ -181,11 +182,12 @@
   16.26  axok:
   16.27  .macro norm	reg
   16.28  	movw	%si, \reg
   16.29 +	subw	%si, %dx
   16.30  	andw	$0xF, %si
   16.31 +	addw	%si, %dx
   16.32  	shrw	$4, \reg
   16.33  	addw	\reg, %ax
   16.34  	movw	%ax, %ds
   16.35 -lzsa2movLit:
   16.36  	movw	%di, \reg
   16.37  	andw	$0xF, %di
   16.38  	shrw	$4, \reg
   16.39 @@ -194,12 +196,14 @@
   16.40  	movw	%ax, %es
   16.41  .endm 
   16.42  	pushw	%bp
   16.43 +	pushw	%dx
   16.44  # if defined(NeedNormalize) || defined(PARANOIA)
   16.45  	call	lzsa2movStr	// copy string
   16.46  # else
   16.47  	norm	%bp
   16.48  	rep movsb
   16.49  # endif
   16.50 +	popw	%dx
   16.51  	popw	%bp
   16.52  	popw	%si
   16.53  	popw	%ds
   16.54 @@ -254,7 +258,8 @@
   16.55  	incw	%ch
   16.56  # endif
   16.57  normalize:
   16.58 -	movw	%ds, %bp
   16.59 +lzsa2movLit:
   16.60 +	movw	%ds, %ax
   16.61  lzsa2movStr:
   16.62  	norm	%bp
   16.63  # if defined(PARANOIA)
    17.1 --- a/memtest/stuff/unpack.S	Fri Jan 27 10:37:43 2023 +0100
    17.2 +++ b/memtest/stuff/unpack.S	Sun Feb 05 09:28:51 2023 +0000
    17.3 @@ -3,12 +3,14 @@
    17.4  #define SYSSIZE		0x1F4
    17.5  #define SETUPSIZE	0x1F1
    17.6  
    17.7 +#define KEEP_BOOTSECTOR		0
    17.8  #define LINUX_HEADER		0
    17.9  #define UPDATE_SYSSIZE		1
   17.10 -#define HARDCODED_SYSSIZE	1
   17.11 -#define HARDCODED_SETUPSIZE	1
   17.12  #define FLAT16			1	// lzma case
   17.13 -//#define FLAT16OUT		0
   17.14 +#define FLAT16OUT		0
   17.15 +#define COPYTOHIGHMEM		0
   17.16 +#define UPDATE_CODE32_START	0
   17.17 +#define DOUBLE_PACKED		0
   17.18  #define SAVEREGS		0 
   17.19  #define ELKS			0
   17.20  
   17.21 @@ -16,9 +18,14 @@
   17.22  	.code16
   17.23  	.org	0
   17.24  
   17.25 +#if KEEP_BOOTSECTOR
   17.26 +#undef UPDATE_SYSSIZE
   17.27 +#define UPDATE_SYSSIZE		0
   17.28 +#endif
   17.29  #if ELKS
   17.30  	.arch	i8086
   17.31  #define FLAT16			1
   17.32 +#define KEEP_BOOTSECTOR		1
   17.33  #define LINUX_HEADER		0
   17.34  #define SAVEREGS		0 
   17.35  #define TOPSEG		0x2000
   17.36 @@ -26,6 +33,58 @@
   17.37  #define TOPSEG		0x8000
   17.38  #endif
   17.39  
   17.40 +.macro	pusham
   17.41 +#if ELKS
   17.42 +	pushw	%ax
   17.43 +//	movw	%sp, %ax
   17.44 +//	incw	%ax		// emulate popa behaviour
   17.45 +//	incw	%ax
   17.46 +	pushw	%cx
   17.47 +	pushw	%dx
   17.48 +	pushw	%bx
   17.49 +//	pushw	%ax		// %sp
   17.50 +	pushw	%bp
   17.51 +	pushw	%si
   17.52 +	pushw	%di
   17.53 +#else
   17.54 +	pushaw
   17.55 +#endif
   17.56 +.endm 
   17.57 +
   17.58 +.macro	popam
   17.59 +#if ELKS
   17.60 +	popw	%di
   17.61 +	popw	%si
   17.62 +	popw	%bp
   17.63 +//	popw	%ax
   17.64 +	popw	%bx
   17.65 +	popw	%dx
   17.66 +	popw	%cx
   17.67 +	popw	%ax
   17.68 +#else
   17.69 +	popaw
   17.70 +#endif
   17.71 +.endm 
   17.72 +
   17.73 +.macro	pushm	val
   17.74 +#if ELKS
   17.75 +	movw	\val, %ax
   17.76 +	pushw	%ax
   17.77 +#else
   17.78 +	pushw	\val
   17.79 +#endif
   17.80 +.endm 
   17.81 +
   17.82 +.macro	shrwm	cnt, reg
   17.83 +#if ELKS
   17.84 +	.rept	\cnt
   17.85 +	shrw	$1, \reg
   17.86 +	.endr
   17.87 +#else
   17.88 +	shrw	$\cnt, \reg
   17.89 +#endif
   17.90 +.endm
   17.91 +
   17.92  	.globl	_start
   17.93  _start:
   17.94  #if LINUX_HEADER
   17.95 @@ -48,113 +107,82 @@
   17.96  	pushfw
   17.97  	pushw	%cs
   17.98  	pushw	$0
   17.99 -	pushal
  17.100 +	pusham
  17.101 +	xorw	%si, %si
  17.102  	pushw	%ds
  17.103 +	pushw	%es
  17.104  	cld
  17.105  #else
  17.106 -	pushw	%cs		// return adress is %cs:0
  17.107 -# if FLAT16
  17.108 -	xorw	%di, %di
  17.109 -	pushw	%di
  17.110 -# else
  17.111 -	pushw	$0
  17.112 +	pushw	%cs			// return adress is %cs:0
  17.113 +	xorw	%si, %si
  17.114 +	pushw	%si
  17.115 +#endif	// SAVEREGS
  17.116 +	pushw	%ds			// <A> bootsector+setup segment
  17.117 +#if FLAT16
  17.118 +# 1- move 9000..9020+stp -> TOPSEG
  17.119 +	pushm	$TOPSEG
  17.120 +	popw	%es
  17.121 +# if SAVEREGS
  17.122 +setup_word:
  17.123 +	movw	$SETUP*256+256, %cx
  17.124 +	pushw	%cx			// <B> bootsector+setup words
  17.125  # endif
  17.126 -#endif
  17.127 -#if ELKS
  17.128 -	movw	$0x100, %ax
  17.129 -	pushw	%ax
  17.130 -#else
  17.131 -# if UPDATE_SYSSIZE
  17.132 -	pushw	%ds			// <A>
  17.133 -# else
  17.134 -	pushw	%cs			// <A>
  17.135 -# endif
  17.136 -#endif
  17.137 -#if FLAT16
  17.138 -# 1- move 9020..9020+stp -> TOPSEG
  17.139 -# if ELKS
  17.140 -	movb	$TOPSEG/256, %ah
  17.141 -	movw	%ax, %es
  17.142 -# else
  17.143 -	pushw	$TOPSEG
  17.144 -	popw	%es			// %es:%di = TOPSEG:0
  17.145 -# endif
  17.146 -	movw	$0x200, %si		// %ds:%si = 9000:0200
  17.147 -# if SAVEREGS == 0
  17.148 +	pushw	%es			// <C> TOPSEG
  17.149  	pushw	%es
  17.150 -	call	jumpinto		// move setup & jmp %es:cont
  17.151 -# else
  17.152 -#  if HARDCODED_SETUPSIZE
  17.153 -setup_word:
  17.154 -	movw	$SETUP*256, %cx
  17.155 -#  else
  17.156 -	xorw	%cx, %cx
  17.157 -	movb	SETUPSIZE, %ch
  17.158 -	movw	%cx, %dx
  17.159 -#  endif
  17.160 -	pushw	%cx			// <B>
  17.161 -	pushw	%es
  17.162 -	pushw	%di
  17.163 +# if SAVEREGS
  17.164 +	xorw	%di, %di		// %ds:%si = 9000:0000		%es:%di = TOPSEG:0
  17.165 +	pushm	$0x200+cont
  17.166  	rep
  17.167  	  movsw
  17.168  	lret
  17.169 +cont:
  17.170 +# else
  17.171 +	movw	$-0x200, %di
  17.172 +	call	jumpinto
  17.173  # endif
  17.174 -cont:
  17.175  # 2- move 1000..1000+sys -> TOPSEG+stp
  17.176 -# if ELKS
  17.177 -	movw	$0x1000, %ax
  17.178 -	movw	%ax, %ds
  17.179 -# else
  17.180 -	pushw	$0x1000
  17.181 +	pushm	$0x1000
  17.182  	popw	%ds
  17.183 -# endif
  17.184  	xorw	%si, %si		// %ds:%si = 1000:0
  17.185  	subw	%di, %cx		// %cx = 64K - setupsz
  17.186  	rep
  17.187  	  movsb
  17.188  # 3- unlz(TOPSEG+stp:end, 1000-stp:0)
  17.189 -	pushw	%es		// <C>
  17.190 -# if HARDCODED_SETUPSIZE
  17.191  setup_seg:
  17.192 -#  if ELKS
  17.193 -#   if UPDATE_SYSSIZE
  17.194 -	movw	$0x1000-(SETUP*32)-32, %ax
  17.195 -#   else
  17.196 -	movw	$0x1000-(SETUP*32), %ax
  17.197 -#   endif
  17.198 -	movw	%ax, %es
  17.199 -#  else
  17.200 -#   if UPDATE_SYSSIZE
  17.201 -	pushw	$0x1000-(SETUP*32)-32
  17.202 -#   else
  17.203 -	pushw	$0x1000-(SETUP*32)
  17.204 -#   endif
  17.205 +	pushm	$0x1000-(SETUP*32)-32
  17.206  	popw	%es
  17.207 -#  endif
  17.208 +#else		// FLAT16
  17.209 +# 1- move 9020..9020+unpack -> 0700 and jump into
  17.210 +	movw	$0x700, %cx		// Up to 3.5KB for unpacker (unlzma is << 1KB)
  17.211 +	movw	%cx, %es		// Use 7000 .. 7E00, keep up to 23 elks setup sectors
  17.212 +	pushw	%es
  17.213 +	xorw	%di, %di		// %ds:%si = 9000:0000	%es:%di = 0700:0000
  17.214 +	pushm	$0x200+cont
  17.215 +# if SAVEREGS
  17.216 +	rep
  17.217 +	  movsw
  17.218 +	lret
  17.219  # else
  17.220 -#  if UPDATE_SYSSIZE
  17.221 -	incb	%dh
  17.222 -#  endif
  17.223 -#   if ELKS
  17.224 -	shrw	$1, %dx
  17.225 -	shrw	$1, %dx
  17.226 -	shrw	$1, %dx
  17.227 -#   else
  17.228 -	shrw	$3, %dx
  17.229 -#   endif
  17.230 -	movw	%ds, %ax
  17.231 -	subw	%dx, %ax
  17.232 -	movw	%ax, %es
  17.233 -#  endif
  17.234 -# else		// FLAT16
  17.235 -# 1- move 1000..1000+sys -> 9000-sys
  17.236 -# if HARDCODED_SYSSIZE
  17.237 +	jmp	jumpinto
  17.238 +# endif
  17.239 +cont:
  17.240 +# 2- move 9020..9020+stp -> 9000-sys-stp
  17.241 +	movw	%ds, %dx
  17.242 +setup_byte:
  17.243 +	movb	$SETUP+1, %ch
  17.244 +setup_para:
  17.245 +	subw	$SETUP*32+32+0xF000, %dx
  17.246  packed_syssize:
  17.247 -	movw	$0x1000+0, %ax
  17.248 -# else
  17.249 -	movw	SYSSIZE, %ax
  17.250 -	addw	$0x1000, %ax
  17.251 -# endif
  17.252 +	movw	$0+0x1000, %ax
  17.253 +	pushw	%cx			// <B> bootsector+setup words
  17.254 +	subw	%ax, %dx
  17.255 +	movw	%dx, %es
  17.256 +	pushw	%es			// <C> 9000-sys-stp
  17.257 +	xorw	%si, %si
  17.258 +	xorw	%di, %di		// %ds:%si = 9000:0	%es:%di = 9000-sys-stp:0
  17.259 +	rep
  17.260 +	  movsw
  17.261 +# 3- move 1000..1000+sys -> 9000-sys
  17.262  	movw	%ds, %dx
  17.263  mvsys:
  17.264  	decw	%ax
  17.265 @@ -168,102 +196,109 @@
  17.266  	  movsw
  17.267  	cmpw	$0x1000, %ax
  17.268  	jne	mvsys
  17.269 -# 2- move 9020..9020+stp -> 9000-sys-stp
  17.270 -	
  17.271 -# if HARDCODED_SETUPSIZE
  17.272 -setup_byte:
  17.273 -	movb	$SETUP, %ch
  17.274 -setup_para:
  17.275 -	subw	$SETUP*32, %dx
  17.276 -# else
  17.277 -	movb	%ss:SETUPSIZE, %ch
  17.278 -	movw	%cx, %ax
  17.279 -#  if ELKS
  17.280 -	shrw	$1, %ax
  17.281 -	shrw	$1, %ax
  17.282 -	shrw	$1, %ax
  17.283 -#  else
  17.284 -	shrw	$3, %ax
  17.285 -#  endif
  17.286 -	subw	%ax, %dx
  17.287 -# endif
  17.288 -# if SAVEREGS != 0
  17.289 -	pushw	%cx			// <B>
  17.290 -# endif
  17.291 -	movw	%dx, %es
  17.292 -	xorw	%si, %si		// %cs:%si = 9020:0
  17.293 -	xorw	%di, %di		// %es:%di = 9000-sys-stp:0
  17.294 -	rep
  17.295 -	  movsw	%cs:(%si),%es:(%di)
  17.296 -	pushw	%es			// <C>
  17.297 -# 3- reloc itself in 0x7C00
  17.298 -	pushw	$0x07C0
  17.299 +# 4- unlz(9000-sys-stp:end, 1000-stp:0)
  17.300 +setup_seg:
  17.301 +	pushm	$0x1000-(SETUP*32)-32
  17.302  	popw	%es
  17.303 -	movw	$cont, %si		// %cs:%si = 9020:cont
  17.304 -	movw	%si, %di		// %es:%di = 7C0:cont
  17.305 -	movw	$end-_start, %cx
  17.306 -	pushw	%es
  17.307 -	pushw	%di
  17.308 -	rep
  17.309 -	  movsb	%cs:(%si),%es:(%di)
  17.310 -	lret
  17.311 -cont:
  17.312 -# 4- unlz(9000-sys-stp:end, 1000-stp:0)
  17.313 -# if HARDCODED_SETUPSIZE
  17.314 -setup_seg:
  17.315 -#  if UPDATE_SYSSIZE
  17.316 -	pushw	$0x1000-(SETUP*32)-32
  17.317 -#  else
  17.318 -	pushw	$0x1000-(SETUP*32)
  17.319 -#  endif
  17.320 -	popw	%es
  17.321 -# else
  17.322 -	negw	%ax
  17.323 -#  if UPDATE_SYSSIZE
  17.324 -	addw	$0x1000-32, %ax
  17.325 -#  else
  17.326 -	addw	$0x1000, %ax
  17.327 -#  endif
  17.328 -	movw	%ax, %es
  17.329 -# endif
  17.330  #endif		// FLAT16
  17.331  	popw	%ds			// <C>
  17.332 -	movw	$end-_start, %si	// %ds:%si = TOPSSEG:compressed / 9000-sys-stp:compressed
  17.333 -#if UPDATE_SYSSIZE
  17.334 -	movw	$SYSSIZE, %di		// %es:%di = 1000-setup-bootsector:SYSSIZE
  17.335 +#if FLAT16 && SAVEREGS == 0
  17.336 +	movw	$end-_start, %si	// %ds:%si = TOPSSEG:compressed
  17.337  #else
  17.338 +	movw	$0x200+end-_start, %si	// %ds:%si = 9000-sys-stp:compressed
  17.339 +#endif
  17.340 +#if KEEP_BOOTSECTOR
  17.341 +setup_keep:
  17.342  	xorw	%di, %di
  17.343 +#else
  17.344 +# if UPDATE_SYSSIZE
  17.345 +setup_syssize:
  17.346 +	movw	$0x1F4, %di		// %es:%di = 1000-setup-bootsector:SYSSIZE
  17.347 +# else
  17.348 +	movw	$0x200, %di
  17.349 +# endif
  17.350  #endif
  17.351  	pushw	%di
  17.352  	pushw	%es
  17.353 +#if DOUBLE_PACKED
  17.354 +double_packed:
  17.355 +	pushm	$0x4000
  17.356 +	popw	%es
  17.357 +	pushw	%di
  17.358 +	pushw	%es
  17.359  	call	unpack
  17.360  	popw	%ds
  17.361 -	popw	%si			// %ds:%si = 1000-setup-bootsector:SYSSIZE
  17.362 +	popw	%si
  17.363 +	popw	%es
  17.364 +	popw	%di
  17.365 +	pushw	%di
  17.366 +	pushw	%es
  17.367 +#endif
  17.368 +	call	unpack
  17.369 +#if COPYTOHIGHMEM
  17.370 +# if FLAT16OUT
  17.371 +	movw	$0x9310+1, %ax		// from 1000:FFFF
  17.372 +# else
  17.373 +#  if 0
  17.374 +	movw	%es, %ax
  17.375 +	shrw	$12, %ax
  17.376 +	orw	$0x9310, %ax
  17.377 +#  else
  17.378 +	movw	$0x9310+7, %ax		// from 7000:FFFF
  17.379 +#  endif
  17.380 +# endif
  17.381 +	pushw	%ss
  17.382 +	popw	%es
  17.383 +	movw	$8, %cx
  17.384 +zero1:
  17.385 +	pushw	$0			// 2E..20
  17.386 +	loop	zero1
  17.387 +src:		
  17.388 +	pushw	%cx			// 1E, 16
  17.389 +	pushw	%ax			// 1A: dst %ax:%cx, 12: src %ax:%cx
  17.390 +	pushw	%cx
  17.391 +	pushw	$-1			// 18, 10: full 64K segment
  17.392 +	subb	$0x10, %al
  17.393 +	jnc	src
  17.394 +	movb	$8, %cl
  17.395 +zero2:
  17.396 +	pushw	$0			// 0E..00
  17.397 +	loop	zero2
  17.398 +	movw	%sp, %si
  17.399 +syslp:
  17.400 +	movb	$0x80, %ch	
  17.401 +	movb	$0x87, %ah
  17.402 +	int	$0x15
  17.403 +# if FLAT16OUT == 0
  17.404 +	decb	%es:0x1C(%si)
  17.405 +	decb	%es:0x14(%si)
  17.406 +	jne	syslp			// down to 1000:0000
  17.407 +# endif
  17.408 +	addw	$0x30, %sp
  17.409 +#endif	// COPYTOHIGHMEM
  17.410 +	popw	%ds
  17.411 +	popw	%si			// %ds:%si = 1000-setup-bootsector:SYSSIZE / 0
  17.412 +#if UPDATE_CODE32_START
  17.413 +update_code32_start:
  17.414 +//	movb	$1, 0x216
  17.415 +#endif
  17.416 +#if FLAT16 == 0 || SAVEREGS
  17.417 +	popw	%cx			// <B> bootsector+setup words
  17.418 +#endif
  17.419 +	popw	%es			// <A> bootsector+setup segment
  17.420  	movw	%si, %di
  17.421 -#   if SAVEREGS != 0
  17.422 -	popw	%cx			// <B>
  17.423 -#if UPDATE_SYSSIZE
  17.424 -// not need with memtest	movb	$(512-SYSSIZE)/2, %cl
  17.425 +jumpinto:
  17.426 +#if FLAT16 && SAVEREGS == 0
  17.427 +setup_word:
  17.428 +	movw	$SETUP*256+256, %cx
  17.429  #endif
  17.430 -	popw	%es			// <A>
  17.431 -# 5- move 1000-stp..1000 -> 9020
  17.432 -#   else
  17.433 -	popw	%es			// <A>  %es:%di = 9000:SYSSIZE (the last 12 bytes are missing)
  17.434 -jumpinto:
  17.435 -# if HARDCODED_SETUPSIZE
  17.436 -setup_word:
  17.437 -	movw	$SETUP*256, %cx
  17.438 -# else
  17.439 -	xorw	%cx, %cx
  17.440 -	movb	%ss:SETUPSIZE, %ch
  17.441 -	movw	%cx, %dx
  17.442 -# endif
  17.443 -#  endif
  17.444 +# 5- move 1000-stp..1000 -> 9000
  17.445  	rep
  17.446  	  movsw
  17.447  #if SAVEREGS
  17.448 +	popw	%es
  17.449  	popw	%ds
  17.450 -	popal
  17.451 +	popam
  17.452  	iret
  17.453  #else
  17.454  	lret
  17.455 @@ -277,6 +312,12 @@
  17.456  #if ELKS
  17.457  #define ONLY8086	1
  17.458  #endif
  17.459 +#if defined(FLAT16OUT) && FLAT16OUT == 0
  17.460 +#undef FLAT16OUT
  17.461 +#endif
  17.462 +#if defined(FLAT16) && FLAT16 == 0
  17.463 +#undef FLAT16
  17.464 +#endif
  17.465  #include "uncompress.S"
  17.466  
  17.467  end:
    18.1 --- a/picoblog/receipt	Fri Jan 27 10:37:43 2023 +0100
    18.2 +++ b/picoblog/receipt	Sun Feb 05 09:28:51 2023 +0000
    18.3 @@ -7,7 +7,7 @@
    18.4  MAINTAINER="pascal.bellard@slitaz.org"
    18.5  LICENSE="MIT"
    18.6  TARBALL="$PACKAGE-$VERSION"
    18.7 -WEB_SITE="https://dev.kd2.org/picoblog/"
    18.8 +WEB_SITE="https://web.archive.org/web/20200128165016/https://dev.kd2.org/picoblog/"
    18.9  WGET_URL="https://svn.kd2.org/svn/misc/apps/picoblog/index.php"
   18.10  HOST_ARCH="any"
   18.11  TAGS="blog"
    19.1 --- a/pkcs/receipt	Fri Jan 27 10:37:43 2023 +0100
    19.2 +++ b/pkcs/receipt	Sun Feb 05 09:28:51 2023 +0000
    19.3 @@ -8,7 +8,7 @@
    19.4  LICENSE="MIT"
    19.5  TARBALL="$PACKAGE-$VERSION.tar.gz"
    19.6  WEB_SITE="http://www.truecrypt.org/"
    19.7 -WGET_URL="https://arch.juline.tech/other/tc/$TARBALL"
    19.8 +WGET_URL="http://mirror.vcu.edu/pub/gnu_linux/archlinux/other/tc/$TARBALL"
    19.9  
   19.10  genpkg_rules()
   19.11  {
    20.1 --- a/plop/receipt	Fri Jan 27 10:37:43 2023 +0100
    20.2 +++ b/plop/receipt	Sun Feb 05 09:28:51 2023 +0000
    20.3 @@ -10,27 +10,51 @@
    20.4  TARBALL="plpbt-$VERSION.zip"
    20.5  WGET_URL="https://download.plop.at/files/bootmngr/$TARBALL"
    20.6  
    20.7 -BUILD_DEPENDS="xz"
    20.8 +BUILD_DEPENDS="xz lz4 lzsa"
    20.9  
   20.10 +# What is the latest version available today?
   20.11  current_version()
   20.12  {
   20.13  	wget -O - $WEB_SITE 2>/dev/null | \
   20.14  	sed '/td align=center/!d;s|.*center>||;s|</.*||;q'
   20.15  }
   20.16  
   20.17 +asm()
   20.18 +{
   20.19 +	cc -o $1.o -Wa,-a=$1.lst -c $1.S
   20.20 +	objcopy --only-section=.text -O binary $1.o $1.bin
   20.21 +}
   20.22 +
   20.23  tune_lzma()
   20.24  {
   20.25 -	cp $stuff/*.S $stuff/pack .
   20.26 -	sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$1,|" -i pack
   20.27 +	cp $stuff/*.S .
   20.28 +	nice=$1
   20.29  	while [ -n "$2" ]; do
   20.30  		sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
   20.31  		shift 2
   20.32  	done
   20.33 -	for i in bootloader unpack ; do
   20.34 -		cc -o $i.o -Wa,-a=$i.lst -c $i.S
   20.35 -		objcopy --only-section=.text -O binary $i.o $i.bin
   20.36 +	cp plpbt.bin plop
   20.37 +	for c in lzma lz4x2 lzsa1x2 lzsa2x2 ; do
   20.38 +		sed "s|uncompress|un${c%x2}|" < $stuff/unpack.S > unpack.S
   20.39 +		cp $stuff/pack .
   20.40 +		sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$nice,|" -i pack
   20.41 +		cp pack pack.bak
   20.42 +		asm bootloader
   20.43 +		asm unpack
   20.44 +		cp unpack.lst unpack.lst.${c%x2}
   20.45 +		./pack --build bootloader.bin unpack.bin
   20.46 +		PACKER=${c%x2} ./pack plpbt.bin plop.${c%x2}
   20.47 +		[ $(stat -c %s plop.${c%x2}) -lt $(stat -c %s plop) ] && cp plop.${c%x2} plop
   20.48 +		if [ "${c#*x}" = "2" ]; then
   20.49 +			cp pack.bak pack
   20.50 +			sed -e "s|^#define DOUBLE_PACKED|#define DOUBLE_PACKED	1 // $i|" -i unpack.S
   20.51 +			asm unpack
   20.52 +			./pack --build bootloader.bin unpack.bin
   20.53 +			PACKER=${c%x2} ./pack plpbt.bin plop.$c
   20.54 +			mv unpack.lst unpack.lst.$c
   20.55 +		fi
   20.56  	done
   20.57 -	./pack --build bootloader.bin unpack.bin
   20.58 +	true
   20.59  }
   20.60  
   20.61  # Rules to configure and make the package.
   20.62 @@ -38,7 +62,7 @@
   20.63  {
   20.64  	while read ofs data name; do
   20.65  		echo -en "\x$data" | \
   20.66 -		dd conv=notrunc of=plpbt.bin bs=1 seek=$((0x$ofs))
   20.67 +		dd conv=notrunc of=plpbt.bin bs=1 seek=$((0x$ofs)) 2> /dev/null
   20.68  	done <<EOT
   20.69  0288	00	videoMode=text
   20.70  0295	00	stars=off
   20.71 @@ -46,7 +70,6 @@
   20.72  029A	00	zoomanimation=off
   20.73  EOT
   20.74  	tune_lzma 84,mf=bt2 LC 0 PB 0
   20.75 -	./pack plpbt.bin plop
   20.76  }
   20.77  
   20.78  # Rules to gen a SliTaz package suitable for Tazpkg.
    21.1 --- a/plop/stuff/pack	Fri Jan 27 10:37:43 2023 +0100
    21.2 +++ b/plop/stuff/pack	Sun Feb 05 09:28:51 2023 +0000
    21.3 @@ -12,9 +12,20 @@
    21.4  	x=$(grep -s setup_seg$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
    21.5  	[ -n "$x" ] && sed -i "s/XXXSS/$((513+0x$x))/" $0 || sed -i "/XXXSS/d" $0
    21.6  	x=$(grep -s setup_keep$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
    21.7 -	[ -n "$x" ] && sed -i "s/XXXK1/1/" $0 || sed -i "/XXXK1/d" $0
    21.8 -	[ -n "$x" ] && sed -i "s/skip=XXXK2 //" $0 || sed -i "s/XXXK2/1/" $0
    21.9 -	[ -n "$x" ] && sed -i "s/+XXXK3//" $0 || sed -i "s/XXXK3/1/" $0
   21.10 +	if [ -n "$x" ]; then
   21.11 +		sed -i "s/XXXK2 //" $0 
   21.12 +	else
   21.13 +		x=$(grep -s setup_syssize$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   21.14 +		if [ -n "$x" ]; then
   21.15 +			sed -i "s/XXXK2/bs=500 skip=1/" $0
   21.16 +		else
   21.17 +			sed -i "s/XXXK2/bs=512 skip=1/" $0
   21.18 +		fi
   21.19 +	fi
   21.20 +	x=$(grep -s double_packed$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   21.21 +	[ -n "$x" ] && sed -i "s/| compress /&& 2 /" $0
   21.22 +	x=$(grep -s update_code32_start$ ${2/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   21.23 +	[ -n "$x" ] && sed -i '/XXXU2/d; s| XXXU1||' $0 || sed -i '/XXXU1/d; s| XXXU2||' $0
   21.24  	grep -q BFF401 ${2/.bin/.lst} && sed -i 's/512 skip/500 skip/;s/1000 -/&32 - /' $0
   21.25  	grep -q 83C60D ${2/.bin/.lst} && sed -i 's/ | dd bs=1 skip=13//' $0
   21.26  	helpmsg=$(grep -s helpmsg$ ${1/.bin/.lst}|sed '$!d;s/.*t:\([^ ]*\).*/\1/')
   21.27 @@ -49,7 +60,12 @@
   21.28  
   21.29  compress()
   21.30  {
   21.31 -	xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
   21.32 +	case "$PACKER" in
   21.33 +	lz4) lz4 -l --best | tail -c +5 ;;
   21.34 +	lzsa1) cat > /tmp/in$$$1 ; lzsa -f1 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
   21.35 +	lzsa2) cat > /tmp/in$$$1 ; lzsa -f2 /tmp/in$$$1 /tmp/out$$$1 ; tail -c +4 /tmp/out$$$1 ; rm -f /tmp/in$$$1 /tmp/out$$$1 ;;
   21.36 +	*) xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
   21.37 +	esac
   21.38  }
   21.39  
   21.40  main()
   21.41 @@ -58,19 +74,23 @@
   21.42  	dd if=$1 bs=1 skip=497 seek=497 count=15 of=$2 conv=notrunc
   21.43  	setup="$(echo $(od -j 497 -N 1 -dAn $1))"
   21.44  	[ $setup -eq 0 ] && setup=4
   21.45 -	setup=$(($setup+XXXK1))
   21.46 +	store $setup $2 497 1
   21.47 +	setup=$((setup+1))
   21.48  	store $setup $2 XXXSB 1
   21.49  	store $setup $2 XXXSW 1
   21.50 -	store $((32 * $setup)) $2 XXXSP
   21.51 -	store $((0x1000 - 32*$setup)) $2 XXXSS 
   21.52 -	dd if=$1 bs=512 skip=XXXK2 | compress >>$2
   21.53 +	store $((32*setup+0xF000)) $2 XXXSP
   21.54 +	store $((0x1000 - 32*setup)) $2 XXXSS 
   21.55 +	cp $1 /tmp/un$$ XXXU1
   21.56 +	store 1 /tmp/un$$ 534 1 XXXU1
   21.57 +	dd if=/tmp/un$$ XXXK2 | compress >>$2 XXXU1
   21.58 +	rm -f /tmp/un$$ XXXU1
   21.59 +	dd if=$1 XXXK2 | compress >>$2 XXXU2
   21.60  	size=$(stat -c %s $2)
   21.61 -	syssize=$((($size-512*($setup+XXXK3)+15)/16))
   21.62 -	store $(($syssize + 0x1000)) $2 XXXP
   21.63 +	syssize=$(((size-512*setup+15)/16))
   21.64 +	store $((syssize + 0x1000 + 0x1000)) $2 XXXP
   21.65  	store $syssize $2 500
   21.66 -	store 4 $2 497 1
   21.67 -	store $((($size+511)/512)) $2 4
   21.68 -	store $((($size+15)/16)) $2 14
   21.69 +	store $(((size+511)/512)) $2 4
   21.70 +	store $(((size+15)/16)) $2 14
   21.71  	echo -e "$3" | dd conv=notrunc bs=1 seek=YYY of=$2 count=ZZZ
   21.72  }
   21.73  
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/plop/stuff/unlz4.S	Sun Feb 05 09:28:51 2023 +0000
    22.3 @@ -0,0 +1,132 @@
    22.4 +// Lz4Decode:
    22.5 +#ifndef FLAT32
    22.6 +//   input   ds:si=inStream, es:di=outStream
    22.7 +//   output  outStream[], ds:si, es:di
    22.8 +	.code16
    22.9 +#define AX	%ax
   22.10 +#define BX	%bx
   22.11 +#define CX	%cx
   22.12 +#define SI	%si
   22.13 +#define DI	%di
   22.14 +#else
   22.15 +//   input   esi=inStream, edi=outStream
   22.16 +//   output  outStream[], ds:esi, es:edi
   22.17 +	.code32
   22.18 +#define AX	%eax
   22.19 +#define BX	%ebx
   22.20 +#define CX	%ecx
   22.21 +#define SI	%esi
   22.22 +#define DI	%edi
   22.23 +#endif
   22.24 + 
   22.25 +#define ARCHIVE_MAGICNUMBER 0x184C2102
   22.26 +
   22.27 +//#define PARANOIA			// cover rare cases, optional
   22.28 +
   22.29 +lz4main:
   22.30 +#ifdef PARANOIA
   22.31 +	cld
   22.32 +# if !defined(FLAT32) && !defined(FLAT16OUT)
   22.33 +	xorl	%cx, %cx
   22.34 +	call	lz4mov
   22.35 +# endif
   22.36 +#endif
   22.37 +	lodsl			// get chunkSize
   22.38 +#ifndef NO_LZ4_HEADER
   22.39 +	cmpl	$ARCHIVE_MAGICNUMBER, %eax
   22.40 +	je	lz4main
   22.41 +#endif
   22.42 +	orl	%eax, %eax	// end of file ?
   22.43 +	je	lz4quit
   22.44 +	xchgl	%eax, %edx
   22.45 +lz4chunk:			// uncompress chunk
   22.46 +	lodsb			// get token
   22.47 +	movb	%al, %bl
   22.48 +	shrb	$4, %al
   22.49 +	call	lz4len		// get literal length
   22.50 +	subl	%ecx, %edx	// count literal
   22.51 +#if !defined(FLAT32) && !defined(FLAT16OUT) && (!defined(FLAT16) || !defined(PARANOIA))
   22.52 +#define NeedLz4mov
   22.53 +	call	lz4mov		// copy literals
   22.54 +#else
   22.55 +	rep movsb
   22.56 +#endif
   22.57 +	subl	$1+2, %edx	// count token & string address
   22.58 +	jle	lz4main
   22.59 +	lodsw			// get string address
   22.60 +	xchg	AX, BX
   22.61 +	call	lz4len		// get string length
   22.62 +	add	$4, CX
   22.63 +#if !defined(FLAT32) && !defined(FLAT16OUT)
   22.64 +	pushw	%ds
   22.65 +	pushw	%si
   22.66 +	movw	%di, %si
   22.67 +	subw	%bx, %si
   22.68 +	movw	%es, %ax
   22.69 +	jnc	axok
   22.70 +	subb	$0x10, %ah
   22.71 +axok:
   22.72 +.macro norm	reg
   22.73 +	movw	%si, \reg
   22.74 +	andw	$0xF, %si
   22.75 +	shrw	$4, \reg
   22.76 +	addw	\reg, %ax
   22.77 +	movw	%ax, %ds
   22.78 +	movw	%di, \reg
   22.79 +	andw	$0xF, %di
   22.80 +	shrw	$4, \reg
   22.81 +	movw	%es, %ax
   22.82 +	addw	\reg, %ax
   22.83 +	movw	%ax, %es
   22.84 +.endm 
   22.85 +# if !defined (NeedLz4mov)
   22.86 +	norm	%bp
   22.87 +	rep movsb
   22.88 +# else
   22.89 +	call	lz4movStr	// copy string
   22.90 +# endif
   22.91 +	popw	%si
   22.92 +	popw	%ds
   22.93 +#else
   22.94 +	xchg	AX, SI
   22.95 +	mov	DI, SI
   22.96 +	sub	BX, SI
   22.97 +	rep movsb %es:(SI), %es:(DI)
   22.98 +	xchg	AX, SI
   22.99 +#endif
  22.100 +	jmp	lz4chunk
  22.101 +
  22.102 +#if defined(NeedLz4mov)
  22.103 +# if defined(PARANOIA)
  22.104 +lz4movlp:
  22.105 +	xchgw	%ax, %cx
  22.106 +	movw	$0x3C00, %cx
  22.107 +	rep movsl
  22.108 +	xchgw	%ax, %cx
  22.109 +	sub	$0xF0, %ch
  22.110 +# endif
  22.111 +lz4mov:
  22.112 +	movw	%ds, %ax
  22.113 +lz4movStr:
  22.114 +	norm	%bp
  22.115 +# if defined(PARANOIA)
  22.116 +	cmp	$0xFF, %ch	// catch FFFX case
  22.117 +	jz	lz4movlp
  22.118 +# endif
  22.119 +	rep movsb
  22.120 +	ret
  22.121 +#endif
  22.122 +
  22.123 +lz4len:				// get length in %ecx
  22.124 +	andl	$0xF, %eax
  22.125 +	movl	%eax, %ecx
  22.126 +	cmpb	$0xF, %al
  22.127 +	jne	lz4quit
  22.128 +lz4len2:
  22.129 +	lodsb
  22.130 +	decl	%edx		// remaining chunk size
  22.131 +	addw	%ax, %cx
  22.132 +	cmpb	$0xFF, %al
  22.133 +	je	lz4len2
  22.134 +lz4quit:
  22.135 +	ret
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/plop/stuff/unlzsa1.S	Sun Feb 05 09:28:51 2023 +0000
    23.3 @@ -0,0 +1,195 @@
    23.4 +// Lzsa1Decode:
    23.5 +#ifndef FLAT32
    23.6 +//   input   ds:si=inStream, es:di=outStream
    23.7 +//   output  outStream[], ds:si, es:di
    23.8 +	.code16
    23.9 +#define AX	%ax
   23.10 +#define BX	%bx
   23.11 +#define SI	%si
   23.12 +#define DI	%di
   23.13 +#else
   23.14 +//   input   esi=inStream, edi=outStream
   23.15 +//   output  outStream[], ds:esi, es:edi
   23.16 +	.code32
   23.17 +#define AX	%eax
   23.18 +#define BX	%ebx
   23.19 +#define SI	%esi
   23.20 +#define DI	%edi
   23.21 +#endif
   23.22 +
   23.23 +MATCH_RUN_LEN		=	15
   23.24 +LITERALS_RUN_LEN	=	7
   23.25 +MIN_MATCH_SIZE		=	3
   23.26 +MIN_LITERALS_SIZE	=	0
   23.27 +
   23.28 +#define PACKED_ONLY			// assume no copy block, optional
   23.29 +//#define PARANOIA			// cover rare cases, optional
   23.30 + 
   23.31 +lzsa1main:
   23.32 +#ifdef PARANOIA
   23.33 +	cld
   23.34 +#endif
   23.35 +#ifndef RAW_FORMAT
   23.36 +# if defined(PARANOIA) && !defined(FLAT32) && !defined(FLAT16)
   23.37 +	xorw	%cx, %cx
   23.38 +	call	normalize
   23.39 +# endif
   23.40 +# ifndef NO_LZSA1_HEADER
   23.41 +	lodsw
   23.42 +	cmpw	$0x9E7B, %ax	// magic
   23.43 +	jne	lzsa1main
   23.44 +	lodsb
   23.45 +	cmpb	$0, %al		// lzsa1
   23.46 +	jne	lzsa1main
   23.47 +# endif
   23.48 +lzsa1block:			// uncompress chunk
   23.49 +	lodsw			// block size
   23.50 +	xchgw	%ax, %cx
   23.51 +	lodsb
   23.52 +# ifndef PACKED_ONLY
   23.53 +	orb	%al, %al
   23.54 +	jns	lzsa1compressed
   23.55 +#  if !defined(FLAT32) && !defined(FLAT16OUT)
   23.56 +	movw	%cx, %dx
   23.57 +	movb	$0, %cl
   23.58 +	movb	$0, %dh
   23.59 +copytail:
   23.60 +	call	lzsa1movStr
   23.61 +	xchg	%dx, %cx
   23.62 +	incw	%cx
   23.63 +	loop	copytail
   23.64 +#  else
   23.65 +	movsb			// copy block
   23.66 +copylp:
   23.67 +	movsb			// copy block
   23.68 +	loop	copylp		// handle 64K case
   23.69 +#  endif
   23.70 +	jmp	lzsa1block
   23.71 +lzsa1compressed:
   23.72 +	jne	lzsa1chunk	// 64Kb block
   23.73 +# endif
   23.74 +	jcxz	lzsa1quit	// bail if we hit EOD
   23.75 +	pushw	%cx
   23.76 +# if !defined(FLAT32) && !defined(FLAT16)
   23.77 +	xorw	%cx, %cx
   23.78 +	call	normalize
   23.79 +# define NeedNormalize
   23.80 +# endif
   23.81 +	popw	%dx
   23.82 +	addw	%si, %dx
   23.83 +#endif
   23.84 +lzsa1chunk:			// uncompress chunk
   23.85 +	lodsb			// get token O|LLL|MMMM
   23.86 +	movb	%al, %bl	// keep token in bl
   23.87 +	shrb	$4, %al		// shift literals length into place
   23.88 +	movw	$LITERALS_RUN_LEN*256+MIN_LITERALS_SIZE, %cx
   23.89 +	call	lzsa1len	// %ch = LITERALS_RUN_LEN
   23.90 +#if defined(NeedNormalize)
   23.91 +	call	lzsa1movLit	// copy %cx literals from %ds:%si to %es:%di
   23.92 +#else
   23.93 +	rep	movsb		// copy %cx literals from %ds:%si to %es:%di
   23.94 +#endif
   23.95 +#ifndef RAW_FORMAT
   23.96 +	cmpw	%dx, %si
   23.97 +	jae	lzsa1block	// bail if we hit EOD
   23.98 +#endif
   23.99 +#ifdef FLAT32
  23.100 +	orl	$-1, %eax
  23.101 +#else
  23.102 +	movb	$-1, %ah
  23.103 +#endif
  23.104 +	testb	%bl, %bl	// check match offset size in token (O bit)
  23.105 +	jns	lzsa1ShortOfs
  23.106 +	lodsw
  23.107 +	.byte	0x3C		// mask lodsb with cmpb $0xAC, %al
  23.108 +lzsa1ShortOfs:
  23.109 +	lodsb
  23.110 +#ifdef RAW_FORMAT
  23.111 +	orw	%ax, %ax
  23.112 +	jz	lzsa1quit	// bail if we hit EOD
  23.113 +#endif
  23.114 +	xchg	AX, BX		// %bx: match offset  %ax: original token
  23.115 +	movw	$MATCH_RUN_LEN*256+MIN_MATCH_SIZE, %cx
  23.116 +	call	lzsa1len
  23.117 +#if !defined(FLAT32) && !defined(FLAT16OUT)
  23.118 +	pushw	%ds
  23.119 +	pushw	%si
  23.120 +	movw	%di, %si
  23.121 +	addw	%bx, %si
  23.122 +	movw	%es, %ax
  23.123 +	jc	axok
  23.124 +	subb	$0x10, %ah
  23.125 +axok:
  23.126 +.macro norm	reg
  23.127 +	movw	%si, \reg
  23.128 +	subw	%si, %dx
  23.129 +	andw	$0xF, %si
  23.130 +	addw	%si, %dx
  23.131 +	shrw	$4, \reg
  23.132 +	addw	\reg, %ax
  23.133 +	movw	%ax, %ds
  23.134 +	movw	%di, \reg
  23.135 +	andw	$0xF, %di
  23.136 +	shrw	$4, \reg
  23.137 +	movw	%es, %ax
  23.138 +	addw	\reg, %ax
  23.139 +	movw	%ax, %es
  23.140 +.endm 
  23.141 +	pushw	%dx
  23.142 +# if defined(NeedNormalize) || defined(PARANOIA)
  23.143 +	call	lzsa1movStr	// copy string
  23.144 +# else
  23.145 +	norm	%bp
  23.146 +	rep movsb
  23.147 +# endif
  23.148 +	popw	%dx
  23.149 +	popw	%si
  23.150 +	popw	%ds
  23.151 +#else
  23.152 +	xchg	AX, SI		// save %si	
  23.153 +	lea	(BX,DI), SI
  23.154 +	rep movsb	%es:(SI), %es:(DI)
  23.155 +	xchg	AX, SI		// restore %si	
  23.156 +#endif
  23.157 +	jmp	lzsa1chunk
  23.158 +
  23.159 +lzsa1len:			// get length in %ecx
  23.160 +	andb	%ch, %al
  23.161 +	cbw			// clear %ah
  23.162 +	cmpb	%ch, %al
  23.163 +	jne	lzsa1minNumber	// S=0-6, L=0-14
  23.164 +	lodsb
  23.165 +	addb	%ch, %cl
  23.166 +lzsa1minNumber:
  23.167 +	addb	%cl, %al
  23.168 +	jnc	lzsa1gotNumber  // 0-255
  23.169 +	movb	%al, %ah	// S=256-1791, L=256-3839 or S=256-511, L=256-511
  23.170 +	jne	lzsa1midNumber
  23.171 +	lodsw			// 0-65535
  23.172 +	.byte	0x3C		// mask lodsb with cmpb $0xAC, %al
  23.173 +lzsa1midNumber:
  23.174 +	lodsb
  23.175 +lzsa1gotNumber:
  23.176 +	xchgw	%ax, %cx
  23.177 +lzsa1quit:
  23.178 +	ret
  23.179 +
  23.180 +#if defined(NeedNormalize) || defined(PARANOIA)
  23.181 +# if defined(PARANOIA)
  23.182 +lzsa1movlp:
  23.183 +	decw	%ch
  23.184 +	rep movsb
  23.185 +	incw	%ch
  23.186 +# endif
  23.187 +normalize:
  23.188 +lzsa1movLit:
  23.189 +	movw	%ds, %ax
  23.190 +lzsa1movStr:
  23.191 +	norm	%bp
  23.192 +# if defined(PARANOIA)
  23.193 +	cmpb	$0xFF, %ch	// catch FFFX case
  23.194 +	je	lzsa1movlp
  23.195 +# endif
  23.196 +	rep movsb
  23.197 +	ret
  23.198 +#endif
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/plop/stuff/unlzsa2.S	Sun Feb 05 09:28:51 2023 +0000
    24.3 @@ -0,0 +1,271 @@
    24.4 +// Lzsa2Decode:
    24.5 +#ifndef FLAT32
    24.6 +//   input   ds:si=inStream, es:di=outStream
    24.7 +//   output  outStream[], ds:si, es:di
    24.8 +	.code16
    24.9 +#define AX	%ax
   24.10 +#define BX	%bx
   24.11 +#define BP	%bp
   24.12 +#define SI	%si
   24.13 +#define DI	%di
   24.14 +#else
   24.15 +//   input   esi=inStream, edi=outStream
   24.16 +//   output  outStream[], ds:esi, es:edi
   24.17 +	.code32
   24.18 +#define AX	%eax
   24.19 +#define BX	%ebx
   24.20 +#define BP	%ebp
   24.21 +#define SI	%esi
   24.22 +#define DI	%edi
   24.23 +#endif
   24.24 +
   24.25 +MATCH_RUN_LEN		=	7
   24.26 +LITERALS_RUN_LEN	=	3
   24.27 +MIN_MATCH_SIZE		=	2
   24.28 +MIN_LITERALS_SIZE	=	0
   24.29 +
   24.30 +#define PACKED_ONLY			// assume no copy block, optional
   24.31 +//#define PARANOIA			// cover rare cases, optional
   24.32 + 
   24.33 +lzsa2main:
   24.34 +#ifdef PARANOIA
   24.35 +	cld
   24.36 +#endif
   24.37 +#ifndef RAW_FORMAT
   24.38 +# if defined(PARANOIA) && !defined(FLAT32) && !defined(FLAT16)
   24.39 +	xorw	%cx, %cx
   24.40 +	call	normalize
   24.41 +# endif
   24.42 +# ifndef NO_LZSA2_HEADER
   24.43 +	lodsw
   24.44 +	cmpw	$0x9E7B, %ax	// magic
   24.45 +	jne	lzsa2main
   24.46 +	lodsb
   24.47 +	testb	$0x20, %al	// lzsa2
   24.48 +	je	lzsa2main
   24.49 +# endif
   24.50 +lzsa2block:			// uncompress chunk
   24.51 +# if !defined(FLAT32) && !defined(FLAT16)
   24.52 +	xorw	%cx, %cx
   24.53 +	call	normalize
   24.54 +# endif
   24.55 +	lodsw			// block size
   24.56 +	xchgw	%ax, %cx
   24.57 +	lodsb
   24.58 +# ifndef PACKED_ONLY
   24.59 +	orb	%al, %al
   24.60 +	jns	lzsa2compressed
   24.61 +#  if !defined(FLAT32) && !defined(FLAT16OUT)
   24.62 +	movw	%cx, %dx
   24.63 +	movb	$0, %cl
   24.64 +	movb	$0, %dh
   24.65 +copytail:
   24.66 +	call	lzsa1movStr
   24.67 +	xchg	%dx, %cx
   24.68 +	incw	%cx
   24.69 +	loop	copytail
   24.70 +#  else
   24.71 +	movsb			// copy block
   24.72 +copylp:
   24.73 +	movsb			// copy block
   24.74 +	loop	copylp		// handle 64K case
   24.75 +#  endif
   24.76 +	jmp	lzsa2block
   24.77 +lzsa2compressed:
   24.78 +	jne	lzsa2chunk	// 64Kb block
   24.79 +# endif
   24.80 +	jcxz	lzsa2quit	// bail if we hit EOD
   24.81 +# if !defined(FLAT16)
   24.82 +	pushw	%cx
   24.83 +	xorw	%cx, %cx
   24.84 +	call	normalize
   24.85 +# define NeedNormalize
   24.86 +	popw	%dx
   24.87 +	addw	%si, %dx
   24.88 +# else
   24.89 +	movw	%si, %dx
   24.90 +	addw	%cx, %dx
   24.91 +# endif
   24.92 +#else
   24.93 +# if !defined(FLAT16)
   24.94 +	xorw	%cx, %cx
   24.95 +	call	normalize
   24.96 +# define NeedNormalize
   24.97 +# endif
   24.98 +#endif
   24.99 +	movb	$0, %bh		// no nibble stored
  24.100 +lzsa2chunk:			// uncompress chunk
  24.101 +	lodsb			// get token XYZ|LL|MMM
  24.102 +	movb	%al, %bl	// keep token in bl
  24.103 +	movw	$LITERALS_RUN_LEN+256*MIN_LITERALS_SIZE, %cx
  24.104 +	shrb	%cl, %al	// shift literals length into place
  24.105 +	call	lzsa2len	// %cl = LITERALS_RUN_LEN
  24.106 +#if defined(NeedNormalize)
  24.107 +	pushw	%bp
  24.108 +	call	lzsa2movLit	// copy %cx literals from %ds:%si to %es:%di
  24.109 +	popw	%bp
  24.110 +#else
  24.111 +	rep	movsb		// copy %cx literals from %ds:%si to %es:%di
  24.112 +#endif
  24.113 +#ifndef RAW_FORMAT
  24.114 +maxsi:
  24.115 +	cmpw	%dx, %si
  24.116 +	jae	lzsa2block	// bail if we hit EOD
  24.117 +#endif
  24.118 +#ifdef FLAT32
  24.119 +	orl	$-1, %eax	// set offset bits 31-8 to 1
  24.120 +#else
  24.121 +	movb	$-1, %ah	// set offset bits 15-8 to 1
  24.122 +#endif
  24.123 +// XYZ
  24.124 +	testb	$0xC0, %bl	// check match offset mode in token (X bit)
  24.125 +	bt	$5, %bx		// move bit 5 to carry
  24.126 +	js	rep_match_or_large_offset
  24.127 +	jne	offset_9_bit
  24.128 +// 00Z 5-bit offset: read a nibble for offset bits 1-4 and use the inverted bit Z of the token as bit 0 of the offset.
  24.129 +//                   set bits 5-15 of the offset to 1.
  24.130 +	call	getByteFromNibbleAndC
  24.131 +	jmp	get_match_length
  24.132 +offset_9_bit:
  24.133 +// 01Z 9-bit offset: read a byte for offset bits 0-7 and use the inverted bit Z for bit 8 of the offset.
  24.134 +//                   set bits 9-15 of the offset to 1.
  24.135 +	sbbb	%cl, %ah	// clear bit 8 if Z bit is clear
  24.136 +	jmp	get_match_length_0
  24.137 +
  24.138 +getNibble:
  24.139 +	xorb	$0xF0, %bh	// toggle nibble stored flags
  24.140 +	movb	%bh, %al
  24.141 +	jns	gotnibble
  24.142 +	lodsb
  24.143 +	movb	$0xF0, %bh
  24.144 +	orb	%al, %bh
  24.145 +	shrb	$4, %al
  24.146 +gotnibble:
  24.147 +lzsa2quit:
  24.148 +	ret
  24.149 +
  24.150 +rep_match_or_large_offset:
  24.151 +	jpe	rep_match_or_16_bit
  24.152 +//10Z 13-bit offset: read a nibble for offset bits 9-12 and use the inverted bit Z for bit 8 of the offset,
  24.153 +//                   then read a byte for offset bits 0-7. set bits 13-15 of the offset to 1.
  24.154 +//                   substract 512 from the offset to get the final value.
  24.155 +	call	getByteFromNibbleAndC
  24.156 +	subb	$2, %al		// substract 512
  24.157 +	jmp	get_match_length_1
  24.158 +rep_match_or_16_bit:
  24.159 +	jc	repeat_match	// rep-match
  24.160 +//110 16-bit offset: read a byte for offset bits 8-15, then another byte for offset bits 0-7.
  24.161 +	lodsb			// Get 2-byte match offset
  24.162 +get_match_length_1:
  24.163 +	xchgb	%al, %ah
  24.164 +get_match_length_0:
  24.165 +	lodsb			// load match offset bits 0-7
  24.166 +get_match_length:
  24.167 +	xchgw	%ax, %bp	// bp: offset
  24.168 +repeat_match:
  24.169 +//111 repeat offset: reuse the offset value of the previous match command.
  24.170 +
  24.171 +	movb	%bl, %al	// %al: original token
  24.172 +	movw	$MATCH_RUN_LEN+256*MIN_MATCH_SIZE, %cx
  24.173 +	call	lzsa2len
  24.174 +#ifdef RAW_FORMAT
  24.175 +	jz	lzsa2quit	// bail if we hit EOD
  24.176 +#endif
  24.177 +#if !defined(FLAT32) && !defined(FLAT16OUT)
  24.178 +	pushw	%ds
  24.179 +	pushw	%si
  24.180 +	movw	%di, %si
  24.181 +	addw	%bp, %si
  24.182 +	movw	%es, %ax
  24.183 +	jc	axok
  24.184 +	subb	$0x10, %ah
  24.185 +axok:
  24.186 +.macro norm	reg
  24.187 +	movw	%si, \reg
  24.188 +	subw	%si, %dx
  24.189 +	andw	$0xF, %si
  24.190 +	addw	%si, %dx
  24.191 +	shrw	$4, \reg
  24.192 +	addw	\reg, %ax
  24.193 +	movw	%ax, %ds
  24.194 +	movw	%di, \reg
  24.195 +	andw	$0xF, %di
  24.196 +	shrw	$4, \reg
  24.197 +	movw	%es, %ax
  24.198 +	addw	\reg, %ax
  24.199 +	movw	%ax, %es
  24.200 +.endm 
  24.201 +	pushw	%bp
  24.202 +	pushw	%dx
  24.203 +# if defined(NeedNormalize) || defined(PARANOIA)
  24.204 +	call	lzsa2movStr	// copy string
  24.205 +# else
  24.206 +	norm	%bp
  24.207 +	rep movsb
  24.208 +# endif
  24.209 +	popw	%dx
  24.210 +	popw	%bp
  24.211 +	popw	%si
  24.212 +	popw	%ds
  24.213 +#else
  24.214 +	xchg	AX, SI		// save %si	
  24.215 +	lea	(BP,DI), SI
  24.216 +	rep movsb	%es:(SI), %es:(DI)
  24.217 +	xchg	AX, SI		// restore %si	
  24.218 +#endif
  24.219 +	jmp	lzsa2chunk
  24.220 +
  24.221 +getByteFromNibbleAndC:
  24.222 +	pushfw
  24.223 +	call	getNibble	// get nibble for offset bits 0-3
  24.224 +	popfw
  24.225 +	rclb	$1, %al
  24.226 +	xorb	$0xE1, %al	// set offset bits 7-5 to 1
  24.227 +	ret
  24.228 +
  24.229 +lzsa2len:			// get length in %cx
  24.230 +	andb	%cl, %al
  24.231 +	cbw			// clear %ah
  24.232 +	cmpb	%al, %cl
  24.233 +	jne	lzsa2minNumber	// S=0-2, L=0-6
  24.234 +	call	getNibble
  24.235 +	cmp	$0xF, %al
  24.236 +	jne	lzsa2noExtraByte
  24.237 +	addb	%al, %ch
  24.238 +	lodsb
  24.239 +lzsa2noExtraByte:
  24.240 +	addb	%cl, %ch
  24.241 +lzsa2minNumber:
  24.242 +	addb	%ch, %al
  24.243 +	jnc	lzsa2gotNumber  // 0-255
  24.244 +#if 0
  24.245 +	je	lzsa2BigNumber
  24.246 +	movb	%al, %ah	// S=256-767, L=256-1791
  24.247 +	lodsb	
  24.248 +	.byte	0xB1		// mask lodsw with movb $0xAD, %cl
  24.249 +lzsa2BigNumber:
  24.250 +#endif
  24.251 +	lodsw			// 0-65535
  24.252 +lzsa2gotNumber:
  24.253 +	xchgw	%ax, %cx
  24.254 +	ret
  24.255 +
  24.256 +#if defined(NeedNormalize) || defined(PARANOIA)
  24.257 +# if defined(PARANOIA)
  24.258 +lzsa2movlp:
  24.259 +	decw	%ch
  24.260 +	rep movsb
  24.261 +	incw	%ch
  24.262 +# endif
  24.263 +normalize:
  24.264 +lzsa2movLit:
  24.265 +	movw	%ds, %ax
  24.266 +lzsa2movStr:
  24.267 +	norm	%bp
  24.268 +# if defined(PARANOIA)
  24.269 +	cmpb	$0xFF, %ch	// catch FFFX case
  24.270 +	je	lzsa2movlp
  24.271 +# endif
  24.272 +	rep movsb
  24.273 +	ret
  24.274 +#endif
    25.1 --- a/plop/stuff/unpack.S	Fri Jan 27 10:37:43 2023 +0100
    25.2 +++ b/plop/stuff/unpack.S	Sun Feb 05 09:28:51 2023 +0000
    25.3 @@ -6,10 +6,11 @@
    25.4  #define KEEP_BOOTSECTOR		1
    25.5  #define LINUX_HEADER		0
    25.6  #define UPDATE_SYSSIZE		1
    25.7 -#define HARDCODED_SYSSIZE	1
    25.8 -#define HARDCODED_SETUPSIZE	1
    25.9  #define FLAT16			1
   25.10  #define FLAT16OUT		1
   25.11 +#define COPYTOHIGHMEM		0
   25.12 +#define UPDATE_CODE32_START	0
   25.13 +#define DOUBLE_PACKED		0
   25.14  #define SAVEREGS		0 
   25.15  #define ELKS			0
   25.16  
   25.17 @@ -21,12 +22,10 @@
   25.18  #undef UPDATE_SYSSIZE
   25.19  #define UPDATE_SYSSIZE		0
   25.20  #endif
   25.21 -#if defined(FLAT16OUT) && FLAT16OUT == 0
   25.22 -#undef FLAT16OUT
   25.23 -#endif
   25.24  #if ELKS
   25.25  	.arch	i8086
   25.26  #define FLAT16			1
   25.27 +#define KEEP_BOOTSECTOR		1
   25.28  #define LINUX_HEADER		0
   25.29  #define SAVEREGS		0 
   25.30  #define TOPSEG		0x2000
   25.31 @@ -34,6 +33,58 @@
   25.32  #define TOPSEG		0x8000
   25.33  #endif
   25.34  
   25.35 +.macro	pusham
   25.36 +#if ELKS
   25.37 +	pushw	%ax
   25.38 +//	movw	%sp, %ax
   25.39 +//	incw	%ax		// emulate popa behaviour
   25.40 +//	incw	%ax
   25.41 +	pushw	%cx
   25.42 +	pushw	%dx
   25.43 +	pushw	%bx
   25.44 +//	pushw	%ax		// %sp
   25.45 +	pushw	%bp
   25.46 +	pushw	%si
   25.47 +	pushw	%di
   25.48 +#else
   25.49 +	pushaw
   25.50 +#endif
   25.51 +.endm 
   25.52 +
   25.53 +.macro	popam
   25.54 +#if ELKS
   25.55 +	popw	%di
   25.56 +	popw	%si
   25.57 +	popw	%bp
   25.58 +//	popw	%ax
   25.59 +	popw	%bx
   25.60 +	popw	%dx
   25.61 +	popw	%cx
   25.62 +	popw	%ax
   25.63 +#else
   25.64 +	popaw
   25.65 +#endif
   25.66 +.endm 
   25.67 +
   25.68 +.macro	pushm	val
   25.69 +#if ELKS
   25.70 +	movw	\val, %ax
   25.71 +	pushw	%ax
   25.72 +#else
   25.73 +	pushw	\val
   25.74 +#endif
   25.75 +.endm 
   25.76 +
   25.77 +.macro	shrwm	cnt, reg
   25.78 +#if ELKS
   25.79 +	.rept	\cnt
   25.80 +	shrw	$1, \reg
   25.81 +	.endr
   25.82 +#else
   25.83 +	shrw	$\cnt, \reg
   25.84 +#endif
   25.85 +.endm
   25.86 +
   25.87  	.globl	_start
   25.88  _start:
   25.89  #if LINUX_HEADER
   25.90 @@ -56,156 +107,82 @@
   25.91  	pushfw
   25.92  	pushw	%cs
   25.93  	pushw	$0
   25.94 -	pushal
   25.95 +	pusham
   25.96 +	xorw	%si, %si
   25.97  	pushw	%ds
   25.98 +	pushw	%es
   25.99  	cld
  25.100  #else
  25.101 -	pushw	%cs
  25.102 -# if FLAT16
  25.103 -	xorw	%di, %di
  25.104 -	pushw	%di
  25.105 -# else
  25.106 -	pushw	$0
  25.107 +	pushw	%cs			// return adress is %cs:0
  25.108 +	xorw	%si, %si
  25.109 +	pushw	%si
  25.110 +#endif	// SAVEREGS
  25.111 +	pushw	%ds			// <A> bootsector+setup segment
  25.112 +#if FLAT16
  25.113 +# 1- move 9000..9020+stp -> TOPSEG
  25.114 +	pushm	$TOPSEG
  25.115 +	popw	%es
  25.116 +# if SAVEREGS
  25.117 +setup_word:
  25.118 +	movw	$SETUP*256+256, %cx
  25.119 +	pushw	%cx			// <B> bootsector+setup words
  25.120  # endif
  25.121 -#endif
  25.122 -#if ELKS
  25.123 -	movw	$0x100, %ax
  25.124 -	pushw	%ax
  25.125 -#else
  25.126 -# if UPDATE_SYSSIZE || KEEP_BOOTSECTOR
  25.127 -	pushw	%ds			// <A>
  25.128 -# else
  25.129 -	pushw	%cs			// <A>
  25.130 -# endif
  25.131 -#endif
  25.132 -#if FLAT16
  25.133 -# 1- move 9000/9020..9020+stp -> TOPSEG
  25.134 -#if ELKS
  25.135 -	movb	$TOPSEG/256, %ah
  25.136 -	movw	%ax, %es
  25.137 -#else
  25.138 -	pushw	$TOPSEG
  25.139 -	popw	%es
  25.140 -#endif
  25.141 -#if KEEP_BOOTSECTOR
  25.142 -	xorw	%si, %si
  25.143 -#else
  25.144 -	movw	$0x200, %si
  25.145 -#endif
  25.146 -#if SAVEREGS == 0
  25.147 +	pushw	%es			// <C> TOPSEG
  25.148  	pushw	%es
  25.149 -#if ELKS
  25.150 -# if KEEP_BOOTSECTOR
  25.151 -	movw	$cont+0x200, %ax
  25.152 -# else
  25.153 -	movw	$cont, %ax
  25.154 -# endif
  25.155 -	pushw	%ax
  25.156 -#else
  25.157 -# if KEEP_BOOTSECTOR
  25.158 -	pushw	$cont+0x200
  25.159 -# else
  25.160 -	// pushw	$cont
  25.161 -	.byte	0x6A, cont
  25.162 -# endif
  25.163 -#endif
  25.164 -	jmp	jumpinto
  25.165 -#else
  25.166 -# if HARDCODED_SETUPSIZE
  25.167 -setup_word:
  25.168 -#  if KEEP_BOOTSECTOR
  25.169 -#  else
  25.170 -	movw	$SETUP*256, %cx
  25.171 -#  endif
  25.172 -# else
  25.173 -#  if KEEP_BOOTSECTOR
  25.174 -	movw	$0x100, %cx
  25.175 -	addb	SETUPSIZE, %ch
  25.176 -#  else
  25.177 -	xorw	%cx, %cx
  25.178 -	movb	SETUPSIZE, %ch
  25.179 -#  endif
  25.180 -	movw	%cx, %dx
  25.181 -# endif
  25.182 -	pushw	%cx			// <B>
  25.183 -	pushw	%es
  25.184 -	pushw	%di
  25.185 +# if SAVEREGS
  25.186 +	xorw	%di, %di		// %ds:%si = 9000:0000		%es:%di = TOPSEG:0
  25.187 +	pushm	$0x200+cont
  25.188  	rep
  25.189  	  movsw
  25.190  	lret
  25.191 -#endif
  25.192  cont:
  25.193 +# else
  25.194 +	movw	$-0x200, %di
  25.195 +	call	jumpinto
  25.196 +# endif
  25.197  # 2- move 1000..1000+sys -> TOPSEG+stp
  25.198 -#if ELKS
  25.199 -	movw	$0x1000, %ax
  25.200 -	movw	%ax, %ds
  25.201 -#else
  25.202 -	pushw	$0x1000
  25.203 +	pushm	$0x1000
  25.204  	popw	%ds
  25.205 -#endif
  25.206 -	xorw	%si, %si
  25.207 -	subw	%di, %cx
  25.208 +	xorw	%si, %si		// %ds:%si = 1000:0
  25.209 +	subw	%di, %cx		// %cx = 64K - setupsz
  25.210  	rep
  25.211  	  movsb
  25.212  # 3- unlz(TOPSEG+stp:end, 1000-stp:0)
  25.213 -	pushw	%es		// <C>
  25.214 -# if HARDCODED_SETUPSIZE
  25.215  setup_seg:
  25.216 -#if ELKS
  25.217 -#  if KEEP_BOOTSECTOR
  25.218 -#   if UPDATE_SYSSIZE
  25.219 -	movw	$0x1000-(SETUP*32)-32-32, %ax
  25.220 -#   else
  25.221 -	movw	$0x1000-(SETUP*32)-32, %ax
  25.222 -#   endif
  25.223 -#  else
  25.224 -#   if UPDATE_SYSSIZE
  25.225 -	movw	$0x1000-(SETUP*32)-32, %ax
  25.226 -#   else
  25.227 -	movw	$0x1000-(SETUP*32), %ax
  25.228 -#   endif
  25.229 -#  endif
  25.230 -	movw	%ax, %es
  25.231 -#else
  25.232 -#  if KEEP_BOOTSECTOR
  25.233 -#   if UPDATE_SYSSIZE
  25.234 -	pushw	$0x1000-(SETUP*32)-32-32
  25.235 -#   else
  25.236 -	pushw	$0x1000-(SETUP*32)-32
  25.237 -#   endif
  25.238 -#  else
  25.239 -#   if UPDATE_SYSSIZE
  25.240 -	pushw	$0x1000-(SETUP*32)-32
  25.241 -#   else
  25.242 -	pushw	$0x1000-(SETUP*32)
  25.243 -#   endif
  25.244 -#  endif
  25.245 +	pushm	$0x1000-(SETUP*32)-32
  25.246  	popw	%es
  25.247 -#endif
  25.248 +#else		// FLAT16
  25.249 +# 1- move 9020..9020+unpack -> 0700 and jump into
  25.250 +	movw	$0x700, %cx		// Up to 3.5KB for unpacker (unlzma is << 1KB)
  25.251 +	movw	%cx, %es		// Use 7000 .. 7E00, keep up to 23 elks setup sectors
  25.252 +	pushw	%es
  25.253 +	xorw	%di, %di		// %ds:%si = 9000:0000	%es:%di = 0700:0000
  25.254 +	pushm	$0x200+cont
  25.255 +# if SAVEREGS
  25.256 +	rep
  25.257 +	  movsw
  25.258 +	lret
  25.259  # else
  25.260 -#  if UPDATE_SYSSIZE
  25.261 -	incb	%dh
  25.262 -#  endif
  25.263 -#if ELKS
  25.264 -	shrw	$1, %dx
  25.265 -	shrw	$1, %dx
  25.266 -	shrw	$1, %dx
  25.267 -#else
  25.268 -	shrw	$3, %dx
  25.269 -#endif
  25.270 -	movw	%ds, %ax
  25.271 -	subw	%dx, %ax
  25.272 -	movw	%ax, %es
  25.273 +	jmp	jumpinto
  25.274  # endif
  25.275 -#else		// FLAT16
  25.276 -# 1- move 1000..1000+sys -> 9000-sys
  25.277 -# if HARDCODED_SYSSIZE
  25.278 +cont:
  25.279 +# 2- move 9020..9020+stp -> 9000-sys-stp
  25.280 +	movw	%ds, %dx
  25.281 +setup_byte:
  25.282 +	movb	$SETUP+1, %ch
  25.283 +setup_para:
  25.284 +	subw	$SETUP*32+32+0xF000, %dx
  25.285  packed_syssize:
  25.286 -	movw	$0x1000+0, %ax
  25.287 -# else
  25.288 -	movw	SYSSIZE, %ax
  25.289 -	addw	$0x1000, %ax
  25.290 -# endif
  25.291 +	movw	$0+0x1000, %ax
  25.292 +	pushw	%cx			// <B> bootsector+setup words
  25.293 +	subw	%ax, %dx
  25.294 +	movw	%dx, %es
  25.295 +	pushw	%es			// <C> 9000-sys-stp
  25.296 +	xorw	%si, %si
  25.297 +	xorw	%di, %di		// %ds:%si = 9000:0	%es:%di = 9000-sys-stp:0
  25.298 +	rep
  25.299 +	  movsw
  25.300 +# 3- move 1000..1000+sys -> 9000-sys
  25.301  	movw	%ds, %dx
  25.302  mvsys:
  25.303  	decw	%ax
  25.304 @@ -219,136 +196,109 @@
  25.305  	  movsw
  25.306  	cmpw	$0x1000, %ax
  25.307  	jne	mvsys
  25.308 -# 2- move 9000/9020..9020+stp -> 9000-sys-stp
  25.309 -	
  25.310 -# if HARDCODED_SETUPSIZE
  25.311 -#  if KEEP_BOOTSECTOR
  25.312 -setup_byte:
  25.313 -	movb	$SETUP+1, %ch
  25.314 -setup_para:
  25.315 -	subw	$SETUP*32+32, %dx
  25.316 -#  else
  25.317 -setup_byte:
  25.318 -	movb	$SETUP, %ch
  25.319 -setup_para:
  25.320 -	subw	$SETUP*32, %dx
  25.321 -#  endif
  25.322 -# else
  25.323 -	movb	%ss:SETUPSIZE, %ch
  25.324 -#  if KEEP_BOOTSECTOR
  25.325 -	incb	$ch
  25.326 -#  endif
  25.327 -	movw	%cx, %ax
  25.328 -#if ELKS
  25.329 -	shrw	$1, %ax
  25.330 -	shrw	$1, %ax
  25.331 -	shrw	$1, %ax
  25.332 -#else
  25.333 -	shrw	$3, %ax
  25.334 -#endif
  25.335 -	subw	%ax, %dx
  25.336 -# endif
  25.337 -	pushw	%cx			// <B>
  25.338 -	movw	%dx, %es
  25.339 -	xorw	%si, %si
  25.340 -	xorw	%di, %di
  25.341 -	rep
  25.342 -	  movsw	%cs:(%si),%es:(%di)
  25.343 -	pushw	%es
  25.344 -# 3- reloc itself in 0x7C00
  25.345 -	pushw	$0x07C0
  25.346 +# 4- unlz(9000-sys-stp:end, 1000-stp:0)
  25.347 +setup_seg:
  25.348 +	pushm	$0x1000-(SETUP*32)-32
  25.349  	popw	%es
  25.350 -	movw	$cont, %si
  25.351 -	movw	%si, %di
  25.352 -	movw	$end-_start, %cx
  25.353 -	pushw	%es
  25.354 -	pushw	%di
  25.355 -	rep
  25.356 -	  movsb	%cs:(%si),%es:(%di)
  25.357 -	lret
  25.358 -cont:
  25.359 -# 4- unlz(9000-sys-stp:end, 1000-stp:0)
  25.360 -# if HARDCODED_SETUPSIZE
  25.361 -setup_seg:
  25.362 -#  if KEEP_BOOTSECTOR
  25.363 -#   if UPDATE_SYSSIZE
  25.364 -	pushw	$0x1000-(SETUP*32)-32-32
  25.365 -#   else
  25.366 -	pushw	$0x1000-(SETUP*32)-32
  25.367 -#   endif
  25.368 -#  else
  25.369 -#   if UPDATE_SYSSIZE
  25.370 -	pushw	$0x1000-(SETUP*32)-32
  25.371 -#   else
  25.372 -	pushw	$0x1000-(SETUP*32)
  25.373 -#   endif
  25.374 -#  endif
  25.375 -	popw	%es
  25.376 -# else
  25.377 -	negw	%ax
  25.378 -#  if UPDATE_SYSSIZE
  25.379 -	addw	$0x1000-32, %ax
  25.380 -#  else
  25.381 -	addw	$0x1000, %ax
  25.382 -#  endif
  25.383 -	movw	%ax, %es
  25.384 -# endif
  25.385  #endif		// FLAT16
  25.386  	popw	%ds			// <C>
  25.387 +#if FLAT16 && SAVEREGS == 0
  25.388 +	movw	$end-_start, %si	// %ds:%si = TOPSSEG:compressed
  25.389 +#else
  25.390 +	movw	$0x200+end-_start, %si	// %ds:%si = 9000-sys-stp:compressed
  25.391 +#endif
  25.392  #if KEEP_BOOTSECTOR
  25.393 -	movw	$0x200+end-_start, %si
  25.394 +setup_keep:
  25.395 +	xorw	%di, %di
  25.396  #else
  25.397 -	movw	$end-_start, %si
  25.398 +# if UPDATE_SYSSIZE
  25.399 +setup_syssize:
  25.400 +	movw	$0x1F4, %di		// %es:%di = 1000-setup-bootsector:SYSSIZE
  25.401 +# else
  25.402 +	movw	$0x200, %di
  25.403 +# endif
  25.404  #endif
  25.405 -#if UPDATE_SYSSIZE
  25.406 -	movw	$SYSSIZE, %di
  25.407 -#else
  25.408 -	xorw	%di, %di
  25.409 -#endif
  25.410 +	pushw	%di
  25.411 +	pushw	%es
  25.412 +#if DOUBLE_PACKED
  25.413 +double_packed:
  25.414 +	pushm	$0x4000
  25.415 +	popw	%es
  25.416  	pushw	%di
  25.417  	pushw	%es
  25.418  	call	unpack
  25.419  	popw	%ds
  25.420  	popw	%si
  25.421 -#   if KEEP_BOOTSECTOR
  25.422 -setup_keep:
  25.423 -	xorw	%di, %di
  25.424 -#   else
  25.425 +	popw	%es
  25.426 +	popw	%di
  25.427 +	pushw	%di
  25.428 +	pushw	%es
  25.429 +#endif
  25.430 +	call	unpack
  25.431 +#if COPYTOHIGHMEM
  25.432 +# if FLAT16OUT
  25.433 +	movw	$0x9310+1, %ax		// from 1000:FFFF
  25.434 +# else
  25.435 +#  if 0
  25.436 +	movw	%es, %ax
  25.437 +	shrw	$12, %ax
  25.438 +	orw	$0x9310, %ax
  25.439 +#  else
  25.440 +	movw	$0x9310+7, %ax		// from 7000:FFFF
  25.441 +#  endif
  25.442 +# endif
  25.443 +	pushw	%ss
  25.444 +	popw	%es
  25.445 +	movw	$8, %cx
  25.446 +zero1:
  25.447 +	pushw	$0			// 2E..20
  25.448 +	loop	zero1
  25.449 +src:		
  25.450 +	pushw	%cx			// 1E, 16
  25.451 +	pushw	%ax			// 1A: dst %ax:%cx, 12: src %ax:%cx
  25.452 +	pushw	%cx
  25.453 +	pushw	$-1			// 18, 10: full 64K segment
  25.454 +	subb	$0x10, %al
  25.455 +	jnc	src
  25.456 +	movb	$8, %cl
  25.457 +zero2:
  25.458 +	pushw	$0			// 0E..00
  25.459 +	loop	zero2
  25.460 +	movw	%sp, %si
  25.461 +syslp:
  25.462 +	movb	$0x80, %ch	
  25.463 +	movb	$0x87, %ah
  25.464 +	int	$0x15
  25.465 +# if FLAT16OUT == 0
  25.466 +	decb	%es:0x1C(%si)
  25.467 +	decb	%es:0x14(%si)
  25.468 +	jne	syslp			// down to 1000:0000
  25.469 +# endif
  25.470 +	addw	$0x30, %sp
  25.471 +#endif	// COPYTOHIGHMEM
  25.472 +	popw	%ds
  25.473 +	popw	%si			// %ds:%si = 1000-setup-bootsector:SYSSIZE / 0
  25.474 +#if UPDATE_CODE32_START
  25.475 +update_code32_start:
  25.476 +//	movb	$1, 0x216
  25.477 +#endif
  25.478 +#if FLAT16 == 0 || SAVEREGS
  25.479 +	popw	%cx			// <B> bootsector+setup words
  25.480 +#endif
  25.481 +	popw	%es			// <A> bootsector+setup segment
  25.482  	movw	%si, %di
  25.483 -#   endif
  25.484 -#   if SAVEREGS != 0
  25.485 -	popw	%cx			// <B>
  25.486 -#if UPDATE_SYSSIZE
  25.487 -// not need with memtest	movb	$(512-SYSSIZE)/2, %cl
  25.488 +jumpinto:
  25.489 +#if FLAT16 && SAVEREGS == 0
  25.490 +setup_word:
  25.491 +	movw	$SETUP*256+256, %cx
  25.492  #endif
  25.493 -	popw	%es			// <A>
  25.494 -# 5- move 1000-stp..1000 -> 9020
  25.495 -#   else
  25.496 -	popw	%es			// <A>
  25.497 -jumpinto:
  25.498 -# if HARDCODED_SETUPSIZE
  25.499 -setup_word:
  25.500 -#  if KEEP_BOOTSECTOR
  25.501 -	movw	$SETUP*256+256, %cx
  25.502 -#  else
  25.503 -	movw	$SETUP*256, %cx
  25.504 -#  endif
  25.505 -# else
  25.506 -#  if KEEP_BOOTSECTOR
  25.507 -	movw	$0x100, %cx
  25.508 -	addb	%ss:SETUPSIZE, %ch
  25.509 -#  else
  25.510 -	xorw	%cx, %cx
  25.511 -	movb	%ss:SETUPSIZE, %ch
  25.512 -#  endif
  25.513 -	movw	%cx, %dx
  25.514 -# endif
  25.515 -#  endif
  25.516 +# 5- move 1000-stp..1000 -> 9000
  25.517  	rep
  25.518  	  movsw
  25.519  #if SAVEREGS
  25.520 +	popw	%es
  25.521  	popw	%ds
  25.522 -	popal
  25.523 +	popam
  25.524  	iret
  25.525  #else
  25.526  	lret
  25.527 @@ -356,9 +306,18 @@
  25.528  
  25.529  unpack:
  25.530  #define NO_LZMA_HEADER
  25.531 +#define NO_LZSA2_HEADER
  25.532 +#define NO_LZSA1_HEADER
  25.533 +#define NO_LZ4_HEADER
  25.534  #if ELKS
  25.535  #define ONLY8086	1
  25.536  #endif
  25.537 -#include "unlzma.S"
  25.538 +#if defined(FLAT16OUT) && FLAT16OUT == 0
  25.539 +#undef FLAT16OUT
  25.540 +#endif
  25.541 +#if defined(FLAT16) && FLAT16 == 0
  25.542 +#undef FLAT16
  25.543 +#endif
  25.544 +#include "uncompress.S"
  25.545  
  25.546  end:
    26.1 --- a/polkit-pam/receipt	Fri Jan 27 10:37:43 2023 +0100
    26.2 +++ b/polkit-pam/receipt	Sun Feb 05 09:28:51 2023 +0000
    26.3 @@ -8,8 +8,8 @@
    26.4  LICENSE="LGPL2"
    26.5  SOURCE="polkit"
    26.6  TARBALL="$SOURCE-$VERSION.tar.gz"
    26.7 -WEB_SITE="http://www.freedesktop.org/wiki/Software/PolicyKit"
    26.8 -WGET_URL="http://hal.freedesktop.org/releases/$TARBALL"
    26.9 +WEB_SITE="https://www.freedesktop.org/wiki/Software/PolicyKit"
   26.10 +WGET_URL="https://hal.freedesktop.org/releases/$TARBALL"
   26.11  PROVIDE="polkit"
   26.12  
   26.13  DEPENDS="glib libgio gobject-introspection dbus dbus-glib expat pam"
    27.1 --- a/unixODBC-dev/receipt	Fri Jan 27 10:37:43 2023 +0100
    27.2 +++ b/unixODBC-dev/receipt	Sun Feb 05 09:28:51 2023 +0000
    27.3 @@ -6,7 +6,7 @@
    27.4  SHORT_DESC="ODBC for unix - development files."
    27.5  MAINTAINER="pascal.bellard@slitaz.org"
    27.6  LICENSE="LGPL2.1"
    27.7 -WEB_SITE="http://www.unixodbc.org/"
    27.8 +WEB_SITE="https://www.unixodbc.org/"
    27.9  
   27.10  DEPENDS="unixODBC"
   27.11  WANTED="unixODBC"
    28.1 --- a/unixODBC/receipt	Fri Jan 27 10:37:43 2023 +0100
    28.2 +++ b/unixODBC/receipt	Sun Feb 05 09:28:51 2023 +0000
    28.3 @@ -7,7 +7,7 @@
    28.4  SHORT_DESC="ODBC for unix."
    28.5  MAINTAINER="pascal.bellard@slitaz.org"
    28.6  LICENSE="LGPL2.1"
    28.7 -WEB_SITE="http://www.unixodbc.org/"
    28.8 +WEB_SITE="https://www.unixodbc.org/"
    28.9  
   28.10  TARBALL="$PACKAGE-$VERSION.tar.gz"
   28.11  WGET_URL="${WEB_SITE}$TARBALL"
    29.1 --- a/vpnc-cert/receipt	Fri Jan 27 10:37:43 2023 +0100
    29.2 +++ b/vpnc-cert/receipt	Sun Feb 05 09:28:51 2023 +0000
    29.3 @@ -9,7 +9,7 @@
    29.4  LICENSE="GPL2"
    29.5  TARBALL="$SOURCE-$VERSION.tar.gz"
    29.6  WEB_SITE="https://github.com/streambinder/vpnc"
    29.7 -WGET_URL="https://www.unix-ag.uni-kl.de/~massar/vpnc/$TARBALL"
    29.8 +WGET_URL="https://raw.githubusercontent.com/sailfishos/vpnc/master/$TARBALL"
    29.9  CONFIG_FILES="/etc/vpnc"
   29.10  TAGS="vpn tunnel"
   29.11  PROVIDE="vpnc"
    30.1 --- a/vpnc/receipt	Fri Jan 27 10:37:43 2023 +0100
    30.2 +++ b/vpnc/receipt	Sun Feb 05 09:28:51 2023 +0000
    30.3 @@ -8,7 +8,7 @@
    30.4  LICENSE="GPL2"
    30.5  TARBALL="$PACKAGE-$VERSION.tar.gz"
    30.6  WEB_SITE="https://github.com/streambinder/vpnc"
    30.7 -WGET_URL="https://www.unix-ag.uni-kl.de/~massar/vpnc/$TARBALL"
    30.8 +WGET_URL="https://raw.githubusercontent.com/sailfishos/vpnc/master/$TARBALL"
    30.9  CONFIG_FILES="/etc/vpnc"
   30.10  TAGS="vpn tunnel"
   30.11  
    31.1 --- a/zonecheck/receipt	Fri Jan 27 10:37:43 2023 +0100
    31.2 +++ b/zonecheck/receipt	Sun Feb 05 09:28:51 2023 +0000
    31.3 @@ -8,7 +8,7 @@
    31.4  LICENSE="GPL3"
    31.5  WEB_SITE="https://www.zonemaster.fr/"
    31.6  TARBALL="$PACKAGE-$VERSION.tgz"
    31.7 -WGET_URL="$WEB_SITE/download/$TARBALL"
    31.8 +WGET_URL="https://github.com/sdelafond/zonecheck/archive/refs/tags/upstream/$VERSION.tar.gz"
    31.9  CONFIG_FILES="/etc/zonecheck"
   31.10  
   31.11  DEPENDS="ruby"