blob: a538e2e884388d04db7d8ce20866fb99c4923a8b [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
Andrew Walbran10276722018-09-10 14:33:18 +010026Install prerequisites:
27
28``` shell
29sudo apt install make binutils-aarch64-linux-gnu
30```
31
Andrew Scull23042042018-08-22 17:44:56 +010032By default, the hypervisor is built with clang for an aarch64 QEMU target by
33running:
34
35``` shell
36make
37```
38
39The compiled image can be found at `out/aarch64/qemu/clang_aarch64/hafnium.bin`.
40
41To build for the HiKey board, change the target platform:
42
43``` shell
44PLATFORM=hikey make
45```
46
47To build using gcc instead of clang, the aarch64 variant must be installed:
48
49``` shell
50sudo apt install gcc-aarch64-linux-gnu
51GCC=true make
52```
53## Running on QEMU
54
55You will need at least version 2.9 for QEMU. The following command line can be
56used to run Hafnium on it:
57
58``` shell
59qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/aarch64/qemu/clang_aarch64/hafnium.bin
60```
61
62Though it is admittedly not very useful because it doesn't have any virtual
63machines to run. Follow the [Hafnium RAM disk](HafniumRamDisk.md) instructions
64to create an initial RAM disk for Hafnium with Linux as the primary VM.
65
66The following command line will run Hafnium, with the RAM disk just created,
67which will then boot into the primary Linux VM:
68
69``` shell
70qemu-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"
71```
72
73## Running tests
74
75After building, presubmit tests can be run with the following command line:
76
77``` shell
78./kokoro/ubuntu/test.sh
79```
80
81Read about [testing](Testing.md) for more details about the tests.