wok rev 25508

Up memtest (6.10)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Feb 12 10:26:56 2023 +0000 (21 months ago)
parents a11b45a08141
children 2d4208bebf51
files memtest-serial/receipt memtest/receipt memtest/stuff/memtest86+-5.01-386.patch memtest/stuff/memtest86+-5.01-Os.patch memtest/stuff/memtest86+-5.01-array-size.patch memtest/stuff/memtest86+-5.01-io.patch memtest/stuff/memtest86+-5.01-scp.patch memtest/stuff/memtest86+-5.01-setup.patch memtest/stuff/unpack.S
line diff
     1.1 --- a/memtest-serial/receipt	Sat Feb 11 10:36:59 2023 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,33 +0,0 @@
     1.4 -# SliTaz package receipt.
     1.5 -
     1.6 -PACKAGE="memtest-serial"
     1.7 -VERSION="5.01"
     1.8 -CATEGORY="base-system"
     1.9 -SHORT_DESC="Memory failures detection tool using serial port."
    1.10 -MAINTAINER="pascal.bellard@slitaz.org"
    1.11 -LICENSE="GPL2"
    1.12 -WEB_SITE="https://www.memtest.org/"
    1.13 -WANTED="memtest"
    1.14 -PROVIDE="memtest"
    1.15 -
    1.16 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.17 -genpkg_rules()
    1.18 -{
    1.19 -	mkdir -p $fs/boot
    1.20 -	cp $src/memtest.packed-115200 $fs/boot/memtest.exe
    1.21 -}
    1.22 -
    1.23 -# Pre and post install commands for Tazpkg.
    1.24 -post_install()
    1.25 -{
    1.26 -	[ -s $1/boot/isolinux/isolinux.cfg ] &&
    1.27 -	! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \
    1.28 -'s|LABEL md5|LABEL memtest mem ram\
    1.29 -	MENU LABEL Check memory\
    1.30 -	KERNEL /boot/memtest.exe\
    1.31 -\n&|' $1/boot/isolinux/isolinux.cfg
    1.32 -	cat <<EOT
    1.33 -
    1.34 -Output to vga and serial port. Default kernel cmdline: console=ttyS0,115200e8
    1.35 -EOT
    1.36 -}
     2.1 --- a/memtest/receipt	Sat Feb 11 10:36:59 2023 +0000
     2.2 +++ b/memtest/receipt	Sun Feb 12 10:26:56 2023 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  # SliTaz package receipt.
     2.5  
     2.6  PACKAGE="memtest"
     2.7 -VERSION="5.01"
     2.8 +VERSION="6.10"
     2.9  CATEGORY="base-system"
    2.10  SHORT_DESC="Memory failures detection tool."
    2.11  MAINTAINER="pascal.bellard@slitaz.org"
    2.12 @@ -9,9 +9,9 @@
    2.13  SOURCE="memtest86+"
    2.14  TARBALL="$SOURCE-$VERSION.tar.gz"
    2.15  WEB_SITE="https://www.memtest.org/"
    2.16 -WGET_URL="${WEB_SITE}download/archives/$VERSION/$TARBALL"
    2.17 +WGET_URL="https://github.com/memtest86plus/memtest86plus/archive/refs/tags/v$VERSION.tar.gz"
    2.18  
    2.19 -BUILD_DEPENDS="xz lz4 lzsa"
    2.20 +BUILD_DEPENDS="xz lz4 lzsa gcc83"
    2.21  
    2.22  # What is the latest version available today?
    2.23  current_version()
    2.24 @@ -66,23 +66,12 @@
    2.25  # Rules to configure and make the package.
    2.26  compile_rules()
    2.27  {
    2.28 -	# binutils 2.37 support
    2.29 -	sed -i 's|\t}|&\n\t/DISCARD/ : { *(*) }|' memtest.bin.lds
    2.30 -
    2.31 -	ls $stuff/memtest*-$VERSION-*.patch &&
    2.32 -	for i in $stuff/memtest*-$VERSION-*.patch ; do
    2.33 -		patch -p1 < $i
    2.34 -	done
    2.35 -	make
    2.36 -	mv memtest.bin memtest.bin.console
    2.37 -	tune_lzma memtest.bin.console 218,mf=bt2 LC 2
    2.38 -	sed -i  -e 's/SERIAL_CONSOLE_DEFAULT 0/SERIAL_CONSOLE_DEFAULT 1/' \
    2.39 -		-e 's/SERIAL_BAUD_RATE 9600/SERIAL_BAUD_RATE 115200/' config.h
    2.40 -	make clean
    2.41 -	make
    2.42 -	mv memtest.bin memtest.bin.serial
    2.43 -	tune_lzma memtest.bin.serial 179,mf=bt3 LC 2
    2.44 -	cp memtest.bin.serial.lzma memtest.packed-115200
    2.45 +	# Need CPUID instruction (586+ cpu)
    2.46 +	sed -i 's|64, MT_VERSION "." GIT_HASH|65, MT_VERSION ".SliTaz"|;s|"\.x32"|".586"|' app/display.c
    2.47 +	sed 's|gcc|gcc-83|' -i build32/Makefile
    2.48 +	cd build32
    2.49 +	make memtest.bin
    2.50 +	tune_lzma memtest.bin 122,mf=bt4 LC 3 PB 2
    2.51  } 
    2.52  
    2.53  
    2.54 @@ -91,8 +80,7 @@
    2.55  {
    2.56  	mkdir -p $fs/boot $install/usr/share/doc
    2.57  	cp $src/README* $install/usr/share/doc
    2.58 -	cp $src/FAQ $install/usr/share/doc
    2.59 -	cp $src/memtest.bin.console.lzma $fs/boot/memtest.exe
    2.60 +	cp $src/build32/memtest.bin.lzma $fs/boot/memtest.exe
    2.61  }
    2.62  
    2.63  # Pre and post install commands for Tazpkg.
     3.1 --- a/memtest/stuff/memtest86+-5.01-386.patch	Sat Feb 11 10:36:59 2023 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,105 +0,0 @@
     3.4 ---- memtest86+-5.01/cpuid.c
     3.5 -+++ memtest86+-5.01/cpuid.c
     3.6 -@@ -14,6 +14,15 @@
     3.7 - 	unsigned int *v, dummy[3];
     3.8 - 	char *p, *q;
     3.9 - 
    3.10 -+	switch (has_cpuid(AC_BIT|CPUID_BIT)) {
    3.11 -+        case 0:
    3.12 -+	    cpu_id.vers.bits.family = 3;
    3.13 -+	    return;
    3.14 -+        case AC_BIT:
    3.15 -+	    cpu_id.vers.bits.family = 4;
    3.16 -+	    return;
    3.17 -+	}
    3.18 -+	    
    3.19 - 	/* Get max std cpuid & vendor ID */
    3.20 - 	cpuid(0x0, &cpu_id.max_cpuid, &cpu_id.vend_id.uint32_array[0],
    3.21 - 	    &cpu_id.vend_id.uint32_array[2], &cpu_id.vend_id.uint32_array[1]);
    3.22 ---- memtest86+-5.01/cpuid.h
    3.23 -+++ memtest86+-5.01/cpuid.h
    3.24 -@@ -11,6 +11,26 @@
    3.25 - 
    3.26 - extern struct cpu_ident cpu_id;
    3.27 - 
    3.28 -+#define AC_BIT		(1<<18)
    3.29 -+#define CPUID_BIT	(1<<21)
    3.30 -+static inline int has_cpuid(int bits)
    3.31 -+{
    3.32 -+	int eax, edx;
    3.33 -+	asm __volatile__(
    3.34 -+		"pushfl\n\t"
    3.35 -+		"popl %0\n\t"
    3.36 -+		"movl %0,%1\n\t"
    3.37 -+		"xorl %2,%0\n\t"
    3.38 -+		"pushl %0\n\t"
    3.39 -+		"popfl\n\t"
    3.40 -+		"pushfl\n\t"
    3.41 -+		"popl %0\n\t"
    3.42 -+		"pushl %1\n\t"
    3.43 -+		"popfl\n\t"
    3.44 -+		"xorl %1,%0":"=a" (eax),"=d" (edx):"c" (bits));
    3.45 -+	return eax;
    3.46 -+}
    3.47 -+
    3.48 - static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
    3.49 -                                 unsigned int *ecx, unsigned int *edx)
    3.50 - {
    3.51 ---- memtest86+-5.01/init.c
    3.52 -+++ memtest86+-5.01/init.c
    3.53 -@@ -77,6 +77,7 @@
    3.54 - 	cprint(19, 15, "==> Press F2 to force Multi-Threading (SMP) <==");				
    3.55 - 	}
    3.56 - 
    3.57 -+	if (cpu_id.fid.bits.rdtsc) {
    3.58 - 	/* save the starting time */
    3.59 - 	asm __volatile__(
    3.60 - 		"rdtsc":"=a" (sl),"=d" (sh));
    3.61 -@@ -122,6 +123,7 @@
    3.62 - 		}				
    3.63 - 			
    3.64 - 	}
    3.65 -+	}
    3.66 - 	
    3.67 - 	cprint(18, 18, "                                          ");
    3.68 - 	cprint(19, 15, "                                                ");
    3.69 -@@ -321,7 +323,9 @@
    3.70 - 		beep(1000);
    3.71 - 	
    3.72 - 	/* Record the start time */
    3.73 -+	if (cpu_id.fid.bits.rdtsc) {
    3.74 -   asm __volatile__ ("rdtsc":"=a" (v->startl),"=d" (v->starth));
    3.75 -+  	}
    3.76 -   v->snapl = v->startl;
    3.77 -   v->snaph = v->starth;
    3.78 - 	if (l1_cache == 0) { l1_cache = 64; }
    3.79 -@@ -998,10 +1002,18 @@
    3.80 - 	default:
    3.81 - 		/* Make a guess at the family */
    3.82 - 		switch(cpu_id.vers.bits.family) {
    3.83 -+		case 3:
    3.84 -+			cprint(0, COL_MID, "386");
    3.85 -+			break;
    3.86 -+		case 4:
    3.87 -+			cprint(0, COL_MID, "486");
    3.88 -+			break;
    3.89 - 		case 5:
    3.90 - 			cprint(0, COL_MID, "586");
    3.91 -+			break;
    3.92 - 		case 6:
    3.93 - 			cprint(0, COL_MID, "686");
    3.94 -+			break;
    3.95 - 		default:
    3.96 - 			cprint(0, COL_MID, "Unidentified Processor");
    3.97 - 		}
    3.98 ---- memtest86+-5.01/test.c
    3.99 -+++ memtest86+-5.01/test.c
   3.100 -@@ -1501,6 +1501,8 @@
   3.101 - {
   3.102 - 	ulong sh, sl, l, h, t, ip=0;
   3.103 - 
   3.104 -+	if (cpu_id.fid.bits.rdtsc == 0) return;
   3.105 -+	
   3.106 - 	/* save the starting time */
   3.107 - 	asm __volatile__(
   3.108 - 		"rdtsc":"=a" (sl),"=d" (sh));
     4.1 --- a/memtest/stuff/memtest86+-5.01-Os.patch	Sat Feb 11 10:36:59 2023 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,11 +0,0 @@
     4.4 ---- memtest86+-5.01/Makefile	2014-01-08 01:30:11.355900076 +0000
     4.5 -+++ memtest86+-5.01/Makefile	2014-01-08 01:31:19.387555469 +0000
     4.6 -@@ -12,7 +12,7 @@
     4.7 - AS=as -32
     4.8 - CC=gcc
     4.9 - 
    4.10 --CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
    4.11 -+CFLAGS= -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin \
    4.12 - 	-ffreestanding -fPIC $(SMP_FL) -fno-stack-protector 
    4.13 - 	
    4.14 - OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
     5.1 --- a/memtest/stuff/memtest86+-5.01-array-size.patch	Sat Feb 11 10:36:59 2023 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,47 +0,0 @@
     5.4 ---- memtest86+-5.01/controller.c	2013-08-10 02:01:58.000000000 +0000
     5.5 -+++ memtest86+-5.01/controller.c	2013-12-12 20:58:12.873555378 +0000
     5.6 -@@ -292,7 +292,7 @@
     5.7 - 
     5.8 - 	/* First, locate the PCI bus where the MCH is located */
     5.9 - 
    5.10 --	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
    5.11 -+	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
    5.12 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
    5.13 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
    5.14 - 		vid &= 0xFFFF;
    5.15 -@@ -327,7 +327,7 @@
    5.16 - 	ctrl.mode = ECC_NONE;
    5.17 - 
    5.18 - 	/* First, locate the PCI bus where the MCH is located */
    5.19 --	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
    5.20 -+	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
    5.21 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
    5.22 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
    5.23 - 		vid &= 0xFFFF;
    5.24 -@@ -1424,7 +1424,7 @@
    5.25 - 	unsigned long dramchr;
    5.26 - 	float clockratio;
    5.27 - 	double dramclock;
    5.28 --	unsigned int dummy[3];
    5.29 -+	unsigned int dummy[4];
    5.30 - 	int ram_type;
    5.31 - 
    5.32 - 	float coef = 10;
    5.33 -@@ -3680,7 +3680,7 @@
    5.34 - static void poll_timings_k16(void) {
    5.35 - 
    5.36 - 	ulong dramt0, dramt1;
    5.37 --	int cas, rcd, rp, rc, ras;
    5.38 -+	int cas, rcd, rp, ras;
    5.39 - 	
    5.40 - 	pci_conf_read(0, 24, 2, 0x200, 4, &dramt0);
    5.41 - 	pci_conf_read(0, 24, 2, 0x204, 4, &dramt1);	
    5.42 -@@ -3690,7 +3690,7 @@
    5.43 - 	rp = ((dramt0 >> 16) & 0x1F);
    5.44 - 	ras = ((dramt0 >> 24) & 0x3F);
    5.45 - 	
    5.46 --	rc = (dramt1 & 0x3F);	
    5.47 -+	//int rc = (dramt1 & 0x3F);	
    5.48 - 	
    5.49 - 	print_ram_line(cas, rcd, rp, ras, 1);
    5.50 - }
     6.1 --- a/memtest/stuff/memtest86+-5.01-io.patch	Sat Feb 11 10:36:59 2023 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,20 +0,0 @@
     6.4 ---- memtest86+-5.01/io.h	2013-08-10 02:01:58.000000000 +0000
     6.5 -+++ memtest86+-5.01/io.h	2014-01-08 01:29:12.404465515 +0000
     6.6 -@@ -31,7 +31,7 @@
     6.7 -  */
     6.8 - 
     6.9 - #define __OUT1(s,x) \
    6.10 --extern inline void __out##s(unsigned x value, unsigned short port) {
    6.11 -+static inline void __out##s(unsigned x value, unsigned short port) {
    6.12 - 
    6.13 - #define __OUT2(s,s1,s2) \
    6.14 - __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
    6.15 -@@ -43,7 +43,7 @@
    6.16 - __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
    6.17 - 
    6.18 - #define __IN1(s) \
    6.19 --extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
    6.20 -+static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
    6.21 - 
    6.22 - #define __IN2(s,s1,s2) \
    6.23 - __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
     7.1 --- a/memtest/stuff/memtest86+-5.01-scp.patch	Sat Feb 11 10:36:59 2023 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,10 +0,0 @@
     7.4 ---- memtest86+-5.01/Makefile
     7.5 -+++ memtest86+-5.01/Makefile
     7.6 -@@ -21,7 +21,6 @@
     7.7 -       
     7.8 - 
     7.9 - all: clean memtest.bin memtest 
    7.10 --		 scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus
    7.11 - 
    7.12 - # Link it statically once so I know I don't have undefined
    7.13 - # symbols and then link it dynamically so I have full
     8.1 --- a/memtest/stuff/memtest86+-5.01-setup.patch	Sat Feb 11 10:36:59 2023 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,69 +0,0 @@
     8.4 ---- memtest86+-5.01/setup.S
     8.5 -+++ memtest86+-5.01/setup.S
     8.6 -@@ -27,11 +27,11 @@
     8.7 - #ljmp	$INITSEG, $(reload - start + 0x200)
     8.8 - reload:
     8.9 - 	movw	$INITSEG, %ax
    8.10 --	movw	%ax, %ds
    8.11 - 	movw	%ax, %es
    8.12 - 	movw	%ax, %fs
    8.13 -+	movw	%ax, %gs
    8.14 - 	movw	%ax, %ss	# reset the stack to INITSEG:0x4000-12.
    8.15 --	movw	%dx, %sp
    8.16 -+	movw	$0x4000-12, %sp
    8.17 - 	push	%cs
    8.18 - 	pop	%ds
    8.19 - 	lidt	idt_48 - start	# load idt with 0,0
    8.20 -@@ -50,13 +50,13 @@
    8.21 -      	jz	alt_a20_done
    8.22 -      	
    8.23 -      	/* set or clear bit1, the ALT_A20_GATE bit */
    8.24 --     	movb	4(%esp), %ah
    8.25 --     	testb	%ah, %ah
    8.26 --     	jz	alt_a20_cont1
    8.27 -+     	//movb	4(%esp), %ah
    8.28 -+     	//testb	%ah, %ah
    8.29 -+     	//jz	alt_a20_cont1
    8.30 -      	orb	$2, %al
    8.31 --     	jmp	alt_a20_cont2
    8.32 -+     	//jmp	alt_a20_cont2
    8.33 - alt_a20_cont1:
    8.34 --	and	$0xfd, %al
    8.35 -+	//and	$0xfd, %al
    8.36 - 
    8.37 - 	/* clear the INIT_NOW bit; don't accidently reset the machine */
    8.38 - alt_a20_cont2:
    8.39 -@@ -87,9 +87,9 @@
    8.40 - 	movw	$KERNEL_DS, %ax
    8.41 - 	movw	%ax, %ds
    8.42 - 	movw	%ax, %es
    8.43 --	movw	%ax, %ss
    8.44 - 	movw	%ax, %fs
    8.45 - 	movw	%ax, %gs
    8.46 -+	movw	%ax, %ss
    8.47 - 
    8.48 - data32	ljmp	$KERNEL_CS, $(TSTLOAD <<4)	# jmp offset 2000 of segment 0x10 (cs)
    8.49 - 
    8.50 -@@ -100,18 +100,16 @@
    8.51 -  * No timeout is used - if this hangs there is something wrong with
    8.52 -  * the machine, and we probably couldn't proceed anyway.
    8.53 -  */
    8.54 -+has_output:
    8.55 -+	call	delay
    8.56 -+	inb	$0x60, %al	# read it
    8.57 - empty_8042:
    8.58 - 	call	delay
    8.59 - 	inb	$0x64, %al	# 8042 status port
    8.60 - 	cmpb	$0xff, %al	# from grub-a20-patch, skip if not impl
    8.61 - 	jz	empty_8042_ret
    8.62 - 	testb	$1, %al		# output buffer?
    8.63 --	jz	no_output
    8.64 --	call	delay
    8.65 --	inb	$0x60, %al	# read it
    8.66 --	jmp	empty_8042
    8.67 --	
    8.68 --no_output:
    8.69 -+	jnz	has_output
    8.70 - 	testb	$2, %al		# is input buffer full?
    8.71 - 	jnz	empty_8042	# yes - loop
    8.72 - empty_8042_ret:
     9.1 --- a/memtest/stuff/unpack.S	Sat Feb 11 10:36:59 2023 +0000
     9.2 +++ b/memtest/stuff/unpack.S	Sun Feb 12 10:26:56 2023 +0000
     9.3 @@ -5,11 +5,11 @@
     9.4  
     9.5  #define KEEP_BOOTSECTOR		0
     9.6  #define LINUX_HEADER		0
     9.7 -#define UPDATE_SYSSIZE		1
     9.8 +#define UPDATE_SYSSIZE		0
     9.9  #define FLAT16			1	// lzma case
    9.10  #define FLAT16OUT		0
    9.11  #define COPYTOHIGHMEM		0
    9.12 -#define UPDATE_CODE32_START	0
    9.13 +#define UPDATE_CODE32_START	1
    9.14  #define DOUBLE_PACKED		0
    9.15  #define SAVEREGS		0 
    9.16  #define ELKS			0