Differences between revisions 2 and 3
Revision 2 as of 2011-07-25 14:22:14
Size: 1973
Editor: tide614
Comment:
Revision 3 as of 2012-07-26 14:10:03
Size: 3497
Editor: 217-162-219-216
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
There is rudimentary support for booting Barrelfish on the [[http://www.gem5.org|gem5 simulator]]. = Running Barrelfish on Gem5 =

There is support for booting Barrelfish on the [[http://www.gem5.org|gem5 simulator]].
Line 5: Line 7:
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.  ARM configurations have not yet been tried. == 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.
Line 22: Line 26:

== 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.

1. Build Barrelfish for Arm on Gem5 (use 'arm_gem5' as target architecture)

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 for single-core target
 * make arm_gem5_mc for multi-core target

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)

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.

1. Build Barrelfish for Arm on Gem5 (use 'arm_gem5' as target architecture)

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 for single-core target
  • make arm_gem5_mc for multi-core target

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)

BarrelfishWiki: Running_on_gem5 (last edited 2017-07-24 14:57:56 by Simon Gerber)