Memtest86+: Difference between revisions

From coreboot
Jump to navigation Jump to search
(Created page with "== Building == === Memtest86+ === $ '''mkdir foo''' $ '''cd foo''' $ '''wget http://www.memtest.org/download/4.20/memtest86+-4.20.tar.gz''' $ '''tar xfvz memtest86+-4.20.t...")
 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Building  ==
== Building  ==


=== Memtest86+ ===
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.


$ '''mkdir foo'''
=== Manual build ===
$ '''cd foo'''
$ '''wget http://www.memtest.org/download/4.20/memtest86+-4.20.tar.gz'''
$ '''tar xfvz memtest86+-4.20.tar.gz'''
$ '''cd memtest86+-4.20'''
(Optional: edit '''config.h''' and set '''#define SERIAL_CONSOLE_DEFAULT 1''' for serial support)
$ '''make'''


The file '''memtest''' is your final payload which you can use with coreboot, either on real hardware or in a [[QEMU]] image.
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 '''


=== coreboot ===
CD to the directory and build it:
 
  $ '''cd memtest86plus'''
Finally, you have to build coreboot with Memtest86+ as payload:
  $ '''make'''
 
$ '''cd ..'''
$ '''svn co svn://coreboot.org/coreboot/trunk coreboot'''
$ '''cp memtest86+-4.20/memtest coreboot/payload.elf'''
  $ '''cd coreboot'''
  $ '''make menuconfig'''


Now enter the '''Payload''' menu and select '''Payload type''' and then '''An ELF executable payload file'''. Then, exit the menu, save your settings, and build coreboot:
The resulting binaries are:
 
memtest: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
  $ '''make'''
  memtest.bin: DOS/MBR boot sector


The file '''build/coreboot.rom''' is your final coreboot image, which also contains the payload.
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

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