configs: fs.py can take multiple disk images on most ISAs

All ISAs except SPARC can now take multiple disk images by passing
the --disk-image option multiple times.

Before this patch, several ISAs automatically mounted a secondary disk
called "linux-bigswap2.img", which had to be in M5_PATH even if the end
user did not want more than one disk. This was the case for for example
for X86 but not ARM.

This change was done to:

* allow ARM to have a second disk image in fs.py, which was not possible,
  and allow other ISAs like X86 and ARM to take any number of disk images

* provide a simpler, more intuitive CLI interface that does not require
  magic disk images to be present in M5_PATH to work for ISAs such as X86.

  Linux does not need that secondary image to boot correctly, so it is
  more friendly to support a minimal setup that requires the least amount
  of binaries to boot, and let supply the second image manually only if
  they need it.

* make fs.py --disk-image work more similarly across all ISAs

SPARC was left with a single disk only because its setup was a bit more
complex and would require further testing.

Change-Id: I8b6e08ae6daf0a5b6cd1d57d285a9677f01eb7ad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23671
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ciro Santilli
2019-10-29 16:00:24 +00:00
committed by Giacomo Travaglini
parent a29aaa364b
commit a6d98140ca
7 changed files with 52 additions and 54 deletions

View File

@@ -98,7 +98,7 @@ class LinuxArmSystemBuilder(object):
"VExpress_GEM5_V1": gem5_kernel,
}
sc = SysConfig(None, self.mem_size, disk_image, "/dev/sda")
sc = SysConfig(None, self.mem_size, [disk_image], "/dev/sda")
system = FSConfig.makeArmSystem(self.mem_mode,
self.machine_type, self.num_cpus,
sc, False, ruby=self.use_ruby)

View File

@@ -51,7 +51,7 @@ options.l2_assoc=2
options.num_cpus = 2
#the system
mdesc = SysConfig(disk = 'linux-x86.img')
mdesc = SysConfig(disks = ['linux-x86.img'])
system = FSConfig.makeLinuxX86System('timing', options.num_cpus,
mdesc=mdesc, Ruby=True)
system.kernel = SysPaths.binary('x86_64-vmlinux-2.6.22.9')

View File

@@ -56,7 +56,7 @@ class LinuxX86SystemBuilder(object):
pass
def create_system(self):
mdesc = SysConfig(disk = 'linux-x86.img')
mdesc = SysConfig(disks = ['linux-x86.img'])
system = FSConfig.makeLinuxX86System(self.mem_mode,
numCPUs=self.num_cpus,
mdesc=mdesc)