-
Notifications
You must be signed in to change notification settings - Fork 132
/
README.amd64
51 lines (42 loc) · 1.36 KB
/
README.amd64
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
README for ucore amd64 in ubuntu 12.04 x86-64
-----------------------------
prerequirement:
------------------
intalll gcc x86-64 and qemu-system-x86_64
------------------
build
------------------
cd ucore
1 set kernel configure
make ARCH=amd64 defconfig // use amd64's default configure
OR
make ARCH=amd64 menuconfig //do nothing or select custom config, just save&exit
2 build kernel
make // build obj/kernel.img
3 build file system
make sfsimg // build obj/sfs.img
NOTICE: no need to build swapimg
------------------
run
------------------
./uCore_run -d obj
OR
qemu-system-x86_64 -m 512 -hda obj/kernel.img -drive file=obj/sfs.img,media=disk,cache=writeback,index=2 -s -serial file:obj/serial.log -monitor stdio
------------------
debug
------------------
* qemu+gdb
qemu and gdb do not properly handle mode-switching between 32- and
64-bit code: once gdb connects in 32-bit mode, it will not switch to
64-bit mode. Thus, debugging 64-bit code requires attaching gdb after
qemu is already executing 64-bit code. Do not use -S, since that will
attach in 16-/32-bit mode.
//In a terminal..
$ uCore_run -d obj
//In a different terminal
$ cp gdbinit.amd64 .gdbinit
$ gdb
...
The target architecture is assumed to be i386:x86-64
0xffffffffc011b5fc in ?? ()
(gdb) continue