OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * Data structure and API definitions for a verified boot kernel image. | 5 * Data structure and API definitions for a verified boot kernel image. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_H_ | 8 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_H_ |
9 #define VBOOT_REFERENCE_KERNEL_IMAGE_H_ | 9 #define VBOOT_REFERENCE_KERNEL_IMAGE_H_ |
10 | 10 |
11 #include <inttypes.h> | 11 #include <inttypes.h> |
12 | 12 |
13 #include "rsa.h" | 13 #include "rsa.h" |
14 #include "sha.h" | 14 #include "sha.h" |
15 | 15 |
16 #define KERNEL_MAGIC "CHROMEOS" | 16 #define KERNEL_MAGIC "CHROMEOS" |
17 #define KERNEL_MAGIC_SIZE 8 | 17 #define KERNEL_MAGIC_SIZE 8 |
| 18 #define KERNEL_CMD_LINE_SIZE 4096 |
18 | 19 |
19 /* Kernel config file options according to the Chrome OS drive map design. */ | 20 /* Kernel config file options according to the Chrome OS drive map design. */ |
20 typedef struct kconfig_options { | 21 typedef struct kconfig_options { |
21 uint32_t version[2]; /* Configuration file version. */ | 22 uint32_t version[2]; /* Configuration file version. */ |
| 23 uint8_t cmd_line[KERNEL_CMD_LINE_SIZE]; /* Kernel command line option string |
| 24 * terminated by a NULL character. */ |
22 uint64_t kernel_len; /* Size of the kernel. */ | 25 uint64_t kernel_len; /* Size of the kernel. */ |
23 uint64_t kernel_load_addr; /* Load address in memory for the kernel image */ | 26 uint64_t kernel_load_addr; /* Load address in memory for the kernel image */ |
24 uint64_t kernel_entry_addr; /* Address to jump to after kernel is loaded. */ | 27 uint64_t kernel_entry_addr; /* Address to jump to after kernel is loaded. */ |
25 } kconfig_options; | 28 } kconfig_options; |
26 | 29 |
27 | 30 |
28 typedef struct KernelImage { | 31 typedef struct KernelImage { |
29 uint8_t magic[KERNEL_MAGIC_SIZE]; | 32 uint8_t magic[KERNEL_MAGIC_SIZE]; |
30 /* Key header */ | 33 /* Key header */ |
31 uint16_t header_version; /* Header version. */ | 34 uint16_t header_version; /* Header version. */ |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 206 |
204 /* Add a kernel and kernel config signature to a kernel image [image] | 207 /* Add a kernel and kernel config signature to a kernel image [image] |
205 * using the private signing key in file [kernel_sigining_key_file]. | 208 * using the private signing key in file [kernel_sigining_key_file]. |
206 * | 209 * |
207 * Return 1 on success, 0 on failure. | 210 * Return 1 on success, 0 on failure. |
208 */ | 211 */ |
209 int AddKernelSignature(KernelImage* image, | 212 int AddKernelSignature(KernelImage* image, |
210 const char* kernel_sigining_key_file); | 213 const char* kernel_sigining_key_file); |
211 | 214 |
212 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ | 215 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_H_ */ |
OLD | NEW |