blob: 59925ef7924c35ac7641dc1920b32e51399538b8 [file] [log] [blame] [view]
Andrew Scull23042042018-08-22 17:44:56 +01001# Hafnium RAM disk
2
3Hafnium expects to find the following files in the root directory of its RAM
4disk:
5
6 * `vmlinuz` -- the kernel of the primary VM.
7 * `initrd.img` -- the initial ramdisk of the primary VM.
8 * `vms.txt` -- optionally describes the secondary VMs.
9 * kernels for the secondary VMs, whose names are described in `vms.txt`.
10
11Follow the [preparing Linux](PreparingLinux.md) instructions to produce
12`vmlinuz` and `initrd.img` for a basic Linux primary VM.
13
14## Format of `vms.txt` file
15The format is currently one line per secondary VM, with the following format:
16
17``` shell
18<memory-size-in-bytes> <number-of-cpus> <kernel-filename>
19```
20
21For example, the following defines two secondary VMs, the first one with 1MB of
22memory, 2 CPUs and kernel image called `kernel0`, while the second one has 2MB
23of memory, 4 CPUs and a kernel image called `kernel1`.
24
25``` shell
261048576 2 kernel0
272097152 4 kernel1
28```
29
30## Create a RAM disk for Hafnium
31
32Assuming that a subdirectory called `initrd` contains the files listed in the
33previous section, we can build `initrd.img` with the following command:
34
35```shell
36cd initrd; find . | cpio -o > ../initrd.img; cd -
37```