summaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-06-12 00:58:36 -0400
committerGabe Black <gblack@eecs.umich.edu>2008-06-12 00:58:36 -0400
commitbceaa257a38d62c91317cecc78f4dba46654eb93 (patch)
tree2db79f7f87f798e4d28553c72e8dd9d1185f3026 /configs
parent4f4ff17578846018e06b0b9b047df96a8346efd9 (diff)
downloadgem5-bceaa257a38d62c91317cecc78f4dba46654eb93.tar.xz
X86: Make the e820 table manually or automatically configurable from python.
Diffstat (limited to 'configs')
-rw-r--r--configs/common/FSConfig.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 369d845c1..1c33b6b2a 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -168,9 +168,25 @@ def makeLinuxX86System(mem_mode, mdesc = None):
# Physical memory
self.membus = Bus(bus_id=1)
- self.physmem = PhysicalMemory(range = AddrRange('4GB')) #range = AddrRange(mdesc.mem()))
+ self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
self.physmem.port = self.membus.port
+ # We assume below that there's at least 1MB of memory. We'll require 2
+ # just to avoid corner cases.
+ assert(self.physmem.range.second >= 0x200000)
+
+ # Mark the first megabyte of memory as reserved
+ self.e820_table.entries.append(X86E820Entry(
+ addr = 0,
+ size = '1MB',
+ range_type = 2))
+
+ # Mark the rest as available
+ self.e820_table.entries.append(X86E820Entry(
+ addr = 0x100000,
+ size = '%dB' % (self.physmem.range.second - 0x100000 - 1),
+ range_type = 1))
+
# North Bridge
self.iobus = Bus(bus_id=0)
self.bridge = Bridge(delay='50ns', nack_delay='4ns')