summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2007-01-18 10:07:07 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2007-01-18 10:07:07 +0000
commit97d59dd38c6cb65d75efd09efd9be6846f6921a0 (patch)
treea2d02238ff9fc5ff882fc3daca6c024a00a163bc /bootloader
parent024537d5b6098434a4856e84b2c43ee306c578de (diff)
downloadrockbox-97d59dd38c6cb65d75efd09efd9be6846f6921a0.tar.gz
rockbox-97d59dd38c6cb65d75efd09efd9be6846f6921a0.tar.bz2
rockbox-97d59dd38c6cb65d75efd09efd9be6846f6921a0.zip
Verbose error messages in the iPod bootloader
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12064 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/ipod.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index 8b99fbd1ad..b1b3114ac9 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -157,6 +157,29 @@ int opto_keypad_read(void)
}
#endif
+char *strerror(int error)
+{
+ switch(error)
+ {
+ case 0:
+ return "OK";
+ case -1:
+ return "File not found";
+ case -2:
+ return "Read failed (chksum)";
+ case -3:
+ return "Read failed (model)";
+ case -4:
+ return "Read failed (image)";
+ case -5:
+ return "Bad checksum";
+ case -6:
+ return "File too big";
+ default:
+ return "Unknown";
+ }
+}
+
char printfbuf[256];
void reset_screen(void)
@@ -448,7 +471,9 @@ void* main(void)
printf("Loading Rockbox...");
rc=load_rockbox(loadbuffer, BOOTFILE);
if (rc < 0) {
- printf("Rockbox error: %d",rc);
+ printf("Error!");
+ printf("Can't load rockbox.ipod:");
+ printf(strerror(rc));
} else {
printf("Rockbox loaded.");
memcpy((void*)DRAM_START,loadbuffer,rc);
@@ -460,7 +485,9 @@ void* main(void)
printf("Loading Linux...");
rc=load_linux(loadbuffer);
if (rc < 0) {
- printf("Linux error: %d",rc);
+ printf("Error!");
+ printf("Can't load linux.bin:");
+ printf(strerror(rc));
} else {
memcpy((void*)DRAM_START,loadbuffer,rc);
return (void*)DRAM_START;
@@ -482,7 +509,9 @@ void* main(void)
/* Only report errors if the file was found */
if (rc < -1) {
- printf("apple_os.ipod error: %d",rc);
+ printf("Error!");
+ printf("Can't load apple_os.ipod:");
+ printf(strerror(rc));
} else if (rc > 0) {
printf("apple_os.ipod loaded.");
memcpy((void*)DRAM_START,loadbuffer,rc);