diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2006-12-04 21:37:22 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2006-12-04 21:37:22 +0000 |
| commit | ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083 (patch) | |
| tree | 073e5fe264f0edcfc907254320b4f90e74042672 /firmware/common/disk.c | |
| parent | 74369b4a7b1b91371dc90905dc26e54b919d81a4 (diff) | |
| download | rockbox-ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083.zip rockbox-ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083.tar.gz rockbox-ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083.tar.bz2 rockbox-ef3e129b6530b1694c0fcfa8ee2fbdf3ea95b083.tar.xz | |
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://svn.rockbox.org/rockbox/trunk@11659 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common/disk.c')
| -rw-r--r-- | firmware/common/disk.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index f5f9f19..c58ae3e 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -152,26 +152,29 @@ int disk_mount(int drive) real problem. */ for (i=0; volume != -1 && i<4; i++) { - if (!fat_mount(IF_MV2(volume,) IF_MV2(drive,) pinfo[i].start)) +#ifdef MAX_SECTOR_SIZE + int j; + + for (j = 1; j <= (MAX_SECTOR_SIZE/SECTOR_SIZE); j <<= 1) { - mounted++; - vol_drive[volume] = drive; /* remember the drive for this volume */ - volume = get_free_volume(); /* prepare next entry */ - continue; + if (!fat_mount(IF_MV2(volume,) IF_MV2(drive,) pinfo[i].start * j)) + { + pinfo[i].start *= j; + pinfo[i].size *= j; + mounted++; + vol_drive[volume] = drive; /* remember the drive for this volume */ + volume = get_free_volume(); /* prepare next entry */ + break; + } } - -# if MAX_SECTOR_SIZE != PHYSICAL_SECTOR_SIZE - /* Try again with sector size 2048 */ - if (!fat_mount(IF_MV2(volume,) IF_MV2(drive,) pinfo[i].start - * (MAX_SECTOR_SIZE/PHYSICAL_SECTOR_SIZE))) +#else + if (!fat_mount(IF_MV2(volume,) IF_MV2(drive,) pinfo[i].start)) { - pinfo[i].start *= MAX_SECTOR_SIZE/PHYSICAL_SECTOR_SIZE; - pinfo[i].size *= MAX_SECTOR_SIZE/PHYSICAL_SECTOR_SIZE; mounted++; vol_drive[volume] = drive; /* remember the drive for this volume */ volume = get_free_volume(); /* prepare next entry */ } -# endif +#endif } #endif |