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:
It is compiled like this:
You can find the address and range of the bad RAM by using the program Memtest86+.
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