Index: head/sysutils/memtest86+/Makefile =================================================================== --- head/sysutils/memtest86+/Makefile (revision 422979) +++ head/sysutils/memtest86+/Makefile (revision 422980) @@ -1,86 +1,77 @@ # Created by: Andriy Gapon # $FreeBSD$ PORTNAME= memtest86+ -PORTVERSION= 4.20 -PORTREVISION= 2 +PORTVERSION= 5.01 CATEGORIES= sysutils MASTER_SITES= http://www.memtest.org/download/${PORTVERSION}/ MAINTAINER= avg@icyb.net.ua COMMENT= Stand-alone memory test for x86 architecture computers +LICENSE= GPLv2 + ONLY_FOR_ARCHS= i386 amd64 -USES= gmake dos2unix +USES= gmake ALL_TARGET= all PORTDOCS= * -USE_GCC= yes +USE_GCC= 4.8 # Please provide absolute path below (cannot be root) BOOT_DIR?= /boot/opt OPTIONS_DEFINE= SERIAL HISPEED DOCS OPTIONS_DEFAULT= BOOT OPTIONS_MULTI= BOOT_TYPE OPTIONS_MULTI_BOOT_TYPE= ISO BOOT ISO_DESC= Build bootable ISO image BOOT_DESC= Build ELF image loadable by boot2 and loader SERIAL_DESC= Enable serial console at COM1/9600 HISPEED_DESC= Set COM1 serial console speed to 115200 ISO_PLIST_FILES= ${DATADIR}/mt${PORTVERSION:C/\.//}.iso +ISO_BUILD_DEPENDS= genisoimage:sysutils/genisoimage +ISO_ALL_TARGET= iso BOOT_PLIST_FILES= ${BOOT_DIR}/memtest86+ BOOT_PLIST_DIRS= ${BOOT_DIR} +BOOT_SUB_FILES= pkg-message +BOOT_SUB_LIST+= BOOT_DIR=${BOOT_DIR} -.include - -.if ${PORT_OPTIONS:MBOOT} -SUB_FILES= pkg-message -SUB_LIST+= BOOT_DIR=${BOOT_DIR} -.endif - -.if ${PORT_OPTIONS:MISO} -BUILD_DEPENDS+= mkisofs:sysutils/cdrtools -ALL_TARGET+= iso -.endif - -.if ${PORT_OPTIONS:MSERIAL} -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-config.h - -.if ${PORT_OPTIONS:MHISPEED} -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-config.h-115200 -.endif -.endif # WITH_SERIAL - pre-fetch: .if !defined(PACKAGE_BUILDING) @${ECHO} "If you only need bootable ISO image of memtest86+, you can" @${ECHO} "simply download it from http://www.memtest.org/. Use this" @${ECHO} "port if you need ELF image of memtest86+ that can be loaded" @${ECHO} "by boot2 or loader(8), or if you want to use this port to" @${ECHO} "build ISO image with custom tweaks in memtest86+ code." .endif +.include + post-patch: ${REINPLACE_CMD} -e 's|gcc|${CC}|' ${WRKSRC}/Makefile +.if ${PORT_OPTIONS:MSERIAL} + ${REINPLACE_CMD} -e 's|SERIAL_CONSOLE_DEFAULT 0|SERIAL_CONSOLE_DEFAULT 1|' ${WRKSRC}/config.h +. if ${PORT_OPTIONS:MHISPEED} + ${REINPLACE_CMD} -e 's|9600|115200|' ${WRKSRC}/config.h +. endif +.endif do-install: .if ${PORT_OPTIONS:MISO} @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKSRC}/mt${PORTVERSION:C/\.//}.iso ${STAGEDIR}${DATADIR} .endif .if ${PORT_OPTIONS:MBOOT} @${MKDIR} ${STAGEDIR}${BOOT_DIR} # XXX is INSTALL_KLD really appropriate here? XXX ${INSTALL_KLD} ${WRKSRC}/memtest ${STAGEDIR}${BOOT_DIR}/memtest86+ .endif .if ${PORT_OPTIONS:MDOCS} @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR} .endif .include - -RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*} Index: head/sysutils/memtest86+/distinfo =================================================================== --- head/sysutils/memtest86+/distinfo (revision 422979) +++ head/sysutils/memtest86+/distinfo (revision 422980) @@ -1,2 +1,3 @@ -SHA256 (memtest86+-4.20.tar.gz) = 5630ce978d0e6b671891df4253fc5c54659764d0cdfc7515ac0df3d8dd9e8737 -SIZE (memtest86+-4.20.tar.gz) = 206044 +TIMESTAMP = 1465956443 +SHA256 (memtest86+-5.01.tar.gz) = 142127b7953fbd829b1057fb64a78d3340c2b771484230a7347e94530a0d9039 +SIZE (memtest86+-5.01.tar.gz) = 214877 Index: head/sysutils/memtest86+/files/extra-patch-config.h-115200 =================================================================== --- head/sysutils/memtest86+/files/extra-patch-config.h-115200 (revision 422979) +++ head/sysutils/memtest86+/files/extra-patch-config.h-115200 (nonexistent) @@ -1,17 +0,0 @@ ---- config.h.orig -+++ config.h -@@ -13,13 +13,13 @@ - /* SERIAL_CONSOLE_DEFAULT - The default state of the serial console. */ - /* This is normally off since it slows down testing. Change to a 1 */ - /* to enable. */ - #define SERIAL_CONSOLE_DEFAULT 1 - - /* SERIAL_TTY - The default serial port to use. 0=ttyS0, 1=ttyS1 */ - #define SERIAL_TTY 0 - - /* SERIAL_BAUD_RATE - Baud rate for the serial console */ --#define SERIAL_BAUD_RATE 9600 -+#define SERIAL_BAUD_RATE 115200 - - /* BEEP_MODE - Beep on error. Default off, Change to 1 to enable */ - #define BEEP_MODE 0 Property changes on: head/sysutils/memtest86+/files/extra-patch-config.h-115200 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/memtest86+/files/patch-error.c =================================================================== --- head/sysutils/memtest86+/files/patch-error.c (revision 422979) +++ head/sysutils/memtest86+/files/patch-error.c (nonexistent) @@ -1,10 +0,0 @@ ---- error.c 2008-11-16 02:18:14.000000000 +0200 -+++ error.c 2009-02-18 00:27:40.000000000 +0200 -@@ -11,7 +11,6 @@ - - #include "test.h" - #include "config.h" --#include - #include "dmi.h" - - extern int test_ticks, nticks, beepmode; Property changes on: head/sysutils/memtest86+/files/patch-error.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/memtest86+/files/extra-patch-config.h =================================================================== --- head/sysutils/memtest86+/files/extra-patch-config.h (revision 422979) +++ head/sysutils/memtest86+/files/extra-patch-config.h (nonexistent) @@ -1,17 +0,0 @@ ---- config.h.orig -+++ config.h -@@ -13,13 +13,13 @@ - /* SERIAL_CONSOLE_DEFAULT - The default state of the serial console. */ - /* This is normally off since it slows down testing. Change to a 1 */ - /* to enable. */ --#define SERIAL_CONSOLE_DEFAULT 0 -+#define SERIAL_CONSOLE_DEFAULT 1 - - /* SERIAL_TTY - The default serial port to use. 0=ttyS0, 1=ttyS1 */ - #define SERIAL_TTY 0 - - /* SERIAL_BAUD_RATE - Baud rate for the serial console */ - #define SERIAL_BAUD_RATE 9600 - - /* BEEP_MODE - Beep on error. Default off, Change to 1 to enable */ - #define BEEP_MODE 0 Property changes on: head/sysutils/memtest86+/files/extra-patch-config.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/memtest86+/files/extra-patch-Makefile =================================================================== --- head/sysutils/memtest86+/files/extra-patch-Makefile (revision 422979) +++ head/sysutils/memtest86+/files/extra-patch-Makefile (nonexistent) @@ -1,11 +0,0 @@ ---- Makefile.orig -+++ Makefile -@@ -11,7 +11,7 @@ - AS=as -32 - CC=gcc - --CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector -+CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC - - OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ - config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \ Property changes on: head/sysutils/memtest86+/files/extra-patch-Makefile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/memtest86+/files/patch-Makefile =================================================================== --- head/sysutils/memtest86+/files/patch-Makefile (revision 422979) +++ head/sysutils/memtest86+/files/patch-Makefile (revision 422980) @@ -1,33 +1,46 @@ ---- Makefile.orig 2015-01-19 13:24:01.512893165 +0000 -+++ Makefile 2015-01-19 13:24:23.844906601 +0000 -@@ -23,15 +23,15 @@ +--- Makefile.orig 2013-08-10 02:01:58 UTC ++++ Makefile +@@ -21,21 +21,20 @@ OBJS= head.o reloc.o main.o test.o init. + + + 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 # relocation information memtest_shared: $(OBJS) memtest_shared.lds Makefile - $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \ + $(LD) --warn-constructors --warn-common -static --oformat elf32-i386-freebsd -T memtest_shared.lds \ - -o $@ $(OBJS) && \ + -o $@ $(OBJS) && \ - $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS) + $(LD) -shared -Bsymbolic --oformat elf32-i386-freebsd -T memtest_shared.lds -o $@ $(OBJS) memtest_shared.bin: memtest_shared objcopy -O binary $< memtest_shared.bin memtest: memtest_shared.bin memtest.lds - $(LD) -s -T memtest.lds -b binary memtest_shared.bin -o $@ + $(LD) -s --oformat elf32-i386-freebsd -T memtest.lds -b binary memtest_shared.bin -o $@ head.s: head.S config.h defs.h test.h $(CC) -E -traditional $< -o $@ -@@ -58,10 +58,8 @@ - asm: - @./makedos.sh +@@ -47,7 +46,7 @@ setup.s: setup.S config.h defs.h + $(CC) -E -traditional $< -o $@ + memtest.bin: memtest_shared.bin bootsect.o setup.o memtest.bin.lds +- $(LD) -T memtest.bin.lds bootsect.o setup.o -b binary \ ++ $(LD) --oformat elf32-i386-freebsd -T memtest.bin.lds bootsect.o setup.o -b binary \ + memtest_shared.bin -o memtest.bin + + reloc.o: reloc.c +@@ -67,8 +66,7 @@ clean: + rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \ + memtest_shared.bin memtest.iso + -iso: - make all -+iso: all ++iso: all ./makeiso.sh -- rm -f *.o *.s memtest.bin memtest memtest_shared memtest_shared.bin install: all - dd $(FDISK) bs=8192 Index: head/sysutils/memtest86+/files/patch-memtest.lds =================================================================== --- head/sysutils/memtest86+/files/patch-memtest.lds (revision 422979) +++ head/sysutils/memtest86+/files/patch-memtest.lds (revision 422980) @@ -1,11 +1,11 @@ ---- memtest.lds.orig +--- memtest.lds.orig 2013-08-10 02:01:58 UTC +++ memtest.lds -@@ -3,7 +3,7 @@ +@@ -3,7 +3,7 @@ OUTPUT_ARCH(i386); ENTRY(_start); SECTIONS { -- . = 0x5000; -+ . = 0xc0120000; +- . = 0x10000; ++ . = 0xc0120000; _start = . ; .data : { *(.data) Index: head/sysutils/memtest86+/files/patch-setup.S =================================================================== --- head/sysutils/memtest86+/files/patch-setup.S (revision 422979) +++ head/sysutils/memtest86+/files/patch-setup.S (revision 422980) @@ -1,11 +1,11 @@ ---- setup.S 2008-11-16 02:18:14.000000000 +0200 -+++ setup.S 2009-02-18 00:28:02.000000000 +0200 -@@ -42,7 +42,7 @@ start: - jz alt_a20_done - - /* set or clear bit1, the ALT_A20_GATE bit */ -- movb 4(%esp), %ah -+ addr32 movb 4(%esp), %ah - testb %ah, %ah - jz alt_a20_cont1 - orb $2, %al +--- setup.S.orig 2013-08-10 02:01:58 UTC ++++ setup.S +@@ -50,7 +50,7 @@ reload: + jz alt_a20_done + + /* set or clear bit1, the ALT_A20_GATE bit */ +- movb 4(%esp), %ah ++ addr32 movb 4(%esp), %ah + testb %ah, %ah + jz alt_a20_cont1 + orb $2, %al Index: head/sysutils/memtest86+/files/patch-test.c =================================================================== --- head/sysutils/memtest86+/files/patch-test.c (revision 422979) +++ head/sysutils/memtest86+/files/patch-test.c (revision 422980) @@ -1,60 +1,53 @@ ---- test.c 2008-11-16 02:18:14.000000000 +0200 -+++ test.c 2009-02-18 00:27:11.000000000 +0200 -@@ -6,12 +6,11 @@ - * ---------------------------------------------------- - * MemTest86+ V2.01 Specific code (GPL V2.0) - * By Samuel DEMEULEMEESTER, sdemeule@memtest.org - * http://www.canardpc.com - http://www.memtest.org - */ - --#include "test.h" - #include "config.h" +--- test.c.orig 2013-08-10 02:29:44 UTC ++++ test.c +@@ -14,7 +14,6 @@ + #include "stdint.h" + #include "cpuid.h" + #include "smp.h" -#include -+#include "test.h" - #include "dmi.h" - extern int segs, bail; -@@ -1400,6 +1399,20 @@ void sleep(int n, int sms) + extern struct cpu_ident cpu_id; + extern volatile int mstr_cpu; +@@ -1543,6 +1542,19 @@ void sleep(long n, int flag, int me, int } } +static inline unsigned char inb(unsigned int port) +{ + unsigned char data; + + asm __volatile__("inb %1,%0" : "=a" (data) : "id" ((unsigned short)(port))); + return (data); +} + +static inline void outb(unsigned int port, unsigned char data) +{ + asm __volatile__("outb %0,%1" : : "a" (data), "id" ((unsigned short)(port))); +} + -+ /* Beep function */ void beep(unsigned int frequency) -@@ -1407,18 +1420,18 @@ void beep(unsigned int frequency) +@@ -1551,18 +1563,18 @@ void beep(unsigned int frequency) unsigned int count = 1193180 / frequency; // Switch on the speaker - outb_p(inb_p(0x61)|3, 0x61); + outb(inb(0x61)|3, 0x61); // Set command for counter 2, 2 byte write - outb_p(0xB6, 0x43); + outb(0xB6, 0x43); // Select desired Hz - outb_p(count & 0xff, 0x42); + outb(count & 0xff, 0x42); outb((count >> 8) & 0xff, 0x42); // Block for 100 microseconds - sleep(100, 1); + sleep(100, 0, 0, 1); // Switch off the speaker - outb(inb_p(0x61)&0xFC, 0x61); + outb(inb(0x61)&0xFC, 0x61); }