=== modified file 'bootloader/ipod.c' --- bootloader/ipod.c 2008-12-03 21:15:44 +0000 +++ bootloader/ipod.c 2008-12-30 20:07:21 +0000 @@ -229,7 +229,7 @@ int i; int btn; int rc; - bool haveretailos; + bool haveramos; bool button_was_held; struct partinfo* pinfo; unsigned short* identify_info; @@ -319,8 +319,8 @@ } else if (rc == EFILE_NOT_FOUND) { /* If apple_os.ipod doesn't exist, then check if there is an Apple firmware image in RAM */ - haveretailos = (memcmp((void*)(DRAM_START+0x20),"portalplayer",12)==0); - if (haveretailos) { + haveramos = (memcmp((void*)(DRAM_START+0x20),"portalplayer",12)==0); + if (haveramos) { /* We have a copy of the retailos in RAM, lets just run it. */ return (void*)DRAM_START; } @@ -346,14 +346,22 @@ } else { printf("Loading Rockbox..."); rc=load_firmware(loadbuffer, BOOTFILE, MAX_LOADSIZE); - if (rc < EOK) { - printf("Error!"); - printf("Can't load " BOOTFILE ": "); - printf(strerror(rc)); - } else { + if (rc == EOK) { printf("Rockbox loaded."); return (void*)DRAM_START; + } else if (rc == EFILE_NOT_FOUND) { + /* if rockbox.ipod doesn't exist, then check if there is a Rockbox + image in RAM */ + haveramos = (memcmp((void*)(DRAM_START+0x20),"Rockbox\1",8)==0); + if (haveramos) { + /* We have a copy of Rockbox in RAM, lets just run it. */ + return (void*)DRAM_START; + } } + + printf("Error!"); + printf("Can't load " BOOTFILE ": "); + printf(strerror(rc)); } /* If we get to here, then we haven't been able to load any firmware */ === modified file 'firmware/target/arm/crt0-pp.S' --- firmware/target/arm/crt0-pp.S 2008-12-11 01:48:31 +0000 +++ firmware/target/arm/crt0-pp.S 2008-12-30 19:48:25 +0000 @@ -82,7 +82,12 @@ msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */ b pad_skip -.space 64*4 /* (more than enough) space for exception vectors and mi4 magic */ +.space 6*4 /* pad to offset 0x20 */ + + .ascii "Rockbox" /* signature for bootloader checking osos */ + .byte 1 /* osos boot version, only 1 exists for now */ + +.space 56*4 /* (more than enough) space for exception vectors and mi4 magic */ pad_skip: /* Find out which processor we are - r0 should be preserved for the