| 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 * (Firmware Portion) | 6 * (Firmware Portion) |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ | 9 #ifndef VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ |
| 10 #define VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ | 10 #define VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 * length itself is checked early in the verification process for extra safety. | 157 * length itself is checked early in the verification process for extra safety. |
| 158 */ | 158 */ |
| 159 int VerifyKernel(const uint8_t* signing_key_blob, | 159 int VerifyKernel(const uint8_t* signing_key_blob, |
| 160 const uint8_t* kernel_blob, | 160 const uint8_t* kernel_blob, |
| 161 const int dev_mode); | 161 const int dev_mode); |
| 162 | 162 |
| 163 /* Returns the logical version of a kernel blob which is calculated as | 163 /* Returns the logical version of a kernel blob which is calculated as |
| 164 * (kernel_key_version << 16 | kernel_version). */ | 164 * (kernel_key_version << 16 | kernel_version). */ |
| 165 uint32_t GetLogicalKernelVersion(uint8_t* kernel_blob); | 165 uint32_t GetLogicalKernelVersion(uint8_t* kernel_blob); |
| 166 | 166 |
| 167 #define BOOT_KERNEL_A_CONTINUE 1 | |
| 168 #define BOOT_KERNEL_B_CONTINUE 2 | |
| 169 #define BOOT_KERNEL_RECOVERY_CONTINUE 3 | |
| 170 | |
| 171 /* Contains information about the kernel paritition | |
| 172 * gleaned from the GPT partition table. | |
| 173 * | |
| 174 * Based on the Chromium OS Drive Map design document by | |
| 175 * rspangler@chromium.org. | |
| 176 * | |
| 177 */ | |
| 178 typedef struct kernel_entry { | |
| 179 uint8_t* kernel_blob; /* Pointer to actual kernel. */ | |
| 180 uint8_t boot_priority; /* 15 = highest, 1 = lowest, 0 = not bootable. */ | |
| 181 uint8_t boot_tries_remaining; /* Used when boot_priority = 0. */ | |
| 182 uint8_t boot_success_flag; /* Set to 1 on successful boot by AU. */ | |
| 183 } kernel_entry; | |
| 184 | |
| 185 /* This function is the driver used by the RW firmware to | |
| 186 * determine which copy of the kernel to boot from. It performs | |
| 187 * the requisite priority and remaining tries checking for a specific | |
| 188 * kernel partition, does rollback index checking, including updating | |
| 189 * if required. | |
| 190 * | |
| 191 * Returns the code path to follow. It is one of: | |
| 192 * BOOT_KERNEL_A_CONTINUE Boot from Kenrel A | |
| 193 * BOOT_KERNEL_B_CONTINUE Boot from Kernel B | |
| 194 * BOOT_KERNEL_RECOVERY_CONTINUE Jump to recovery mode | |
| 195 */ | |
| 196 int VerifyKernelDriver_f(uint8_t* firmware_key_blob, | |
| 197 kernel_entry* kernelA, | |
| 198 kernel_entry* kernelB, | |
| 199 int dev_mode); | |
| 200 | |
| 201 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ */ | 167 #endif /* VBOOT_REFERENCE_KERNEL_IMAGE_FW_H_ */ |
| OLD | NEW |