# HG changeset patch # User Pascal Bellard # Date 1676197616 0 # Node ID c9972dbaa043118ab81bb3acd3fe2c884e3ac1bc # Parent a11b45a08141d98392ce20eb60a7b6f7ad18c1d9 Up memtest (6.10) diff -r a11b45a08141 -r c9972dbaa043 memtest-serial/receipt --- a/memtest-serial/receipt Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -# SliTaz package receipt. - -PACKAGE="memtest-serial" -VERSION="5.01" -CATEGORY="base-system" -SHORT_DESC="Memory failures detection tool using serial port." -MAINTAINER="pascal.bellard@slitaz.org" -LICENSE="GPL2" -WEB_SITE="https://www.memtest.org/" -WANTED="memtest" -PROVIDE="memtest" - -# Rules to gen a SliTaz package suitable for Tazpkg. -genpkg_rules() -{ - mkdir -p $fs/boot - cp $src/memtest.packed-115200 $fs/boot/memtest.exe -} - -# Pre and post install commands for Tazpkg. -post_install() -{ - [ -s $1/boot/isolinux/isolinux.cfg ] && - ! grep -qs 'Check memory' $1/boot/isolinux/isolinux.cfg && sed -i \ -'s|LABEL md5|LABEL memtest mem ram\ - MENU LABEL Check memory\ - KERNEL /boot/memtest.exe\ -\n&|' $1/boot/isolinux/isolinux.cfg - cat < Press F2 to force Multi-Threading (SMP) <=="); - } - -+ if (cpu_id.fid.bits.rdtsc) { - /* save the starting time */ - asm __volatile__( - "rdtsc":"=a" (sl),"=d" (sh)); -@@ -122,6 +123,7 @@ - } - - } -+ } - - cprint(18, 18, " "); - cprint(19, 15, " "); -@@ -321,7 +323,9 @@ - beep(1000); - - /* Record the start time */ -+ if (cpu_id.fid.bits.rdtsc) { - asm __volatile__ ("rdtsc":"=a" (v->startl),"=d" (v->starth)); -+ } - v->snapl = v->startl; - v->snaph = v->starth; - if (l1_cache == 0) { l1_cache = 64; } -@@ -998,10 +1002,18 @@ - default: - /* Make a guess at the family */ - switch(cpu_id.vers.bits.family) { -+ case 3: -+ cprint(0, COL_MID, "386"); -+ break; -+ case 4: -+ cprint(0, COL_MID, "486"); -+ break; - case 5: - cprint(0, COL_MID, "586"); -+ break; - case 6: - cprint(0, COL_MID, "686"); -+ break; - default: - cprint(0, COL_MID, "Unidentified Processor"); - } ---- memtest86+-5.01/test.c -+++ memtest86+-5.01/test.c -@@ -1501,6 +1501,8 @@ - { - ulong sh, sl, l, h, t, ip=0; - -+ if (cpu_id.fid.bits.rdtsc == 0) return; -+ - /* save the starting time */ - asm __volatile__( - "rdtsc":"=a" (sl),"=d" (sh)); diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/memtest86+-5.01-Os.patch --- a/memtest/stuff/memtest86+-5.01-Os.patch Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ ---- memtest86+-5.01/Makefile 2014-01-08 01:30:11.355900076 +0000 -+++ memtest86+-5.01/Makefile 2014-01-08 01:31:19.387555469 +0000 -@@ -12,7 +12,7 @@ - AS=as -32 - CC=gcc - --CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \ -+CFLAGS= -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin \ - -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector - - OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/memtest86+-5.01-array-size.patch --- a/memtest/stuff/memtest86+-5.01-array-size.patch Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ ---- memtest86+-5.01/controller.c 2013-08-10 02:01:58.000000000 +0000 -+++ memtest86+-5.01/controller.c 2013-12-12 20:58:12.873555378 +0000 -@@ -292,7 +292,7 @@ - - /* First, locate the PCI bus where the MCH is located */ - -- for(i = 0; i < sizeof(possible_nhm_bus); i++) { -+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); - vid &= 0xFFFF; -@@ -327,7 +327,7 @@ - ctrl.mode = ECC_NONE; - - /* First, locate the PCI bus where the MCH is located */ -- for(i = 0; i < sizeof(possible_nhm_bus); i++) { -+ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); - pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); - vid &= 0xFFFF; -@@ -1424,7 +1424,7 @@ - unsigned long dramchr; - float clockratio; - double dramclock; -- unsigned int dummy[3]; -+ unsigned int dummy[4]; - int ram_type; - - float coef = 10; -@@ -3680,7 +3680,7 @@ - static void poll_timings_k16(void) { - - ulong dramt0, dramt1; -- int cas, rcd, rp, rc, ras; -+ int cas, rcd, rp, ras; - - pci_conf_read(0, 24, 2, 0x200, 4, &dramt0); - pci_conf_read(0, 24, 2, 0x204, 4, &dramt1); -@@ -3690,7 +3690,7 @@ - rp = ((dramt0 >> 16) & 0x1F); - ras = ((dramt0 >> 24) & 0x3F); - -- rc = (dramt1 & 0x3F); -+ //int rc = (dramt1 & 0x3F); - - print_ram_line(cas, rcd, rp, ras, 1); - } diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/memtest86+-5.01-io.patch --- a/memtest/stuff/memtest86+-5.01-io.patch Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- memtest86+-5.01/io.h 2013-08-10 02:01:58.000000000 +0000 -+++ memtest86+-5.01/io.h 2014-01-08 01:29:12.404465515 +0000 -@@ -31,7 +31,7 @@ - */ - - #define __OUT1(s,x) \ --extern inline void __out##s(unsigned x value, unsigned short port) { -+static inline void __out##s(unsigned x value, unsigned short port) { - - #define __OUT2(s,s1,s2) \ - __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" -@@ -43,7 +43,7 @@ - __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; } - - #define __IN1(s) \ --extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; -+static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; - - #define __IN2(s,s1,s2) \ - __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/memtest86+-5.01-scp.patch --- a/memtest/stuff/memtest86+-5.01-scp.patch Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ ---- memtest86+-5.01/Makefile -+++ memtest86+-5.01/Makefile -@@ -21,7 +21,6 @@ - - - all: clean memtest.bin memtest -- scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus - - # Link it statically once so I know I don't have undefined - # symbols and then link it dynamically so I have full diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/memtest86+-5.01-setup.patch --- a/memtest/stuff/memtest86+-5.01-setup.patch Sat Feb 11 10:36:59 2023 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ ---- memtest86+-5.01/setup.S -+++ memtest86+-5.01/setup.S -@@ -27,11 +27,11 @@ - #ljmp $INITSEG, $(reload - start + 0x200) - reload: - movw $INITSEG, %ax -- movw %ax, %ds - movw %ax, %es - movw %ax, %fs -+ movw %ax, %gs - movw %ax, %ss # reset the stack to INITSEG:0x4000-12. -- movw %dx, %sp -+ movw $0x4000-12, %sp - push %cs - pop %ds - lidt idt_48 - start # load idt with 0,0 -@@ -50,13 +50,13 @@ - jz alt_a20_done - - /* set or clear bit1, the ALT_A20_GATE bit */ -- movb 4(%esp), %ah -- testb %ah, %ah -- jz alt_a20_cont1 -+ //movb 4(%esp), %ah -+ //testb %ah, %ah -+ //jz alt_a20_cont1 - orb $2, %al -- jmp alt_a20_cont2 -+ //jmp alt_a20_cont2 - alt_a20_cont1: -- and $0xfd, %al -+ //and $0xfd, %al - - /* clear the INIT_NOW bit; don't accidently reset the machine */ - alt_a20_cont2: -@@ -87,9 +87,9 @@ - movw $KERNEL_DS, %ax - movw %ax, %ds - movw %ax, %es -- movw %ax, %ss - movw %ax, %fs - movw %ax, %gs -+ movw %ax, %ss - - data32 ljmp $KERNEL_CS, $(TSTLOAD <<4) # jmp offset 2000 of segment 0x10 (cs) - -@@ -100,18 +100,16 @@ - * No timeout is used - if this hangs there is something wrong with - * the machine, and we probably couldn't proceed anyway. - */ -+has_output: -+ call delay -+ inb $0x60, %al # read it - empty_8042: - call delay - inb $0x64, %al # 8042 status port - cmpb $0xff, %al # from grub-a20-patch, skip if not impl - jz empty_8042_ret - testb $1, %al # output buffer? -- jz no_output -- call delay -- inb $0x60, %al # read it -- jmp empty_8042 -- --no_output: -+ jnz has_output - testb $2, %al # is input buffer full? - jnz empty_8042 # yes - loop - empty_8042_ret: diff -r a11b45a08141 -r c9972dbaa043 memtest/stuff/unpack.S --- a/memtest/stuff/unpack.S Sat Feb 11 10:36:59 2023 +0000 +++ b/memtest/stuff/unpack.S Sun Feb 12 10:26:56 2023 +0000 @@ -5,11 +5,11 @@ #define KEEP_BOOTSECTOR 0 #define LINUX_HEADER 0 -#define UPDATE_SYSSIZE 1 +#define UPDATE_SYSSIZE 0 #define FLAT16 1 // lzma case #define FLAT16OUT 0 #define COPYTOHIGHMEM 0 -#define UPDATE_CODE32_START 0 +#define UPDATE_CODE32_START 1 #define DOUBLE_PACKED 0 #define SAVEREGS 0 #define ELKS 0