from m5.defines import buildEnv
class SysConfig:
- def __init__(self, script=None, mem=None, disk=None, rootdev=None):
+ def __init__(self, script=None, mem=None, disk=None, rootdev=None,
+ os_type='linux'):
self.scriptname = script
self.diskname = disk
self.memsize = mem
self.root = rootdev
+ self.ostype = os_type
def script(self):
if self.scriptname:
else:
return '/dev/sda1'
+ def os_type(self):
+ return self.ostype
+
# Benchmarks are defined as a key in a dict which is a list of SysConfigs
# The first defined machine is the test system, the others are driving systems
'MutexTest': [SysConfig('mutex-test.rcS', '128MB')],
'ArmAndroid-GB': [SysConfig('null.rcS', '256MB',
- 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img')],
+ 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.clean.img',
+ None, 'android-gingerbread')],
'bbench-gb': [SysConfig('bbench-gb.rcS', '256MB',
- 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img')],
+ 'ARMv7a-Gingerbread-Android.SMP.mouse.nolock.img',
+ None, 'android-gingerbread')],
'ArmAndroid-ICS': [SysConfig('null.rcS', '256MB',
- 'ARMv7a-ICS-Android.SMP.nolock.clean.img')],
+ 'ARMv7a-ICS-Android.SMP.nolock.clean.img',
+ None, 'android-ics')],
'bbench-ics': [SysConfig('bbench-ics.rcS', '256MB',
- 'ARMv7a-ICS-Android.SMP.nolock.img')]
+ 'ARMv7a-ICS-Android.SMP.nolock.img',
+ None, 'android-ics')]
}
benchs = Benchmarks.keys()
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)
badaddr_responder = BadAddr()
default = Self.badaddr_responder.pio
-
def fillInCmdline(mdesc, template, **kwargs):
kwargs.setdefault('disk', mdesc.disk())
kwargs.setdefault('rootdev', mdesc.rootdev())
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()
import CpuConfig
import MemConfig
+from FSConfig import os_types
+
def _listCpuTypes(option, opt, value, parser):
CpuConfig.print_cpu_list()
sys.exit(0)
# System options
parser.add_option("--kernel", action="store", type="string")
+ parser.add_option("--os-type", action="store", type="choice",
+ choices=os_types[buildEnv['TARGET_ISA']], default="linux",
+ help="Specifies type of OS to boot")
parser.add_option("--script", action="store", type="string")
parser.add_option("--frame-capture", action="store_true",
help="Stores changed frame buffers from the VNC server to compressed "\
else:
if options.dual:
bm = [SysConfig(disk=options.disk_image, rootdev=options.root_device,
- mem=options.mem_size),
+ mem=options.mem_size, os_type=options.os_type),
SysConfig(disk=options.disk_image, rootdev=options.root_device,
- mem=options.mem_size)]
+ mem=options.mem_size, os_type=options.os_type)]
else:
bm = [SysConfig(disk=options.disk_image, rootdev=options.root_device,
- mem=options.mem_size)]
+ mem=options.mem_size, os_type=options.os_type)]
np = options.num_cpus