summaryrefslogtreecommitdiff
path: root/configs/common/FSConfig.py
diff options
context:
space:
mode:
authorChris Emmons <Chris.Emmons@arm.com>2015-03-19 04:06:14 -0400
committerChris Emmons <Chris.Emmons@arm.com>2015-03-19 04:06:14 -0400
commit142ab40c4b57315e20c924d0615470ee24f46d9e (patch)
treeea8fb6bcea5b95fbbef2ab28d5530843a8f36fb6 /configs/common/FSConfig.py
parent9b4d8030e6d106e8ddae7b9940fe8f07d2621660 (diff)
downloadgem5-142ab40c4b57315e20c924d0615470ee24f46d9e.tar.xz
config: Specify OS type and release on command line
This patch enables users to speficy --os-type on the command line. This option is used to take specific actions for an OS type, such as changing the kernel command line. This patch is part of the Android KitKat enablement.
Diffstat (limited to 'configs/common/FSConfig.py')
-rw-r--r--configs/common/FSConfig.py39
1 files changed, 35 insertions, 4 deletions
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index 462b8f6f7..cfc156649 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -43,6 +43,18 @@ from m5.objects import *
from Benchmarks import *
from m5.util import *
+# Populate to reflect supported os types per target ISA
+os_types = { 'alpha' : [ 'linux' ],
+ 'mips' : [ 'linux' ],
+ 'sparc' : [ 'linux' ],
+ 'x86' : [ 'linux' ],
+ 'arm' : [ 'linux',
+ 'android-gingerbread',
+ 'android-ics',
+ 'android-jellybean',
+ 'android-kitkat' ],
+ }
+
class CowIdeDisk(IdeDisk):
image = CowDiskImage(child=RawDiskImage(read_only=True),
read_only=False)
@@ -54,7 +66,6 @@ class MemBus(SystemXBar):
badaddr_responder = BadAddr()
default = Self.badaddr_responder.pio
-
def fillInCmdline(mdesc, template, **kwargs):
kwargs.setdefault('disk', mdesc.disk())
kwargs.setdefault('rootdev', mdesc.rootdev())
@@ -286,11 +297,31 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,
self.gic_cpu_addr = self.realview.gic.cpu_addr
self.flags_addr = self.realview.realview_io.pio_addr + 0x30
- # Android disk images must have 'android' keyword in the disk name
- # Look for 'android' in disk name and append /init to boot_osflags
+ # This check is for users who have previously put 'android' in
+ # the disk image filename to tell the config scripts to
+ # prepare the kernel with android-specific boot options. That
+ # behavior has been replaced with a more explicit option per
+ # the error message below. The disk can have any name now and
+ # doesn't need to include 'android' substring.
if (os.path.split(mdesc.disk())[-1]).lower().count('android'):
- cmdline += " init=/init "
+ if 'android' not in mdesc.os_type():
+ fatal("It looks like you are trying to boot an Android " \
+ "platform. To boot Android, you must specify " \
+ "--os-type with an appropriate Android release on " \
+ "the command line.")
+
+ # android-specific tweaks
+ if 'android' in mdesc.os_type():
+ # generic tweaks
+ cmdline += " init=/init"
+
+ # release-specific tweaks
+ if 'kitkat' in mdesc.os_type():
+ cmdline += " androidboot.hardware=gem5 qemu=1 qemu.gles=0 " + \
+ "android.bootanim=0"
+
self.boot_osflags = fillInCmdline(mdesc, cmdline)
+
self.realview.attachOnChipIO(self.membus, self.bridge)
self.realview.attachIO(self.iobus)
self.intrctrl = IntrControl()