| 1 | April 2014, Joel Porquet | 
|---|
| 2 |  | 
|---|
| 3 | This platform is known for being able to run Linux. | 
|---|
| 4 |  | 
|---|
| 5 | ---- | 
|---|
| 6 | Pre-requisites: | 
|---|
| 7 |  | 
|---|
| 8 | * A working version of SoCLib (r2558) | 
|---|
| 9 |     - the command `soclib-cc --getpath` should return where SoCLib is | 
|---|
| 10 |       installed | 
|---|
| 11 | * A working version of TSAR (r668) | 
|---|
| 12 |     - TSAR directory should be properly added to SoCLib's configuration: | 
|---|
| 13 |       either globally, or through the `soclib.conf` file present in this | 
|---|
| 14 |       directory (in which case, the environment variable `TSARDIR` should be | 
|---|
| 15 |       defined to point on TSAR directory) | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | ---- | 
|---|
| 19 | Targets of the Makefile: | 
|---|
| 20 |  | 
|---|
| 21 | * clean: clean the compilation files | 
|---|
| 22 | * all (or none): compile the simulation system | 
|---|
| 23 | * run_tsar_boot: runs the simulation system using a boot loader (in this case, | 
|---|
| 24 |   you want to use a blockdevice image that contains the kernel: see `DSK` | 
|---|
| 25 |   option below) | 
|---|
| 26 | * run_dummy_boot: runs the simulation system using directly Linux instead of a | 
|---|
| 27 |   boot loader (i.e. Linux is already loaded in RAM before execution). | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | ---- | 
|---|
| 31 | Options for running: | 
|---|
| 32 |  | 
|---|
| 33 | These options apply when using either `run_tsar_boot` or `run_dummy_boot` | 
|---|
| 34 | targets. Example: `make run_dummy_boot GDB=1 VMLINUX=../vmlinux DSK=dsk.img` | 
|---|
| 35 |  | 
|---|
| 36 | * GDB=1|[FXSCTZW]: options to the GDB server (1 means FCX which is a good | 
|---|
| 37 |   default) | 
|---|
| 38 | * NCPUS=[1-4]: number of processors (the default is 4) | 
|---|
| 39 | * DSK=[pathname]: path to a filesystem to use with the BlockDevice component | 
|---|
| 40 |   (also implies creating a system with such a component, otherwise the | 
|---|
| 41 |   component is deactivated) | 
|---|
| 42 | * TRACE=[number]: enables tracing the simulation starting from a certain cycle | 
|---|
| 43 | * NCYCLES=[number]: runs the simulation for a certain number of cycles | 
|---|
| 44 |  | 
|---|
| 45 |     Only for run_dummy_boot: | 
|---|
| 46 |     * VMLINUX=[pathname]: path to Linux `vmlinux` image | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | ---- | 
|---|
| 50 | Using GDB server: | 
|---|
| 51 |  | 
|---|
| 52 | A file named `.gdbinit` contains a few macros that can be useful for debugging | 
|---|
| 53 | Linux when using the GDB server. | 
|---|
| 54 |  | 
|---|
| 55 | * connect: connect to the GDB server that runs within the simulation | 
|---|
| 56 | * dmesg: print the content of the kernel message buffer | 
|---|
| 57 | * thread_info: print the thread_info structure of the current task | 
|---|
| 58 | * task_struct: print the task_struct structure of the current task | 
|---|
| 59 | * active_mm: print the active_mm structure of the current task | 
|---|
| 60 | * pgd: print the content of the page table of the current task | 
|---|
| 61 | * ps: print the list of running tasks | 
|---|
| 62 |  | 
|---|