Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: utility/load_kernel_test_old.c

Issue 2866006: Move old vkernel code out of vboot_firmware. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « utility/load_kernel_test.c ('k') | vboot_firmware/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5
6 /* Routines for verifying a file's signature. Useful in testing the core 6 /* Routines for verifying a file's signature. Useful in testing the core
7 * RSA verification implementation. 7 * RSA verification implementation.
8 */ 8 */
9 9
10 #include <inttypes.h> /* For PRIu64 macro */ 10 #include <inttypes.h> /* For PRIu64 macro */
11 #include <stdio.h> 11 #include <stdio.h>
12 #include <stdlib.h> 12 #include <stdlib.h>
13 #include <string.h> 13 #include <string.h>
14 #include <sys/types.h> 14 #include <sys/types.h>
15 15
16 #include "load_kernel_fw.h" 16 #include "load_kernel_fw.h"
17 #include "boot_device.h" 17 #include "boot_device.h"
18 #include "host_common.h" 18 #include "host_common.h"
19 #include "rollback_index.h" 19 #include "rollback_index.h"
20 #include "utility.h" 20 #include "utility.h"
21 #include "vboot_kernel.h" 21
22 int LoadKernelOld(LoadKernelParams* params);
23 /* Attempts to load the kernel from the current device.
24 *
25 * Returns LOAD_KERNEL_SUCCESS if successful, error code on failure. */
22 26
23 /* ANSI Color coding sequences. */ 27 /* ANSI Color coding sequences. */
24 #define COL_GREEN "\e[1;32m" 28 #define COL_GREEN "\e[1;32m"
25 #define COL_RED "\e[0;31m" 29 #define COL_RED "\e[0;31m"
26 #define COL_STOP "\e[m" 30 #define COL_STOP "\e[m"
27 31
28 32
29 #define LBA_BYTES 512 33 #define LBA_BYTES 512
30 #define KERNEL_BUFFER_SIZE 0x600000 34 #define KERNEL_BUFFER_SIZE 0x600000
31 35
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 rewind(image_file); 121 rewind(image_file);
118 printf("Ending LBA: %" PRIu64 "\n", lkp.ending_lba); 122 printf("Ending LBA: %" PRIu64 "\n", lkp.ending_lba);
119 123
120 /* Allocate a buffer for the kernel */ 124 /* Allocate a buffer for the kernel */
121 lkp.kernel_buffer = Malloc(KERNEL_BUFFER_SIZE); 125 lkp.kernel_buffer = Malloc(KERNEL_BUFFER_SIZE);
122 if(!lkp.kernel_buffer) { 126 if(!lkp.kernel_buffer) {
123 fprintf(stderr, "Unable to allocate kernel buffer.\n"); 127 fprintf(stderr, "Unable to allocate kernel buffer.\n");
124 return 1; 128 return 1;
125 } 129 }
126 130
127 /* TODO: Option for boot mode - developer, recovery */ 131 /* TODO: Option for boot mode */
128 /* Need to skip the address check, since we're putting it somewhere on the 132 lkp.boot_flags = 0;
129 * heap instead of its actual target address in the firmware. */
130 lkp.boot_flags = BOOT_FLAG_SKIP_ADDR_CHECK;
131 133
132 /* Call LoadKernel() */ 134 /* Call LoadKernel() */
133 rv = LoadKernel2(&lkp); 135 rv = LoadKernelOld(&lkp);
134 printf("LoadKernel() returned %d\n", rv); 136 printf("LoadKernelOld() returned %d\n", rv);
135 137
136 if (LOAD_KERNEL_SUCCESS == rv) { 138 if (LOAD_KERNEL_SUCCESS == rv) {
137 printf("Partition number: %" PRIu64 "\n", lkp.partition_number); 139 printf("Partition number: %" PRIu64 "\n", lkp.partition_number);
138 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address); 140 printf("Bootloader address: %" PRIu64 "\n", lkp.bootloader_address);
139 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size); 141 printf("Bootloader size: %" PRIu64 "\n", lkp.bootloader_size);
140 } 142 }
141 143
142 fclose(image_file); 144 fclose(image_file);
143 Free(lkp.kernel_buffer); 145 Free(lkp.kernel_buffer);
144 return 0; 146 return 0;
145 } 147 }
OLDNEW
« no previous file with comments | « utility/load_kernel_test.c ('k') | vboot_firmware/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698