Fix some forgotten storage_(read|write)_sectors() calls

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25461 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2010-04-03 22:18:16 +00:00
parent e07909a9c1
commit 2dbafc1086
4 changed files with 19 additions and 20 deletions

View file

@ -192,7 +192,7 @@ void* main(void)
printf("Zeroing flash"); printf("Zeroing flash");
for(i=0;i<250816;i++) for(i=0;i<250816;i++)
{ {
storage_write_sectors(0,i*32,32,zero); storage_write_sectors(i*32,32,zero);
if(i%64 == 0) if(i%64 == 0)
{ {
printf("%d kB left",(250816-i)/2); printf("%d kB left",(250816-i)/2);
@ -200,13 +200,13 @@ void* main(void)
} }
printf("Writing MBR"); printf("Writing MBR");
storage_write_sectors(0,0,1,mbr); storage_write_sectors(0,1,mbr);
printf("Writing FAT bootsector"); printf("Writing FAT bootsector");
storage_write_sectors(0,1023,1,fat); storage_write_sectors(1023,1,fat);
printf("Writing more FAT"); printf("Writing more FAT");
storage_write_sectors(0,1024,1,backupfat); storage_write_sectors(1024,1,backupfat);
printf("Writing more FAT"); printf("Writing more FAT");
storage_write_sectors(0,1264,1,backupfat); storage_write_sectors(1264,1,backupfat);
if (button_hold()) if (button_hold())
printf("Release Hold and"); printf("Release Hold and");

View file

@ -257,7 +257,7 @@ void* main(void)
printf("Zeroing flash"); printf("Zeroing flash");
for(i=0;i<250816;i++) for(i=0;i<250816;i++)
{ {
storage_write_sectors(0,i*32,32,zero); storage_write_sectors(i*32,32,zero);
if(i%64 == 0) if(i%64 == 0)
{ {
printf("%d kB left",(250816-i)/2); printf("%d kB left",(250816-i)/2);
@ -265,15 +265,15 @@ void* main(void)
} }
printf("Writing MBR"); printf("Writing MBR");
storage_write_sectors(0,0,1,mbr); storage_write_sectors(0,1,mbr);
printf("Writing FAT bootsector"); printf("Writing FAT bootsector");
storage_write_sectors(0,1017,2,bootsector); storage_write_sectors(1017,2,bootsector);
printf("Writing more FAT"); printf("Writing more FAT");
storage_write_sectors(0,1023,1,fat); storage_write_sectors(1023,1,fat);
printf("Writing more FAT"); printf("Writing more FAT");
storage_write_sectors(0,1049,1,backupfat); storage_write_sectors(1049,1,backupfat);
printf("Writing more FAT"); printf("Writing more FAT");
storage_write_sectors(0,4920,1,backupfat); storage_write_sectors(4920,1,backupfat);
if (button_hold()) if (button_hold())
printf("Release Hold and"); printf("Release Hold and");

View file

@ -139,8 +139,7 @@ void* main(void)
printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512); printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512);
#endif #endif
storage_read_sectors(0, storage_read_sectors(pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
1 , sector); 1 , sector);
crc32 = chksum_crc32 (sector, 512); crc32 = chksum_crc32 (sector, 512);
@ -161,7 +160,7 @@ void* main(void)
/* E200R bootloader detected - patch it */ /* E200R bootloader detected - patch it */
memcpy(&sector[HACK_OFFSET], changedBytes, memcpy(&sector[HACK_OFFSET], changedBytes,
sizeof(changedBytes)/sizeof(*changedBytes)); sizeof(changedBytes)/sizeof(*changedBytes));
storage_write_sectors(0, storage_write_sectors(
pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
1 , sector); 1 , sector);
printf("Firmware unlocked"); printf("Firmware unlocked");

View file

@ -391,7 +391,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
unsigned long sum; unsigned long sum;
/* Read header to find out how long the mi4 file is. */ /* Read header to find out how long the mi4 file is. */
storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET, storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET,
PPMI_SECTORS, &ppmi_header); PPMI_SECTORS, &ppmi_header);
/* The first four characters at 0x80000 (sector 1024) should be PPMI*/ /* The first four characters at 0x80000 (sector 1024) should be PPMI*/
@ -401,7 +401,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("BL mi4 size: %x", ppmi_header.length); printf("BL mi4 size: %x", ppmi_header.length);
/* Read mi4 header of the OF */ /* Read mi4 header of the OF */
storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header); + (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header);
/* We don't support encrypted mi4 files yet */ /* We don't support encrypted mi4 files yet */
@ -424,7 +424,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("Binary type: %.4s", mi4header.type); printf("Binary type: %.4s", mi4header.type);
/* Load firmware */ /* Load firmware */
storage_read_sectors(0, pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ (ppmi_header.length/512) + MI4_HEADER_SECTORS, + (ppmi_header.length/512) + MI4_HEADER_SECTORS,
(mi4header.mi4size-MI4_HEADER_SIZE)/512, buf); (mi4header.mi4size-MI4_HEADER_SIZE)/512, buf);
@ -443,9 +443,9 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("Disabling database rebuild"); printf("Disabling database rebuild");
storage_read_sectors(0, pinfo->start + 0x3c08, 1, block); storage_read_sectors(pinfo->start + 0x3c08, 1, block);
block[0xe1] = 0; block[0xe1] = 0;
storage_write_sectors(0, pinfo->start + 0x3c08, 1, block); storage_write_sectors(pinfo->start + 0x3c08, 1, block);
} }
#else #else
(void) disable_rebuild; (void) disable_rebuild;