summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
AgeCommit message (Collapse)Author
2007-10-16Finally full multicore support for PortalPlayer 502x targets with an eye ↵Michael Sevakis
towards the possibility of other types. All SVN targets the low-lag code to speed up blocking operations. Most files are modified here simple due to a name change to actually support a real event object and a param change to create_thread. Add some use of new features but just sit on things for a bit and leave full integration for later. Work will continue on to address size on sensitive targets and simplify things if possible. Any PP target having problems with SWP can easily be changed to sw corelocks with one #define change in config.h though only PP5020 has shown an issue and seems to work without any difficulties. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15134 a1c6a512-1295-4272-9138-f99709370657
2007-10-10Fix FS #5852 by trying to properly close and update the recorded file, and ↵Peter D'Hoye
give the FAT the correct file info. Add filehandle checks to some file functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15072 a1c6a512-1295-4272-9138-f99709370657
2007-07-09Prevent another divide-by-zero (only affecting targets with FAT16 support ↵Dave Chapman
enabled, such as the Sansa). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13837 a1c6a512-1295-4272-9138-f99709370657
2007-07-09Fix division by 0 errorRobert Keevil
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13836 a1c6a512-1295-4272-9138-f99709370657
2007-07-05Fix a (minor) disk corruption when moving directories around. Fixes FS #7359Peter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13797 a1c6a512-1295-4272-9138-f99709370657
2007-07-03Fix serious bug in FAT filename check, preventing most files from being ↵Magnus Holmgren
created (if they contain a '.', no less). Also allow a few more chars in the long filename and make the code a bit smaller (as in FS #6358). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13776 a1c6a512-1295-4272-9138-f99709370657
2007-07-03Proper filename checking in the FAT driver (FS#7222 and FS#6358)Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13770 a1c6a512-1295-4272-9138-f99709370657
2007-03-16Set CONFIG_RTC to 0 for non-RTC targets, and check with #if to profit from ↵Jens Arnold
-Wundef. No code change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12811 a1c6a512-1295-4272-9138-f99709370657
2007-03-03remove runtime detection of h1x0 series RTC MOD, but leave driver codeRobert Kukla
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12554 a1c6a512-1295-4272-9138-f99709370657
2007-02-28FS#6419 - driver for H1x0 series RTC Mod with runtime detectionRobert Kukla
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12520 a1c6a512-1295-4272-9138-f99709370657
2007-02-25Remove unused code, make comments c-style, make one private function staticNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12480 a1c6a512-1295-4272-9138-f99709370657
2007-02-24Use the correct constant to avoid confusionPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12476 a1c6a512-1295-4272-9138-f99709370657
2007-02-24Better short filename generation. Fixes FS#6648.Peter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12475 a1c6a512-1295-4272-9138-f99709370657
2007-01-29Reverting the FAT32 driver change - it seems to have introduced a bugLinus Nielsen Feltzing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12152 a1c6a512-1295-4272-9138-f99709370657
2007-01-29Changed fat_getnext():Linus Nielsen Feltzing
1) Fixed a bug where really long filenames could be messed up if they spanned 3 sectors 2) Now uses 2 buffers instead of 3, without copying the buffers with memcpy() 3) Can now use aligned sector reads, first step towards iPod 5.5G 80GB git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12151 a1c6a512-1295-4272-9138-f99709370657
2006-12-04Much simpler implementation of large virtual sector support, not needing ↵Jens Arnold
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
2006-12-03Removed unused variable, and fixed overflow in free/total calculation. There ↵Jens Arnold
are still some suspicious things in here... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11656 a1c6a512-1295-4272-9138-f99709370657
2006-12-03Fixed the warnings.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11653 a1c6a512-1295-4272-9138-f99709370657
2006-12-03Add support (runtime detection) for 2048 bytes/sector filesystem.Miika Pekkarinen
Large sectors are enabled for iPod Video (including 5.5G) only. Might still cause FS corruption (however, unlikely), so beware! Based on FS#6169 by Robert Carboneau. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11651 a1c6a512-1295-4272-9138-f99709370657
2006-08-02Reduced the logf output. Please enable the lines only when necessary.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10410 a1c6a512-1295-4272-9138-f99709370657
2006-07-31Applied FS# 5736 by Alexander Levin.Rani Hod
Fixed fat buffer overflow with LFNs longer than 255 bytes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10389 a1c6a512-1295-4272-9138-f99709370657
2006-05-13Correctly test on volume id flagPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9925 a1c6a512-1295-4272-9138-f99709370657
2006-04-08Comparing short filenames for uniqueness used 1 char too much, causing it to ↵Peter D'Hoye
create identical short filenames. Fixes bugreport #5030. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9563 a1c6a512-1295-4272-9138-f99709370657
2005-12-06waiting is over: initial unicode commitMarcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8169 a1c6a512-1295-4272-9138-f99709370657
2005-12-04Replace references to HAVE_RTC with CONFIG_RTC and remove the HAVE_RTC ↵Dave Chapman
defines from config-*.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8147 a1c6a512-1295-4272-9138-f99709370657
2005-10-06Cosmetic correction (doesn't affect compiled code) - use letohNN instead of ↵Dave Chapman
htoleNN in update_fat_entry() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7586 a1c6a512-1295-4272-9138-f99709370657
2005-10-06Replace SWAB16 and SWAB32 with a comprehensive set of byte-swap macros - ↵Dave Chapman
letoh16, letoh32, htole16, htole32, betoh16, betoh32, htobe16 and htobe32 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7584 a1c6a512-1295-4272-9138-f99709370657
2005-09-07Adds a filename sanity check to add_dir_entry that at the moment only checks ↵Jonas Häggqvist
for names ending in a period, but can easily be extended. Changes the error codes for add_dir_entry. Fixes bug #782248. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7487 a1c6a512-1295-4272-9138-f99709370657
2005-09-06For targets without an RTC, use the rockbox build date as the start date in ↵Jens Arnold
the FAT driver. No more 2003-08-01 files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7478 a1c6a512-1295-4272-9138-f99709370657
2005-04-27Adding entries to the FAT16 root dir still failed under certain conditions. ↵Jens Arnold
The shortcut check cannot work the way it was implemented - removed it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6363 a1c6a512-1295-4272-9138-f99709370657
2005-04-23create_dos_name() return value was meaningless.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6333 a1c6a512-1295-4272-9138-f99709370657
2005-04-22Bugfixes: (1) add_dir_entry() always appended new entries, although the ↵Jens Arnold
code intended to reuse deleted entries. New code reuses deleted entries whenever possible. (2) If the code could not extend the dir to append new entries (FAT16 root dir or disk full), it failed because of (1). (3) Even if reuse had worked, it would never have reused entry 0. (4) Shortname char 0xE5->0x05 replacement to avoid treatment as free entry was done for all chars although it should only be done for the first. The 0x05->0xE5 replacement on read was missing altogether. (5) Obey directory size limit (65536 entries == 2 MB). Improvements: (1) The (undocumented) flags used by WinNT derivates to store the case of a shortname's name and extension part are now supported for reading. (2) smaller code size. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6332 a1c6a512-1295-4272-9138-f99709370657
2005-03-07Little fix, when debug is disabled clusterchain length was incorrectly computedJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6163 a1c6a512-1295-4272-9138-f99709370657
2005-02-28long policy fixesJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6082 a1c6a512-1295-4272-9138-f99709370657
2005-02-27couple of fixes for 16 bits archsJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6073 a1c6a512-1295-4272-9138-f99709370657
2005-02-26long policyJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6071 a1c6a512-1295-4272-9138-f99709370657
2005-02-25more long policyJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6065 a1c6a512-1295-4272-9138-f99709370657
2005-02-25more long policyJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6053 a1c6a512-1295-4272-9138-f99709370657
2005-02-16Shortnames must be uppercase...Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5994 a1c6a512-1295-4272-9138-f99709370657
2005-02-16For shortname creation, replace most illegal characters by underscores ↵Jens Arnold
instead of removing them, thereby lowering the chance to create a blank (illegal) name. Spaces and control chars are still removed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5991 a1c6a512-1295-4272-9138-f99709370657
2005-02-16Preserve the longname extension as much as possible for shortname creation. ↵Jens Arnold
Randomise the last 4 chars of the name part instead, but only if there is a clash. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5988 a1c6a512-1295-4272-9138-f99709370657
2005-02-03Simplification.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5766 a1c6a512-1295-4272-9138-f99709370657
2005-02-03Fixed max_cluster calculationJens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5765 a1c6a512-1295-4272-9138-f99709370657
2005-01-28preparations for hotswapping MMCJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5701 a1c6a512-1295-4272-9138-f99709370657
2005-01-24More int -> longJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5654 a1c6a512-1295-4272-9138-f99709370657
2005-01-23int -> long where neededJean-Philippe Bernardy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5642 a1c6a512-1295-4272-9138-f99709370657
2005-01-05Fixed some warnings.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5537 a1c6a512-1295-4272-9138-f99709370657
2005-01-05unmount function in preparation for MMC hotswap, more mutexingJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5536 a1c6a512-1295-4272-9138-f99709370657
2005-01-04Multivolume: prevent file rename attempts across volumes.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5535 a1c6a512-1295-4272-9138-f99709370657
2005-01-04modify fat cache entries atomic, this was potentially unsafeJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5534 a1c6a512-1295-4272-9138-f99709370657