blob: 1a537f172f1ecd23d3710a5d051d16e3beded0f3 [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
Andrew Walbran6f8fd4c2019-08-05 13:28:17 +01006* `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`.
Andrew Scull23042042018-08-22 17:44:56 +010010
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
Andrew Walbran6f8fd4c2019-08-05 13:28:17 +010015
Andrew Scull23042042018-08-22 17:44:56 +010016The format is currently one line per secondary VM, with the following format:
17
Andrew Walbran6f8fd4c2019-08-05 13:28:17 +010018```shell
Andrew Scull23042042018-08-22 17:44:56 +010019<memory-size-in-bytes> <number-of-cpus> <kernel-filename>
20```
21
22For example, the following defines two secondary VMs, the first one with 1MB of
23memory, 2 CPUs and kernel image called `kernel0`, while the second one has 2MB
Andrew Walbran6f8fd4c2019-08-05 13:28:17 +010024of memory, 4 CPUs and a kernel image called `kernel1`.
Andrew Scull23042042018-08-22 17:44:56 +010025
Andrew Walbran6f8fd4c2019-08-05 13:28:17 +010026```shell
Andrew Scull23042042018-08-22 17:44:56 +0100271048576 2 kernel0
282097152 4 kernel1
29```
30
31## Create a RAM disk for Hafnium
32
33Assuming that a subdirectory called `initrd` contains the files listed in the
34previous section, we can build `initrd.img` with the following command:
35
36```shell
37cd initrd; find . | cpio -o > ../initrd.img; cd -
38```