BadRAM for FreeBSD

A program that stops bad memory from damaging programs and data.

Avoiding the bad parts of computer memory can make computers run fine.

Personally I have a laptop with bad RAM, and these chips are soldered to the motherboard, so they cannot be removed, and I run FreeBSD on it. So I had to do something. Soldering in new chips, trowing computer away, or making computer avoid it.

Linux has a program called BadRAM, part of the kernel now, or the Grub2 boot system, in which the placement of memory errors can be given, so the computer can avoid them, and thus work flawlessly.

But for FreeBSD, there was no such thing. (Except perhaps by using Grub2 to boot it.) So I made it.

The principle is to allocate the bad memory as root, and then just sit on it until shutdown, so no other program can use it.

It is used like this, where the first argument is the address, and the second a mask for the bad region:
./BadRAM 0x15726000 0xffffe000 &

It is compiled like this:
gcc -o BadRAM BadRAM-FreeBSD_v0.0.c

You can find the address and range of the bad RAM by using the program Memtest86+.

Source code:

Here it is:
BadRAM-FreeBSD_v0.0.c

This program is very new, hardly tested, and the code is only partly cleaned, so do not even expect it to work. If you have trouble making it work, do not contact me. If you have debugged or tested it properly, you may contact me.

By Kim yhus (C) 2012.16.12

kim.oyhus@gmail.com