Changes between Initial Version and Version 1 of sysace/FAT


Ignore:
Timestamp:
Jul 19, 2006, 9:51:50 PM (18 years ago)
Author:
snovich
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • sysace/FAT

    v1 v1  
     1= Implementing a FAT file system =
     2
     3Before reading further, please note that detailed information on this may be found in your “OS and Libraries Reference Guide.” Located in:  \\EDK\doc\oslib_rm.pdf
     4[[BR]]
     5Compact Flash may also be used on WARP for implementing a simple FAT File system. If reconfiguration is not a required ability for the system, the card may also be formatted in FAT12 format. For information on how to properly format the flash card, please refer to the first section of this document, “Formatting and Loading Systems on to a Compact Flash.” To implement the FAT system in hardware, the procedure is as follows:
     6
     7 1. Instantiate the SystemACE controller when building the system
     8 1. Modify the MSS to include the FATFS library (can be added and modified in '''“Software”->”Software Platform Settings…”''')
     9 1. Add the required libraries
     10
     11An example MSS modification is as follows – simply add the following code to the bottom of the system MSS file:
     12
     13{{{
     14BEGIN LIBRARY
     15 PARAMETER LIBRARY_NAME = xilfatfs
     16 PARAMETER LIBRARY_VER = 1.00.a
     17# # add write capabilities
     18 PARAMETER CONFIG_WRITE = true
     19# # add make/change dir support needed for the libs to work correctly.
     20 PARAMETER CONFIG_DIR_SUPPORT = true
     21# don't not work with FAT12 systems. Use 16 and/or 32
     22 PARAMETER CONFIG_FAT12 = false
     23# max files alloted
     24 PARAMETER CONFIG_MAXFILES = 5
     25# buffer size
     26 PARAMETER CONFIG_BUFCACHE_SIZE = 10240
     27 PARAMETER PROC_INSTANCE = ppc405_0
     28END
     29}}}
     30
     31This code can be tweaked according to the needs of the user. More detailed information on twekable parameters can be found in:  \\EDK\doc\oslib_rm.pdf The final step to this procedure is to add the required libraries:
     32
     33 * sysace_stdio.h (does not require the user to manually add the *.c & *.h files)
     34  * Contains the core FATFS functions. Detailed in  \\EDK\doc\oslib_rm.pdf
     35 *sysace_l.h (does not require the user to manually add the *.c & *.h files)
     36  * Contains core SysACE controller functions needed for warpsysace.h
     37 * sysace.h (does not require the user to manually add the *.c & *.h files)
     38  * Contains core SysACE controller functions needed for warpsysace.h
     39 * warpsysace.h ('''requires''' the user to manually add the *.c & *.h files)
     40  * Contains the necessary lock function for SysACE to work
     41  * Provides extra functionality, such as a file-logging system
     42 * warplib.h ('''requires''' the user to add the library files manually)
     43  * Required for warpsysace to function
     44
     45Once these items have been implemented, the user must apply the '''WarpSysace_GetLock(base_addr)''' function, as detailed in section of this document entitled, “Reconfiguring On Flash Using Software.” Once this function has been called, the user is free to utilize the FAT-file functionality as detailed in: \\EDK\doc\oslib_rm.pdf .
     46This includes opening/closing and creating/deleting files, and making/removing directories. There are some '''IMPORTANT''' items to note, however, that will ensure the user gets the desired functionality of the system:
     47
     48 * to make files, user only needs to use “sysace_fopen”
     49  * the file must return a defined type int for use in other sysace functions, (such as sysace_fread)
     50 * The largest string size that can be written is defined by the buffer size of the library in the system MSS file
     51 * To append data to a file, simply do not close it and perform more writes
     52 * When done modifying a file, always close it. This may otherwise result in a corrupt file.
     53 * If things freeze (can happen after lots of changes) – reformat the card again with mkdosfs