|Deletions are marked like this.||Additions are marked like this.|
|Line 33:||Line 33:|
|1. Build Barrelfish for Arm on Gem5 (use 'arm_gem5' as target architecture)||1. Build Barrelfish for Arm on Gem5
* since release2012-10-03: use 'armv7' as a make target
* for earlier releases: use 'arm_gem5' instead
|Line 43:||Line 45:|
| * make arm_gem5 for single-core target
* make arm_gem5_mc for multi-core target
|* make arm_gem5|
Running Barrelfish on Gem5
There is support for booting Barrelfish on the gem5 simulator.
This provides a platform for experimenting with OS/architecture co-design, and for experimenting with architectural support for aspects of Barrelfish (e.g., message passing). It is not intended as a general-purpose platform for experimenting with Barrelfish -- QEMU is typically much faster.
Running x86-64 Barrelfish on Gem5
The only configuration that has been exercised is full-system x86 using the simple CPU model. Other x86 configurations may work (e.g., in-order CPU, out-of-order CPU, depending on the underlying implementation of these CPU models in gem5). I have used configurations both with and without Ruby.
To get started with Barrelfish on gem5:
1. Build a gem5 tree with x86 simple CPU. I will assume this produces a binary m5.fast, and that this is added to the path.
2. Build an x86_64 Barrelfish tree as usual.
3. In the build directory, run "make m5_kernel". This will construct a single kernel image file that combines the actual kernel along with the modules and a rudimentary boot-loader. The output file is called "m5_kernel". The file "menu.lst.m5" configures which modules are included, and what the physical memory layout of the simulated machine will be. Re-run "make m5_kernel" after changing "menu.lst.m5".
4. In the build directory, run "make m5". This will invoke m5.fast, passing it the m5_kernel and a simple machine configuration taken from "m5script.py".
NB: steps 2--4 can be combined by just running "make m5". I've listed them separately here to help troubleshooting if problems emerge.
In practice the file m5script.py (and m5.fast command line) will need to be tailored to the particular kind of system that you want to simulate. These examples are intended just to help with getting started.
Feel free to contact Tim Harris with any questions.
Running ARM Barrelfish on Gem5
Barrelfish for ARM on Gem5 supports up to 4 cores and caches. There are some issues with the O3 CPU model and multiple cores though. Below are instructions to set up gem5 and boot ARM Barrelfish on it.
Note: As of release2013-01-11, the patch described in step 3 is not needed anymore, and hence we are not bound to a specific version of gem5. At the time of this writting the latest known working version was 0fea324c832c.
1. Build Barrelfish for Arm on Gem5
- since release2012-10-03: use 'armv7' as a make target
- for earlier releases: use 'arm_gem5' instead
2. Get the gem5 simulator with 'hg clone hg clone http://repo.gem5.org/gem5 -r d45a02bd5391 gem5' (note you have to use this release to get a working environment out of the box)
3. Change to your gem5 directory and apply 'gem5_patches.patch', located in '/path/to/barrelfish/tools/arm_gem5' to the gem5 source code
4. Build gem5 with 'scons build/ARM/gem5.fast' and add the binary to the PATH NOTE: I had to use an older version of gcc, gcc 4.4 - 4.6 worked for me. If you have troubles, install gcc 4.4 and compile with 'CXX=g++-4.4 scons build/ARM/gem5.fast'
5. Run the simulation (do not forget to add the directory build/ARM from within the gem5 directory to the PATH):
- make arm_gem5
6. To get the output of Barrelfish you can use 'telnet localhost 3456'
NOTE 1: To change the system configuration, adjust 'tools/arm_gem5/gem5script.py' accordingly or change the command to start gem5 in 'symbolic_targets.mk'
NOTE 2: If you use --cpu-type=arm_detailed (use make arm_gem5_detailed), the simulation takes a long time (depending on your machine up to an hour just to boot Barrelfish)