summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-30 11:16:54 -0600
committerSimon Glass <sjg@chromium.org>2023-08-10 18:34:54 -0600
commitb7ed5386a4502bf48e4b04def69afae39873b536 (patch)
treebfabd50ffc61c364202dc4ea19ba97e6df8f76b9
parent1a0810924a29311a330d717a2813d212865a5df0 (diff)
bootstd: cros: Add docs for the kernel layout
Provide brief documentation about the ChromiumOS kernel layout. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--boot/bootmeth_cros.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c
index 3b9e75540aa..a551d43701d 100644
--- a/boot/bootmeth_cros.c
+++ b/boot/bootmeth_cros.c
@@ -22,6 +22,35 @@
#include <linux/sizes.h>
#include "bootmeth_cros.h"
+/*
+ * Layout of the ChromeOS kernel
+ *
+ * Partitions 2 and 4 contain kernels
+ *
+ * Contents are:
+ *
+ * Offset Contents
+ * 0 struct vb2_keyblock
+ * m struct vb2_kernel_preamble
+ * m + n kernel buffer
+ *
+ * m is keyblock->keyblock_size
+ * n is preamble->preamble_size
+ *
+ * The kernel buffer itself consists of various parts:
+ *
+ * Offset Contents
+ * m + n kernel image (Flat vmlinux binary or FIT)
+ * b - 8KB Command line text
+ * b - 4KB X86 setup block (struct boot_params, extends for about 16KB)
+ * b X86 bootloader (continuation of setup block)
+ * b + 16KB X86 setup block (copy, used for hold data pointed to)
+ *
+ * b is m + n + preamble->bootloader_address - preamble->body_load_address
+ *
+ * Useful metadata extends from b - 8KB through to b + 32 KB
+ */
+
enum {
PROBE_SIZE = SZ_4K, /* initial bytes read from partition */