-
Notifications
You must be signed in to change notification settings - Fork 0
/
PORTING
96 lines (63 loc) · 2.82 KB
/
PORTING
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
84
85
86
87
88
89
90
91
92
93
94
95
96
AArch64 Port
============
The AArch64 Port is being started, initially targeting the QEMU Mach-virt
platform, and running on the Foundation Model v8.
These are some brief instructions about how to cross-compile OSv's
loader.img (very incomplete still) on an X86-64 build host machine.
------------------------------
Environment Variables for make
------------------------------
In addition to the general requirements (see README.md),
note that the simple build system recognizes the CROSS_PREFIX
environment variable, and looks for build tools prefixed with its contents.
Alternatively, the following variables can be used to control the tools to use:
CXX The target C++ compiler
HOST_CXX The build host C++ compiler
CC The target C compiler
LD The target linker
STRIP The target strip
OBJCOPY The target objcopy
If for some reason the ARCH-detection code does not work, it is possible to use
ARCH=aarch64
to force the target architecture to AArch64.
---------------------------------------
Crosscompiler Tools & Image from Linaro
---------------------------------------
You can find a [ 32bit :-( needs multilib] crosscompiler from Linaro,
in particular the package
gcc-linaro-aarch64-linux-gnu-4.8-2013.12_linux,
which is not distro-specific [ :-) ], and includes all tools needed.
For debugging purposes, a standalone gdb package for target AAarch64
can be also downloaded from the Linaro web site.
For the root filesystem for AArch64, a good option is the Linaro LEG Image
linaro-image-leg-java-genericarmv8-20131215-598.rootfs.tar.gz
http://www.linaro.org/downloads/
------------------------------
Crosscompiler Tools for Ubuntu
------------------------------
For Ubuntu there are AArch64 crosscompilers available in the official
repositories as well e..g packages
g++-4.8-aarch64-linux-gnu
gcc-4.8-aarch64-linux-gnu
--------------------------------------
ARMv8 Foundation Model guest debugging
--------------------------------------
In ARMv8 Foundation model it would be possible to debug the guest kernel
via the following setup:
1. Start Foundation model with options
--network=nat --network-nat-ports=1234=1234
The latter option will expose the gdb port used by QEMU on the host side
(default port 1234) to the same port number in the guest running inside
the model.
2. If you are skipping the user space initialization via something like
init=/bin/sh for speedup, in Foundation model you will need to run at least:
/sbin/udhcpc eth0
3. In Foundation model start qemu-system-aarch64 with the -s -S options
4. On the host side, open gdb in a new terminal window and attach to the
guest kernel with the command:
target remote :1234
This is not currently functional due to unimplemented support in
KVM/QEMU.
---
Jani Kokkonen <jani.kokkonen@huawei.com>
Claudio Fontana <claudio.fontana@huawei.com>