freemyipod r188 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r187‎ | r188 | r189 >
Date:14:36, 4 September 2010
Author:theseven
Status:new
Tags:
Comment:
Fix a couple of annoying iLoader bugs: Make it recognize the rockbox checksum correctly, and stop the theme from locking up if booting rockbox fails.
Modified paths:
  • /apps/iloader/main.c (modified) (history)
  • /apps/iloader/themes/default-fastboot/source/iloader.conf (modified) (history)
  • /apps/iloader/themes/default/source/iloader.conf (modified) (history)

Diff [purge]

Index: apps/iloader/main.c
@@ -398,8 +398,19 @@
399399 uint8_t* image = (uint8_t*)config[pc + 1];
400400 uint32_t checksum = image[3] | (image[2] << 8)
401401 | (image[1] << 16) | (image[0] << 24);
402 - uint32_t mysum = 62;
403 - if (*((uint32_t*)&image[4]) != get_platform_id()) pc = errhandler;
 402+ uint32_t mysum;
 403+ uint32_t platform;
 404+ switch (get_platform_id())
 405+ {
 406+ case 0x47324e49: // IN2G
 407+ mysum = 62;
 408+ platform = 0x67326e6e; // nn2g
 409+ break;
 410+ default:
 411+ panic(PANIC_KILLTHREAD,
 412+ "No known Rockbox checksum format for this target");
 413+ }
 414+ if (*((uint32_t*)&image[4]) != platform) pc = errhandler;
404415 else
405416 {
406417 for (i = 0; i < size - 8; i++)
Index: apps/iloader/themes/default-fastboot/source/iloader.conf
@@ -48,6 +48,7 @@
4949 unpackucl(0x09000000, 0x08000000)
5050 exec(0x08000000)
5151 rockboxuncompressed:
 52+ error(0xffffffff)
5253 readfile(0x08000000, "/.rockbox/rockbox.ipod\0")
5354 rbchecksum(0x08000000)
5455 exec(0x08000000)
Index: apps/iloader/themes/default/source/iloader.conf
@@ -47,6 +47,7 @@
4848 unpackucl(0x09000000, 0x08000000)
4949 exec(0x08000000)
5050 rockboxuncompressed:
 51+ error(0xffffffff)
5152 readfile(0x08000000, "/.rockbox/rockbox.ipod\0")
5253 rbchecksum(0x08000000)
5354 exec(0x08000000)