wok rev 24046

memtest,plop: tune lzma compression (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 07 14:52:36 2021 +0000 (5 weeks ago)
parents c4968381aed9
children c1a1d1f23e07
files memtest/receipt memtest/stuff/memtest86+-5.01-O0.patch memtest/stuff/memtest86+-5.01-Os.patch memtest/stuff/unlzma.S plop/receipt plop/stuff/pack plop/stuff/unlzma.S
line diff
     1.1 --- a/memtest/receipt	Thu May 06 12:50:46 2021 +0000
     1.2 +++ b/memtest/receipt	Fri May 07 14:52:36 2021 +0000
     1.3 @@ -36,14 +36,14 @@
     1.4  		patch -p1 < $i
     1.5  	done
     1.6  	make
     1.7 -	tune_lzma 211 PB 3
     1.8 +	tune_lzma 218,mf=bt2 LC 2
     1.9  	./pack memtest.bin memtest.packed
    1.10  	mv memtest.bin memtest.bin.console
    1.11  	sed -i  -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
    1.12  		-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
    1.13  	make clean
    1.14  	make
    1.15 -	tune_lzma 147 LC 2
    1.16 +	tune_lzma 179,mf=bt2 LC 2
    1.17  	./pack memtest.bin memtest.packed-115200
    1.18  	mv memtest.bin memtest.bin.serial
    1.19  } 
     2.1 --- a/memtest/stuff/memtest86+-5.01-O0.patch	Thu May 06 12:50:46 2021 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,11 +0,0 @@
     2.4 ---- memtest86+-5.01/Makefile	2014-01-08 01:30:11.355900076 +0000
     2.5 -+++ memtest86+-5.01/Makefile	2014-01-08 01:31:19.387555469 +0000
     2.6 -@@ -12,7 +12,7 @@
     2.7 - AS=as -32
     2.8 - CC=gcc
     2.9 - 
    2.10 --CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
    2.11 -+CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
    2.12 - 	-ffreestanding -fPIC $(SMP_FL) -fno-stack-protector 
    2.13 - 	
    2.14 - OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/memtest/stuff/memtest86+-5.01-Os.patch	Fri May 07 14:52:36 2021 +0000
     3.3 @@ -0,0 +1,11 @@
     3.4 +--- memtest86+-5.01/Makefile	2014-01-08 01:30:11.355900076 +0000
     3.5 ++++ memtest86+-5.01/Makefile	2014-01-08 01:31:19.387555469 +0000
     3.6 +@@ -12,7 +12,7 @@
     3.7 + AS=as -32
     3.8 + CC=gcc
     3.9 + 
    3.10 +-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
    3.11 ++CFLAGS= -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin \
    3.12 + 	-ffreestanding -fPIC $(SMP_FL) -fno-stack-protector 
    3.13 + 	
    3.14 + OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
     4.1 --- a/memtest/stuff/unlzma.S	Thu May 06 12:50:46 2021 +0000
     4.2 +++ b/memtest/stuff/unlzma.S	Fri May 07 14:52:36 2021 +0000
     4.3 @@ -195,17 +195,21 @@
     4.4  # else
     4.5  	shrb	$8-PROP_LC, %bl
     4.6  # endif
     4.7 +#else
     4.8 +	xor	%bx,%bx
     4.9  #endif
    4.10  
    4.11  #if PROP_LP != 0
    4.12  	movb	posState2(BP), %dl
    4.13 -# ifdef ONLY8086
    4.14 +# if PROP_LC != 0
    4.15 +#  ifdef ONLY8086
    4.16  	movb	$PROP_LC, %cl
    4.17  	shl	%cl, DX
    4.18 -# else
    4.19 +#  else
    4.20  	shl	$PROP_LC, DX
    4.21 +#  endif
    4.22 +	movb	$0, %bh
    4.23  # endif
    4.24 -	movb	$0, %bh
    4.25  	add	BX, DX
    4.26  #endif
    4.27  
     5.1 --- a/plop/receipt	Thu May 06 12:50:46 2021 +0000
     5.2 +++ b/plop/receipt	Fri May 07 14:52:36 2021 +0000
     5.3 @@ -12,6 +12,21 @@
     5.4  
     5.5  BUILD_DEPENDS="xz"
     5.6  
     5.7 +tune_lzma()
     5.8 +{
     5.9 +	cp $stuff/*.S $stuff/pack .
    5.10 +	sed "s/VERSION/$VERSION/;s|lzma1=|&nice=$1,|" -i pack
    5.11 +	while [ -n "$2" ]; do
    5.12 +		sed "s|^#define PROP_$2 .*|#define PROP_$2 $3|" -i unlzma.S
    5.13 +		shift 2
    5.14 +	done
    5.15 +	for i in bootloader unpack ; do
    5.16 +		cc -o $i.o -Wa,-a=$i.lst -c $i.S
    5.17 +		objcopy -O binary $i.o $i.bin
    5.18 +	done
    5.19 +	./pack --build bootloader.bin unpack.bin
    5.20 +}
    5.21 +
    5.22  # Rules to configure and make the package.
    5.23  compile_rules()
    5.24  {
    5.25 @@ -24,13 +39,7 @@
    5.26  0299	01	font=bios
    5.27  029A	00	zoomanimation=off
    5.28  EOT
    5.29 -	cp $stuff/*.S $stuff/pack .
    5.30 -	for i in bootloader unpack ; do
    5.31 -		cc -o $i.o -Wa,-a=$i.lst -c $i.S
    5.32 -		objcopy -O binary $i.o $i.bin
    5.33 -	done
    5.34 -	sed -i "s/VERSION/$VERSION/" pack
    5.35 -	./pack --build bootloader.bin unpack.bin
    5.36 +	tune_lzma 84,mf=bt2 LC 0 PB 0
    5.37  	./pack plpbt.bin plop
    5.38  }
    5.39  
     6.1 --- a/plop/stuff/pack	Thu May 06 12:50:46 2021 +0000
     6.2 +++ b/plop/stuff/pack	Fri May 07 14:52:36 2021 +0000
     6.3 @@ -49,7 +49,7 @@
     6.4  
     6.5  compress()
     6.6  {
     6.7 -	xz -z -e --format=raw --lzma1=mf=bt2,lc=$(bits LC),lp=$(bits LP),pb=$(bits PB),nice=84 --stdout 
     6.8 +	xz -z -e --format=raw --lzma1=lc=$(bits LC),lp=$(bits LP),pb=$(bits PB) --stdout 
     6.9  }
    6.10  
    6.11  main()
     7.1 --- a/plop/stuff/unlzma.S	Thu May 06 12:50:46 2021 +0000
     7.2 +++ b/plop/stuff/unlzma.S	Fri May 07 14:52:36 2021 +0000
     7.3 @@ -18,11 +18,9 @@
     7.4   * Compression with : lzma e src dst -eos -pb2 -lp0 -lc3
     7.5   */
     7.6  
     7.7 -//#define PROP_PB 2
     7.8 -#define PROP_PB 0
     7.9 +#define PROP_PB 2
    7.10  #define PROP_LP 0
    7.11 -//#define PROP_LC 3
    7.12 -#define PROP_LC 0
    7.13 +#define PROP_LC 3
    7.14  #define PROPS (PROP_LC+(PROP_LP*9)+(PROP_PB*45))
    7.15  
    7.16  // static const Byte *Buffer;
    7.17 @@ -197,17 +195,21 @@
    7.18  # else
    7.19  	shrb	$8-PROP_LC, %bl
    7.20  # endif
    7.21 +#else
    7.22 +	xor	%bx,%bx
    7.23  #endif
    7.24  
    7.25  #if PROP_LP != 0
    7.26  	movb	posState2(BP), %dl
    7.27 -# ifdef ONLY8086
    7.28 +# if PROP_LC != 0
    7.29 +#  ifdef ONLY8086
    7.30  	movb	$PROP_LC, %cl
    7.31  	shl	%cl, DX
    7.32 -# else
    7.33 +#  else
    7.34  	shl	$PROP_LC, DX
    7.35 +#  endif
    7.36 +	movb	$0, %bh
    7.37  # endif
    7.38 -	movb	$0, %bh
    7.39  	add	BX, DX
    7.40  #endif
    7.41