blob: 9a815a6a20416a71407ccc6c2981cc95083a8380 [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 Scull23e93a82018-10-26 14:56:04 +010032By default, the hypervisor is built with clang for a few target platforms along
33with tests.
Andrew Scull23042042018-08-22 17:44:56 +010034
35``` shell
36make
37```
38
Andrew Scull23e93a82018-10-26 14:56:04 +010039The compiled image can be found under `out/`, for example the QEMU image is at
40at `out/qemu_aarch64_clang/hafnium.bin`.
Andrew Scull23042042018-08-22 17:44:56 +010041
Andrew Scull23042042018-08-22 17:44:56 +010042## Running on QEMU
43
44You will need at least version 2.9 for QEMU. The following command line can be
45used to run Hafnium on it:
46
47``` shell
Andrew Scull23e93a82018-10-26 14:56:04 +010048qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/qemu_aarch64_clang/hafnium.bin
Andrew Scull23042042018-08-22 17:44:56 +010049```
50
51Though it is admittedly not very useful because it doesn't have any virtual
52machines to run. Follow the [Hafnium RAM disk](HafniumRamDisk.md) instructions
53to create an initial RAM disk for Hafnium with Linux as the primary VM.
54
55The following command line will run Hafnium, with the RAM disk just created,
56which will then boot into the primary Linux VM:
57
58``` shell
Andrew Scull23e93a82018-10-26 14:56:04 +010059qemu-system-aarch64 -M virt -cpu cortex-a57 -nographic -machine virtualization=true -kernel out/qemu_aarch64_clang/hafnium.bin -initrd initrd.img -append "rdinit=/sbin/init"
Andrew Scull23042042018-08-22 17:44:56 +010060```
61
62## Running tests
63
64After building, presubmit tests can be run with the following command line:
65
66``` shell
67./kokoro/ubuntu/test.sh
68```
69
70Read about [testing](Testing.md) for more details about the tests.