-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qemu
83 lines (60 loc) · 2.23 KB
/
README.qemu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# QEMU Support for Xinu (x86)
- NOTE: QEMU support for Xinu (x86) is experimental. While this QEMU
version might be helpful if you want to debug Xinu, it may have
several unknown bugs. So use this QEMU version for debugging during
your development, and you should always confirm that your change is
working as expected on Xinu's lab machines running on Intel
Galileo. Our scoring also will be based on Intel Galileo boards.
- Tested on Ubuntu 16.04
- Should be working most of Linux-based machines
- If possible, please use your own desktop/labtop running Linux.
## Prerequisites
- Run following commands (in Ubuntu 16.04)
```
sudo apt install qemu-system-x86
sudo apt install terminator
sudo apt install gdb
```
## How to build
- Execute `rebuild.sh` in `tools` directory.
- This runs `QEMU=1 make` in `the compile` directory
```
$ ./rebuild.sh
~/tmp/xinu/compile ~/tmp/xinu/tools
removing .o files
removing configuration files ...
make[1]: Entering directory '/home/blee/tmp/xinu/config'
rm -f config lex.yy.c y.tab.c
make[1]: Leaving directory '/home/blee/tmp/xinu/config'
removing xinu ...
making the config program
make[1]: Entering directory '/home/blee/tmp/xinu/config'
rm -f config lex.yy.c y.tab.c
/usr/bin/flex config.l
/usr/bin/bison -y config.y
...
/usr/bin/gcc -march=i586 -m32 -fno-builtin -fno-stack-protector -nostdlib -c -Wall -O0 -DBSDURG -DVERSION=\""`cat version`"\" -I../include -DQEMU -g -o binaries/ethdispatch.o ../device/eth/ethdispatch.S
Loading object files to produce GRUB bootable xinu
Building ../compile/xinu.bin
Building ../compile/xinu
```
## Run Xinu with QEMU
- Execute 'run-qemu.sh` in `tools` directory.
```
$ ./run-qemu.sh
[*] Running: qemu-system-i386 -cpu qemu32 -m 256M --nographic -kernel ../compile/xinu.bin
Xinu for galileo -- version #261 (blee) Sun Sep 17 17:35:21 EDT 2017
266993664 bytes of free memory. Free list:
[0x0013E000 to 0x0FFDDFFF]
...
xsh $
```
- To run with GDB, use `--gdb` option. This will automatically pop-up
the gdb window, and QEMU stalls Xinu until it gets the `continue`
command from GDB.
```
$ ./run-qemu.sh --gdb
```
## References
- QEMU manual: https://qemu.weilnetz.de/doc/qemu-doc.html
- GDB tutorial: https://www.cs.cmu.edu/~gilpin/tutorial/