summaryrefslogtreecommitdiff
path: root/bootloader/main-e200r-installer.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/main-e200r-installer.c')
-rw-r--r--bootloader/main-e200r-installer.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c
index 490f1f04dd..c5751d3095 100644
--- a/bootloader/main-e200r-installer.c
+++ b/bootloader/main-e200r-installer.c
@@ -26,12 +26,13 @@
26#include <stdlib.h> 26#include <stdlib.h>
27#include "common.h" 27#include "common.h"
28#include "cpu.h" 28#include "cpu.h"
29#include "file.h"
30#include "system.h" 29#include "system.h"
31#include "../kernel-internal.h" 30#include "../kernel-internal.h"
32#include "lcd.h" 31#include "lcd.h"
33#include "font.h" 32#include "font.h"
34#include "storage.h" 33#include "storage.h"
34#include "file_internal.h"
35#include "file.h"
35#include "button.h" 36#include "button.h"
36#include "disk.h" 37#include "disk.h"
37#include "crc32-mi4.h" 38#include "crc32-mi4.h"
@@ -92,7 +93,7 @@ void* main(void)
92 int num_partitions; 93 int num_partitions;
93 int crc32; 94 int crc32;
94 char sector[512]; 95 char sector[512];
95 struct partinfo* pinfo; 96 struct partinfo pinfo;
96 97
97 system_init(); 98 system_init();
98 kernel_init(); 99 kernel_init();
@@ -117,7 +118,7 @@ void* main(void)
117 printf(""); 118 printf("");
118 119
119 i=storage_init(); 120 i=storage_init();
120 disk_init(IF_MV(0)); 121 filesystem_init();
121 num_partitions = disk_mount_all(); 122 num_partitions = disk_mount_all();
122 123
123 if (num_partitions<=0) 124 if (num_partitions<=0)
@@ -125,17 +126,17 @@ void* main(void)
125 error(EDISK, num_partitions, true); 126 error(EDISK, num_partitions, true);
126 } 127 }
127 128
128 pinfo = disk_partinfo(1); 129 disk_partinfo(1, &pinfo);
129 130
130#if 0 /* not needed in release builds */ 131#if 0 /* not needed in release builds */
131 printf("--- Partition info ---"); 132 printf("--- Partition info ---");
132 printf("start: %x", pinfo->start); 133 printf("start: %x", pinfo.start);
133 printf("size: %x", pinfo->size); 134 printf("size: %x", pinfo.size);
134 printf("type: %x", pinfo->type); 135 printf("type: %x", pinfo.type);
135 printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512); 136 printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512);
136#endif 137#endif
137 138
138 storage_read_sectors(pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 139 storage_read_sectors(pinfo.start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
139 1 , sector); 140 1 , sector);
140 crc32 = chksum_crc32 (sector, 512); 141 crc32 = chksum_crc32 (sector, 512);
141 142
@@ -157,7 +158,7 @@ void* main(void)
157 memcpy(&sector[HACK_OFFSET], changedBytes, 158 memcpy(&sector[HACK_OFFSET], changedBytes,
158 sizeof(changedBytes)/sizeof(*changedBytes)); 159 sizeof(changedBytes)/sizeof(*changedBytes));
159 storage_write_sectors( 160 storage_write_sectors(
160 pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 161 pinfo.start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
161 1 , sector); 162 1 , sector);
162 printf("Firmware unlocked"); 163 printf("Firmware unlocked");
163 printf("Proceed to Step 2"); 164 printf("Proceed to Step 2");