? fatsector.diff ? h300 ? ipod5g ? player ? recorder ? tools/codepages ? tools/ipod_fw ? tools/mkboot ? tools/rdf2binary ? tools/uclpack Index: firmware/common/file.c =================================================================== RCS file: /cvsroot/rockbox/firmware/common/file.c,v retrieving revision 1.72 diff -u -r1.72 file.c --- firmware/common/file.c 16 May 2006 06:53:41 -0000 1.72 +++ firmware/common/file.c 12 Oct 2006 01:18:49 -0000 @@ -36,7 +36,7 @@ */ struct filedesc { - unsigned char cache[SECTOR_SIZE]; + unsigned char cache[SECTOR_BUFFER_SIZE]; int cacheoffset; /* invariant: 0 <= cacheoffset <= SECTOR_SIZE */ long fileoffset; long size; Index: firmware/drivers/fat.c =================================================================== RCS file: /cvsroot/rockbox/firmware/drivers/fat.c,v retrieving revision 1.127 diff -u -r1.127 fat.c --- firmware/drivers/fat.c 2 Aug 2006 15:58:02 -0000 1.127 +++ firmware/drivers/fat.c 12 Oct 2006 01:18:52 -0000 @@ -191,7 +191,7 @@ #endif }; -static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_SIZE]; +static char fat_cache_sectors[FAT_CACHE_SIZE][SECTOR_BUFFER_SIZE]; static struct fat_cache_entry fat_cache[FAT_CACHE_SIZE]; static struct mutex cache_mutex; @@ -269,7 +269,7 @@ const int volume = 0; #endif struct bpb* fat_bpb = &fat_bpbs[volume]; - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; int rc; long datasec; #ifdef HAVE_FAT16SUPPORT @@ -876,7 +876,7 @@ #ifndef HAVE_MULTIVOLUME struct bpb* fat_bpb = &fat_bpbs[0]; #endif - unsigned char fsinfo[SECTOR_SIZE]; + unsigned char fsinfo[SECTOR_BUFFER_SIZE]; unsigned long* intptr; int rc; @@ -1036,7 +1036,7 @@ const unsigned char* shortname, bool is_directory) { - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; unsigned char* entry; unsigned int idx = firstentry % DIR_ENTRIES_PER_SECTOR; unsigned int sector = firstentry / DIR_ENTRIES_PER_SECTOR; @@ -1194,7 +1194,7 @@ #else struct bpb* fat_bpb = &fat_bpbs[0]; #endif - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; unsigned char shortname[12]; int rc; unsigned int sector; @@ -1429,7 +1429,7 @@ static int update_short_entry( struct fat_file* file, long size, int attr ) { - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; int sector = file->direntry / DIR_ENTRIES_PER_SECTOR; unsigned char* entry = buf + DIR_ENTRY_SIZE * (file->direntry % DIR_ENTRIES_PER_SECTOR); @@ -1594,7 +1594,7 @@ #else struct bpb* fat_bpb = &fat_bpbs[0]; #endif - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; int i; long sector; int rc; @@ -1731,7 +1731,7 @@ static int free_direntries(struct fat_file* file) { - unsigned char buf[SECTOR_SIZE]; + unsigned char buf[SECTOR_BUFFER_SIZE]; struct fat_file dir; int numentries = file->direntries; unsigned int entry = file->direntry - numentries + 1; @@ -2380,3 +2380,13 @@ return (volumebpb_bytspersec; +} +#endif Index: firmware/export/config-ipodvideo.h =================================================================== RCS file: /cvsroot/rockbox/firmware/export/config-ipodvideo.h,v retrieving revision 1.24 diff -u -r1.24 config-ipodvideo.h --- firmware/export/config-ipodvideo.h 5 Oct 2006 11:27:47 -0000 1.24 +++ firmware/export/config-ipodvideo.h 12 Oct 2006 01:18:52 -0000 @@ -118,6 +118,10 @@ /* Define this if you can read an absolute wheel position */ #define HAVE_WHEEL_POSITION +/* Define this if the fat sector size is not alwyas 512 */ +#define HAVE_MULTI_FAT_SECTOR_SIZE 1 +#define MAX_FAT_SECTOR 2048 + #define BOOTFILE_EXT "ipod" #define BOOTFILE "rockbox." BOOTFILE_EXT Index: firmware/export/fat.h =================================================================== RCS file: /cvsroot/rockbox/firmware/export/fat.h,v retrieving revision 1.14 diff -u -r1.14 fat.h --- firmware/export/fat.h 31 Jul 2006 22:59:45 -0000 1.14 +++ firmware/export/fat.h 12 Oct 2006 01:18:52 -0000 @@ -23,7 +23,14 @@ #include #include "ata.h" /* for volume definitions */ -#define SECTOR_SIZE 512 +#ifdef HAVE_MULTI_FAT_SECTOR_SIZE +#define SECTOR_BUFFER_SIZE MAX_FAT_SECTOR +int get_fat_sector_size(void); +#define SECTOR_SIZE get_fat_sector_size() +#else +#define SECTOR_BUFFER_SIZE 512 +#define SECTOR_SIZE SECTOR_BUFFER_SIZE +#endif /* Number of bytes reserved for a file name (including the trailing \0). Since names are stored in the entry as UTF-8, we won't be able to @@ -78,7 +85,7 @@ unsigned int entrycount; long sector; struct fat_file file; - unsigned char sectorcache[3][SECTOR_SIZE]; + unsigned char sectorcache[3][SECTOR_BUFFER_SIZE]; };