-
Notifications
You must be signed in to change notification settings - Fork 29
/
README.misc
58 lines (48 loc) · 2.12 KB
/
README.misc
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
Misc notes. Some are likely to be out of date.
* Copies of e1000 and e1000e manuals are in manuals/. They were
retrieved from:
http://www.intel.com/products/ethernet/resource.htm#s1=Gigabit%20Ethernet&s2=all&s3=Manual
* 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..
$ make gdb
# ..In a different terminal
$ echo add-auto-load-safe-path $(pwd) >> ~/.gdbinit
$ gdb
...
The target architecture is assumed to be i386:x86-64
0xffffffffc011b5fc in ?? ()
Breakpoint 1 at 0xffffffffc010b9c0: file kernel/console.cc, line 240.
Breakpoint 2 at 0xffffffffc010b970: file kernel/console.cc, line 224.
(gdb) c
* Mac cross compiler gcc-4.6.2
compiler without libstdc++
download, make, make install gmp-5.0.4, mpfr-3.1.0, and mpc-0.9
for mpfr and mpc: ./configure --with-gmp=/usr/local
for gcc:
mkdir build
cd build
../configure --target=x86_64-jos-elf --with-gmp=/usr/local/ --with-mpfr=/usr/local --enable-languages=c,c++ --without-headers --disable-nls
make all-gcc ; sudo make install-gcc
* clang
- Version 3.0 or greater is required to build xv6
- http://llvm.org/docs/GettingStarted.html
- You might need a patched libstdc++ from gcc 4.7.0 or later:
See http://clang.llvm.org/cxx_status.html
- or you might be able to reuse you're current libstdc++, e.g.:
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
gcc (for libstdc++ if necessary):
# .. apply the patch ..
$ ./configure --enable-languages=c,c++ --disable-nls --prefix=[PREFIX]
llvm and clang:
$ git clone http://llvm.org/git/llvm.git
$ (cd llvm/tools && git clone http://llvm.org/git/clang.git)
$ CC=gcc CXX=g++ ./configure --prefix=[PREFIX] \
--enable-targets=x86_64 --enable-optimized
$ CC=gcc CXX=g++ make && make install