diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-10-25 23:05:42 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-10-25 23:05:42 -0400 |
commit | 59c35f25b85357603dd28a974d38845577d9a091 (patch) | |
tree | 5142e8310e7e7e0d79ee8bf7aae957b1a31adbc2 /src/coreboot.c | |
parent | 943f3be16d68760ce77b0950caecd70bbac887bd (diff) | |
download | seabios-59c35f25b85357603dd28a974d38845577d9a091.tar.gz |
Add support for more than 4Gig of ram.
This is based on code in kvm.
Diffstat (limited to 'src/coreboot.c')
-rw-r--r-- | src/coreboot.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/coreboot.c b/src/coreboot.c index 1b1d3336..d92a67fc 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -197,7 +197,7 @@ coreboot_fill_map() if (!cbm) goto fail; - u64 maxram = 0; + u64 maxram = 0, maxram_over4G = 0; int i, count = MEM_RANGE_COUNT(cbm); for (i=0; i<count; i++) { struct cb_memory_range *m = &cbm->map[i]; @@ -205,19 +205,25 @@ coreboot_fill_map() if (type == CB_MEM_TABLE) { type = E820_RESERVED; scan_tables(m->start, m->size); + } else if (type == E820_ACPI || type == E820_RAM) { + u64 end = m->start + m->size; + if (end > 0x100000000ull) { + end -= 0x100000000ull; + if (end > maxram_over4G) + maxram_over4G = end; + } else if (end > maxram) + maxram = end; } - if ((type == E820_ACPI || type == E820_RAM) - && (m->start + m->size) > maxram) - maxram = m->start + m->size; add_e820(m->start, m->size, type); } + SET_EBDA(ram_size, maxram); + SET_EBDA(ram_size_over4G, maxram_over4G); + // Ughh - coreboot likes to set a map at 0x0000-0x1000, but this // confuses grub. So, override it. add_e820(0, 16*1024, E820_RAM); - SET_EBDA(ram_size, maxram); - // XXX - just create dummy smbios table for now - should detect if // smbios/dmi table is found from coreboot and use that instead. smbios_init(); |