1ADDITIONAL NOTES:
2
3These notes are intended to give some hints on how to work with Gem5 and where to start,
4when you want to add a new board to Gem5 and support it in Barrelfish.
5
6
71. Adding a new (ARM) development board to Gem5
8
9The place to add a new development board is in gem5/src/dev/arch/arm/Realview.py. There are
10already a bunch of boards there which should get you started. If your intended board has devices
11which are not yet implemented in Gem5 you can either try to use an existing one (eg another UART
12device) or you have to implement it yourself. You can look at the other files in this directory
13to get an idea on how to do it.
14
15You also need to change barrelfish/tools/arm_gem5/gem5script.py to select your new device.
16Watch for the 'machine type configuration' and change it to
17
18system.realview = Your_Board_Class()
19
20In the Barrelfish code itself you probably have to adjust the hardcoded device addresses in
21'kernel/arch/arm_gem5/integrator.c'. If you added new devices you'd also need to write a device
22driver and make according changes to the code.
23
24This should get you started. If you have any problems which are beyond the scope of these notes,
25then ask on the Gem5 and/or the Barrelfish mailing list for help.
26
27
282. Working with Gem5
29
302.1 Debugging Barrelfish on Gem5
31
32Gem5 has nice remote debugging support but needs some configuration in order to work. There is
33already a GDB script in tools/arm_gem5/debug.gem5.gdb which does the work for you. In order to
34attach the remote debugger to Gem5 just change to your Barrelfish build directory and run
35
36'arm-linux-gnueabi-gdb -x ../tools/arm_gem5/debug.gem5.gdb'
37
38and Gem5 will break in whatever code currently executing in the simulator.
39If you want to start debugging from the first line of code on you have to modify 
40'gem5/src/sim/system.cc'. Look for this line
41
42int rgdb_wait = -1;
43
44change it to
45
46int rgdb_wait = 0;
47
48and recompile Gem5. That way Gem5 will wait for a remote debugger to attach before executing any
49simulated code.
50
51
522.2 Debugging Gem5
53
54In order to debug Gem5 you want to build the debug binary 'gem5.debug'. Then just open this binary
55in GDB and you can step the Gem5 code. 
56
57For more information about Gem5's debugging functionality visit http://www.gem5.org/Debugging.
58
59TO BE EXPANDED...
60