Skip to content
Snippets Groups Projects
  1. Oct 01, 2011
  2. Oct 12, 2010
    • Mikhail Zolotaryov's avatar
      VFAT: fix processing of scattered long file name entries · 3831530d
      Mikhail Zolotaryov authored
      
      The U-Boot code has the following bugs related to the processing of Long File
      Name (LFN) entries scattered across several clusters/sectors :
      
      1) get_vfatname() function is designed to gather scattered LFN entries by
      cluster chain processing - that doesn't work for FAT12/16 root directory.
      In other words, the function expects the following input data:
       1.1) FAT32 directory (which is cluster chain based);
              OR
       1.2) FAT12/16 non-root directory (which is also cluster chain based);
              OR
       1.3) FAT12/16 root directory (allocated as contiguous sectors area), but
       all necessary information MUST be within the input buffer of filesystem cluster
       size (thus cluster-chain jump is never initiated).
      
      In order to accomplish the last condition, root directory parsing code in
      do_fat_read() uses the following trick: read-out cluster-size block, process
      only first sector (512 bytes), then shift 512 forward, read-out cluster-size
      block and so on. This works great unless cluster size is equal to 512 bytes
      (in a case you have a small partition), or long file name entries are scattered
      across three sectors, see 4) for details.
      
      2) Despite of the fact that get_vfatname() supports FAT32 root directory
      browsing, do_fat_read() function doesn't send current cluster number correctly,
      so root directory look-up doesn't work correctly.
      
      3) get_vfatname() doesn't gather scattered entries correctly also is the case
      when all LFN entries are located at the end of the source cluster, but real
      directory entry (which must be returned) is at the only beginning of the
      next one. No error detected, the resulting directory entry returned contains
      a semi-random information (wrong size, wrong start cluster number and so on)
      i.e. the entry is not accessible.
      
      4) LFN (VFAT) allows up to 20 entries (slots) each containing 26 bytes (13
      UTF-16 code units) to represent a single long file name i.e. up to 520 bytes.
      U-Boot allocates 256 bytes buffer instead, i.e. 10 or more LFN slots record
      may cause buffer overflow / memory corruption.
      Also, it's worth to mention that 20+1 slots occupy 672 bytes space which may
      take more than one cluster of 512 bytes (medium-size FAT32 or small FAT16
      partition) - get_vfatname() function doesn't support such case as well.
      
      The patch attached fixes these problems in the following way:
      - keep using 256 bytes buffer for a long file name, but safely prevent a
      possible buffer overflow (skip LFN processing, if it contains 10 or more
      slots).
      
      - explicitly specify FAT12/16 root directory parsing buffer size, instead
      of relying on cluster size. The value used is a double sector size (to store
      current sector and the next one). This fixes the first problem and increases
      performance on big FAT12/16 partitions;
      
      - send current cluster number (FAT32) to get_vfatname() during root
      directory processing;
      
      - use LFN counter to seek the real directory entry in get_vfatname() - fixes the
      third problem;
      
      - skip deleted entries in the root directory (to prevent bogus buffer
      overflow detection and LFN counter steps).
      
      Note: it's not advised to split up the patch, because a separate part may
      operate incorrectly.
      
      Signed-off-by: default avatarMikhail Zolotaryov <lebon@lebon.org.ua>
      3831530d
  3. Jul 24, 2010
  4. Dec 04, 2008
    • Remy Bohmer's avatar
      Remove non-ascii characters from fat code · 3c2c2f42
      Remy Bohmer authored
      
      This code contains some non-ascii characters in comment lines and code.
      Most editors do not display those characters properly and editing those
      files results always in diffs at these places which are usually not required
      to be changed at all. This is error prone.
      
      So, remove those weird characters and replace them by normal C-style
      equivalents for which the proper defines were already in the header.
      
      Signed-off-by: default avatarRemy Bohmer <linux@bohmer.net>
      3c2c2f42
  5. May 20, 2008
    • Wolfgang Denk's avatar
      Big white-space cleanup. · 53677ef1
      Wolfgang Denk authored
      
      This commit gets rid of a huge amount of silly white-space issues.
      Especially, all sequences of SPACEs followed by TAB characters get
      removed (unless they appear in print statements).
      
      Also remove all embedded "vim:" and "vi:" statements which hide
      indentation problems.
      
      Signed-off-by: default avatarWolfgang Denk <wd@denx.de>
      53677ef1
  6. Mar 02, 2008
  7. Aug 14, 2006
  8. Apr 23, 2004
    • Wolfgang Denk's avatar
      * Modify KUP4X board configuration to use SL811 driver for USB memory · 5cf91d6b
      Wolfgang Denk authored
        sticks (including FAT / VFAT filesystem support)
      
      * Add SL811 Host Controller Interface driver for USB
      
      * Add CFG_I2C_EEPROM_ADDR_OVERFLOW desription to README
      
      * Patch by Pantelis Antoniou, 19 Apr 2004:
        Allow to use shell style syntax (i. e. ${var} ) with standard parser.
        Minor patches for Intracom boards.
      
      * Patch by Christian Pell, 19 Apr 2004:
        cleanup support for CF/IDE on PCMCIA for PXA25X
      5cf91d6b
  9. Apr 15, 2004
  10. Feb 23, 2004
    • Wolfgang Denk's avatar
      * Patch by Thomas Elste, 10 Feb 2004: · 2d1a537d
      Wolfgang Denk authored
        Add support for NET+50 CPU and ModNET50 board
      
      * Patch by Sam Song, 10 Feb 2004:
        Fix typos in cfi_flash.c
      
      * Patch by Leon Kukovec, 10 Feb 2004
        Fixed long dir entry slot id calculation in get_vfatname
      
      * Patch by Robin Gilks, 10 Feb 2004:
        add "itest" command (operators: -eq, -ne, -lt, -gt, -le, -ge, ==,
        !=, <>, <, >, <=, >=)
      2d1a537d
  11. Feb 10, 2004
  12. Dec 07, 2003
    • Wolfgang Denk's avatar
      * Patch by Pierre Aubert, 24 Nov 2003: · 9fd5e31f
      Wolfgang Denk authored
        - add a return value for the fpga command
        - add ide_preinit() function called in ide_init if CONFIG_IDE_PREINIT
          is defined. If ide_preinit fails, ide_init is aborted.
        - fix an endianess problem in fat.h
      9fd5e31f
  13. Sep 10, 2003
    • Wolfgang Denk's avatar
      * Patches by Denis Peter, 9 Sep 2003: · 7205e407
      Wolfgang Denk authored
        add FAT support for IDE, SCSI and USB
      
      * Patches by Gleb Natapov, 2 Sep 2003:
        - cleanup of POST code for unsupported architectures
        - MPC824x locks way0 of data cache for use as initial RAM;
          this patch unlocks it after relocation to RAM and invalidates
          the locked entries.
      
      * Patch by Gleb Natapov, 30 Aug 2003:
        new I2C driver for mpc107 bridge. Now works from flash.
      
      * Patch by Dave Ellis, 11 Aug 2003:
        - JFFS2: fix typo in common/cmd_jffs2.c
        - JFFS2: fix CFG_JFFS2_SORT_FRAGMENTS option
        - JFFS2: remove node version 0 warning
        - JFFS2: accept JFFS2 PADDING nodes
        - SXNI855T: add AM29LV800 support
        - SXNI855T: move environment from EEPROM to flash
        - SXNI855T: boot from JFFS2 in NOR or NAND flash
      
      * Patch by Bill Hargen, 11 Aug 2003:
        fixes for I2C on MPC8240
        - fix i2c_write routine
        - fix iprobe command
        - eliminates use of global variables, plus dead code, cleanup.
      7205e407
  14. Jun 15, 2003
    • Wolfgang Denk's avatar
      * Fix CONFIG_NET_MULTI support in include/net.h · 71f95118
      Wolfgang Denk authored
      * Patches by Kyle Harris, 13 Mar 2003:
        - Add FAT partition support
        - Add command support for FAT
        - Add command support for MMC
        ----
        - Add Intel PXA support for video
        - Add Intel PXA support for MMC
        ----
        - Enable MMC and FAT for lubbock board
        - Other misc changes for lubbock board
      71f95118
Loading