path: root/firmware/export
diff options
authorJens Arnold <>2006-12-04 21:37:22 +0000
committerJens Arnold <>2006-12-04 21:37:22 +0000
commitef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083 (patch)
tree073e5fe264f0edcfc907254320b4f90e74042672 /firmware/export
parent74369b4a7b1b91371dc90905dc26e54b919d81a4 (diff)
Much simpler implementation of large virtual sector support, not needing larger sector buffers and not touching file.c at all. secmult is simply used to normalize all sector counts to 512-byte physical sectors. * Moved MAX_SECTOR_SIZE definition to config-*.h, and enabled it for iPod Video only. MAX_SECTOR_SIZE now only enables checking for alternate disk layouts due to sector size (as iPod Video G5.5 is presented as having 2048-byte _physical_ sectors to the PC). Large virtual sector support in fat.c is always enabled.
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
2 files changed, 6 insertions, 10 deletions
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index 0caa2f2421..b2b56158f3 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -121,6 +121,10 @@
/* Define this if you can read an absolute wheel position */
+/* define this if the device has larger sectors when accessed via USB */
+/* (only relevant in disk.c, fat.c now always supports large virtual sectors) */
+#define MAX_SECTOR_SIZE 2048
#define BOOTFILE_EXT "ipod"
#define BOOTFILE "rockbox." BOOTFILE_EXT
diff --git a/firmware/export/fat.h b/firmware/export/fat.h
index 4110f765a3..2680fdf751 100644
--- a/firmware/export/fat.h
+++ b/firmware/export/fat.h
@@ -24,14 +24,7 @@
#include "ata.h" /* for volume definitions */
#include "config.h"
-/* Some never players (such as iPod 5.5G) might have 2048 bytes per sector. */
-#ifdef IPOD_VIDEO
-#define MAX_SECTOR_SIZE 2048
-#define MAX_SECTOR_SIZE 512
+#define SECTOR_SIZE 512
/* 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
@@ -86,7 +79,7 @@ struct fat_dir
unsigned int entrycount;
long sector;
struct fat_file file;
- unsigned char sectorcache[3][MAX_SECTOR_SIZE];
+ unsigned char sectorcache[3][SECTOR_SIZE];
@@ -109,7 +102,6 @@ extern int fat_create_file(const char* name,
extern long fat_readwrite(struct fat_file *ent, long sectorcount,
void* buf, bool write );
extern int fat_closewrite(struct fat_file *ent, long size, int attr);
-extern int fat_get_secsize(const struct fat_file *file);
extern int fat_seek(struct fat_file *ent, unsigned long sector );
extern int fat_remove(struct fat_file *ent);
extern int fat_truncate(const struct fat_file *ent);