diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-21 10:05:52 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-05-21 11:44:57 +0200 |
commit | bd363b8030716a759823d8828690e49ad4d25f96 (patch) | |
tree | d076b65a5aaf526ce49ccddc5a566ae64f2e82c4 /main.c | |
parent | 3d284aa77f35b743679cd2be9b78b592b36c425f (diff) | |
download | qboot-bd363b8030716a759823d8828690e49ad4d25f96.zip qboot-bd363b8030716a759823d8828690e49ad4d25f96.tar.gz qboot-bd363b8030716a759823d8828690e49ad4d25f96.tar.bz2 |
build e820 entries for low RAM
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -88,9 +88,19 @@ static void extract_e820(void) panic(); size = fw_cfg_file_size(id); - e820.nr_map = size / sizeof(e820.map[0]); + e820.nr_map = size / sizeof(e820.map[0]) + 4; fw_cfg_file_select(id); - fw_cfg_read(&e820.map, size); + e820.map[0] = (struct e820entry) + { .addr = 0, .size = 639 * 1024, .type = E820_RAM }; /* low RAM */ + e820.map[1] = (struct e820entry) + { .addr = 639 * 1024, .size = 1024, .type = E820_RESERVED }; /* EBDA */ + e820.map[2] = (struct e820entry) + { .addr = 0xe0000, .size = 64 * 1024, .type = E820_NVS }; /* ACPI tables */ + e820.map[3] = (struct e820entry) + { .addr = 0xf0000, .size = 64 * 1024, .type = E820_RESERVED }; /* firmware */ + fw_cfg_read(&e820.map[4], size); + e820.map[4].addr = 1024 * 1024; + e820.map[4].size -= 1024 * 1024; } int main(void) |