Memtest86+: Difference between revisions

From coreboot
Jump to navigation Jump to search
m (slightly rephrased, cosmetic fixes)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:


Instead of building coreboot with MemTest86+ as its default payload, it is recommended to simply load the binary from your payload of choice as an extra boot option.
Instead of building coreboot with MemTest86+ as its default payload, it is recommended to simply load the binary from your payload of choice as an extra boot option.
You can also build it directly from the coreboot build by selecting it as a 'seconday payload' from the payloads menu.


=== Manual build ===
=== Manual build ===


First download the latest tarball, extract and cd into it:
Clone the source from coreboot's memtest86+ repository.  This was based on the latest released archive, then cleaned up, and then had various patches applied.
  $ '''curl -O http://www.memtest.org/download/5.01/memtest86+-5.01.tar.gz'''
  $ '''git clone https://review.coreboot.org/memtest86plus '''
$ '''tar -xvzf memtest86+-5.01.tar.gz && cd memtest86+-5.01'''


The default '''Makefile''' includes a scp command to backup already built binaries, which we obviously don't want. Furthermore, due to MemTest86+ 5.01 not being updated since 27.09.2013, compilation will fail on newer versions of GCC unless a specific option is added. Last but not least '''SERIAL_BAUD_RATE''' should be increased; we might also want to hear a beep before memory testing starts. The following patch includes all those changes, feel free to adjust.
CD to the directory and build it:
--- Makefile    2015-11-18 23:49:40.900093793 +0100
  $ '''cd memtest86plus'''
+++ Makefile.new        2015-11-19 00:08:37.392634002 +0100
  $ '''make'''
@@ -15,3 +15,3 @@
  CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
-      -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
+      -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector -fgnu89-inline
@@ -23,3 +23,2 @@
  all: clean memtest.bin memtest
-                scp memtest.bin root@192.168.0.12:/srv/tftp/mt86plus
--- config.h    2015-11-18 23:49:27.696700200 +0100
+++ config.h.new        2015-11-19 00:08:55.799401157 +0100
@@ -19,3 +19,3 @@
  /* BEEP_MODE - Beep on error. Default off, Change to 1 to enable */
-#define BEEP_MODE 0
+#define BEEP_MODE 1
@@ -37,3 +37,3 @@
  /* SERIAL_BAUD_RATE - Baud rate for the serial console */
-#define SERIAL_BAUD_RATE 9600
+#define SERIAL_BAUD_RATE 115200
Either make those changes by hand or paste the patch into a file and apply it:
  $ '''patch < fix.patch'''
 
Now build it:
  $ '''make -j$(nproc)'''


The resulting binaries are:
The resulting binaries are:

Latest revision as of 20:12, 12 March 2018

Building

Instead of building coreboot with MemTest86+ as its default payload, it is recommended to simply load the binary from your payload of choice as an extra boot option. You can also build it directly from the coreboot build by selecting it as a 'seconday payload' from the payloads menu.

Manual build

Clone the source from coreboot's memtest86+ repository. This was based on the latest released archive, then cleaned up, and then had various patches applied.

$ git clone https://review.coreboot.org/memtest86plus 

CD to the directory and build it:

$ cd memtest86plus
$ make

The resulting binaries are:

memtest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
memtest.bin: DOS/MBR boot sector

In case GRUB2 is used default payload, add the x86-bootable memtest.bin to your ROM image with

$ cbfstool coreboot.rom add -f memtest.bin -n memtest.bin -t raw

and add the following entry to your grub.cfg:

menuentry 'MemTest86+ 5.01' {
    set root='cbfsdisk'
    linux16 /memtest.bin
}

Alternatively one can also load it directly from disk, e.g. by placing it under /boot/memtest.bin and adjusting the menuentry accordingly:

search -n --set=root -f /boot/memtest.bin