blob: 4df0d23654a1388e1f5fedb0562c9cb423704df5 [file] [log] [blame] [view]
Andrew Scull23042042018-08-22 17:44:56 +01001# Getting started
2
3## Getting access
4
5Read access to the source is provided to all Googlers (members of
6`nonconf-mirror@prod`, to be precise). Permission to submit CLs requires
7membership of `hafnium-access@prod`. Full administrative rights are only granted
8to members of `hafnium-admin@prod`.
9
10## Getting the source code
11
12``` shell
13git clone --recurse-submodules sso://hafnium/hafnium && (cd hafnium && f=`git rev-parse --git-dir`/hooks/commit-msg ; curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f)
14```
15
16To upload a commit for review:
17
18``` shell
19git push origin HEAD:refs/for/master
20```
21Browse source at [go/hafnium-repo](https://goto.google.com/hafnium-repo).
22Review CLs at [go/hafnium-review](https://goto.google.com/hafnium-review).
23
24## Compiling the hypervisor
25
26By default, the hypervisor is built with clang for an aarch64 QEMU target by
27running:
28
29``` shell
30make
31```
32
33The compiled image can be found at `out/aarch64/qemu/clang_aarch64/hafnium.bin`.
34
35To build for the HiKey board, change the target platform:
36
37``` shell
38PLATFORM=hikey make
39```
40
41To build using gcc instead of clang, the aarch64 variant must be installed:
42
43``` shell
44sudo apt install gcc-aarch64-linux-gnu
45GCC=true make
46```
47## Running on QEMU
48
49You will need at least version 2.9 for QEMU. The following command line can be
50used to run Hafnium on it:
51
52``` shell
53qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/aarch64/qemu/clang_aarch64/hafnium.bin
54```
55
56Though it is admittedly not very useful because it doesn't have any virtual
57machines to run. Follow the [Hafnium RAM disk](HafniumRamDisk.md) instructions
58to create an initial RAM disk for Hafnium with Linux as the primary VM.
59
60The following command line will run Hafnium, with the RAM disk just created,
61which will then boot into the primary Linux VM:
62
63``` shell
64qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/aarch64/qemu/clang_aarch64/hafnium.bin -initrd initrd.img -append "rdinit=/sbin/init"
65```
66
67## Running tests
68
69After building, presubmit tests can be run with the following command line:
70
71``` shell
72./kokoro/ubuntu/test.sh
73```
74
75Read about [testing](Testing.md) for more details about the tests.