--- sys/boot/i386/libi386/biossmap.c.orig 2011-02-25 17:10:39.000000000 +0900 +++ sys/boot/i386/libi386/biossmap.c 2011-04-22 22:28:22.377995843 +0900 @@ -119,6 +119,25 @@ cur = next; } } + + /* A quick fix for the kernel panic problem on GA-E7AUM-DS2H with over 2GB of RAM. + http://miko.org/~tatyana/tech/FreeBSD/FreeBSD_on_GA-E7AUM-DS2H_with_Over_2GB_of_RAM.html */ + + // Check if these memory range isn't overlapping each other. + for (u_int p = 0; p < smaplen; ++p) { + if (smapbase[p].type == 1) { // 1 means it is a free area + for (u_int q = 0; q < smaplen; ++q) { + if (smapbase[q].type != 1) { // !1 means it is a restricted area + if (smapbase[p].base < smapbase[q].base && + smapbase[q].base < smapbase[p].base + smapbase[p].length) { + // If a free area (p) is overlapped with a restricted area (q), + // shrink the memory size and try to avoid the problem. + smapbase[p].length = smapbase[q].base - smapbase[p].base; + } + } + } + } + } } void