In our experience, littered as it is with broken hardware, memory modules are second only to hard drives (with their anachronistic moving parts) in frequency of failure. Unlike the unmistakable i/o errors, bus timeouts, and eventual spin cessation of the disk failure, bad memory’s symptoms can be elusive and sporadic. The system acts flaky. Applications crash. The system goes a little crazy because bits are literally getting mixed up or lost, flowing through gates which have deteriorated due to overheating, electrical surges, or simple old age.
In situations like these, the handiest tool you can possess is a Memtest86 disk. Downloads are available in a few convenient forms; compressed iso images to create bootable cdroms, a binary to make Memtest86 floppies on windows, and source code to build on linux. You can run Memtest86 off bootable floppy or cdrom, or install it as a kernel that can be loaded from lilo.
Memtest86 will test any kind of memory on intel systems. It does a number of tests, which you can read about at http://www.memtest86.com. We usually let Memtest86 do a couple of passes on our systems without errors before declaring the RAM to be good, with high confidence in the memory at that point. Occasionally errors show up because the memory is not compatable with the system, or the DIMMs are incompatable among themselves. Running Memtest86 on a system takes a while, depending on the processor speed and amount of RAM.
And now let’s walk through the building of a Memtest86 floppy:
[usr-4@usr-3 rescue]$ tar xvf memtest86-3.0.tar.gz [usr-4@usr-3 rescue]$ cd memtest86-3.0 [usr-4@usr-3 memtest86-3.0]$ make gcc -E -traditional head.S -o head.s as -o head.o head.s gcc -c -fPIC -Wall -g -O2 -fno-strict-aliasing reloc.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC main.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin test.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC init.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC lib.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC patn.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC screen_buffer.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC config.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC linuxbios.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC memsize.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC pci.c gcc -c -Wall -march=i486 -O -fomit-frame-pointer -fno-builtin -fPIC controller.c ld --warn-constructors --warn-common -static -T memtest_shared.lds -o memtest_shared 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 && \ ld -shared -T memtest_shared.lds -o memtest_shared 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 objcopy -O binary memtest_shared memtest_shared.bin gcc -E -traditional bootsect.S -o bootsect.s as -o bootsect.o bootsect.s gcc -E -traditional setup.S -o setup.s as -o setup.o setup.s ld -T memtest.bin.lds bootsect.o setup.o -b binary memtest_shared.bin -o memtest.bin ld -s -T memtest.lds -b binary memtest_shared.bin -o memtest |
Now, to make a floppy, put a floppy in the drive:
usr-4@usr-3 memtest86-3.0]$ make install dd <memtest.bin >/dev/fd0 bs=8192 10+1 records in 10+1 records out |
Easy as pie. On Windows, just download the precompiled Memtest86, extract it, and run install.bat to make a Memtest86 floppy. If floppies aren’t your style, just download the iso images mentioned above. The README that comes with the linux source code includes instructions on how to install it as a image which can be booted from lilo.
What do you do with bad memory modules? Like us, you probably discard them most unceremoniously. But it’s possible to use them on linux systems. With just a little kernel patch, linux can use the bad memory addresses from Memtest86 to map only the good addresses with little degradation in performance! A great hack, experimentation with which we shall leave as an exercise for the curious. We may be Pollyannas, but have always preferred to dwell on good memories and toss the bad away.