Changes between Version 6 and Version 7 of file_system


Ignore:
Timestamp:
Jun 7, 2015, 12:31:45 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v6 v7  
    33[[PageOutline]]
    44
    5 This section describes  GIET_VM [wiki:library_stdio system calls] and [wiki:user_libraries user libraries]. The multi-threaded applications have been designed to analyse the TSAR manycore architecture scalability.
     5This section describes  the GIET_VM File System, that respect the FAT32 standard.
    66
    77== 1) General Principles ==
     
    2727
    2828 * The global Fat_Descriptor contains general information such as the FAT region lba and size, the DATA region lba and size, and pointers on the Fat-Cache or Inode-Tree.
     29
     30To support various block device peripheral, this FAT32 implementation defines a generic function to access the physical block device, using the driver specified in the ''hard_config.h'' file. Five drivers are presently supported ( IOC_BDV / IOC_HBA / IOC_SDC / IOC_SPI / IOC_RDK ).
    2931
    3032WARNING 1: A node name (file or directory) cannot be larger than 38 characters.
     
    5658for each modified block.
    5759
    58 == 4) Block Device Drivers ==
    59 
    60 To support various block device peripheral, this FAT32 implementation defines a generic _fat_ioc_access() function to access the physical block device. This function transfer one or several blocks between the block device and the file_cache by calling the relevant driver.
    61 
    62 === int '''_fat_ioc_access'''( unsigned int use_irq ,  unsigned int to_mem ,  unsigned int lba , unsigned int buf_vaddr , unsigned int count ) ===
    63  * '''use_irq''' : boolean (use descheduling mode if supported by the IOC driver)
    64  * '''to_mem''' : boolean (from block device to memory if non zero)
    65  * '''lba''' : logical block address on block device
    66  * '''buf_vaddr''' : memory buffer virtual address
    67  * ''' count''' : number of blocks to be transferred
    68 
    69 == 5) Access Functions ==
     60== 4) Access Functions ==
    7061
    7162=== int '''_fat_init'''( unsigned int use_irq ) ===
    7263This function initializes the statically defined FAT structures:
    73  *  Fat-Descriptor 
    74  *  File-Descriptors-Array
    75  *  Fat_Cache root
    76  *  Inode_Tree root
     64 *  Fat-Descriptor.
     65 *  File-Descriptors-Array.
     66 *  Fat-Cache root.
     67 *  Inode-Tree root.
    7768As is called by the boot-loader, and by the kernel_init, it does not use dynamic memory allocation.
    7869The polling/descheduling mode is defined by the '''use_irq''' argument.
     
    9990It returns 0 if success /  It returns -1 if failure.
    10091
     92=== int '''_fat_file_info( unsigned int fd_id , unsigned int* size , unsigned int* offset ) ===
     93This function implements the giet_fat_file_info() system call.
     94It returns the size and the current offset value for a file identified  by the "fd_id" argument.
     95 * '''fd_id''' : file descriptor index
     96 * '''size''' : pointer on the size (return buffer)
     97 * '''offset''' : pointer on the offset (return buffer)
     98It returns 0 if success /  It returns -1 if failure.
    10199
     100=== int '''_fat_read'''( unsigned int fd_id , void* buffer , unsigned int count ) ===
     101The following function implements the "giet_fat_read()" system call, that has the same semantic as the UNIX "read()" function.
     102It access the File-Cache  associated to the file identified by the file descriptor, and transfers "count" bytes from the cache to the user buffer, starting from the current file offset.
     103In case of miss in the File_Cache, it loads all involved clusters into the cache.
     104 * '''fd_id''' : file descriptor index
     105 * '''buffer''' : pointer on the memory buffer
     106 * '''count''' : number of bytes
     107It returns the number of bytes actually transfered if success / It returns 0 if (offset + count > file_size) / It returns -1 if failure.
     108
     109=== int '''_fat_write'''( unsigned int fd_id , void* buffer , unsigned int count ) ===
     110The following function implements the "giet_fat_write()" system call, that has the same semantic as the UNIX "write()" function.
     111It access the File-Cache associated to the file identified by the file descriptor, and transfers count bytes from the user buffer,
     112to the cache, starting from the current file offset. It loads all involved clusters into cache if required. If (offset + count) is larger than the current file size, it increases the file size. It allocates new clusters if required, and updates the Fat-Cache and the FAT region on block device. As it implements a Write-Back policy, the DATA region on block device is not updated, but the modified clusters are marked dirty.
     113 * '''fd_id''' : file descriptor index
     114 * '''buffer''' : pointer on the memory buffer
     115 * '''count''' : number of bytes
     116It returns the number of bytes actually transfered if success / It returns -1 if failure.
     117
     118=== int '''_fat_ioc_access'''( unsigned int use_irq ,  unsigned int to_mem ,  unsigned int lba , unsigned int buf_vaddr , unsigned int count ) ===
     119This function transfer one or several blocks between the block device and a memory buffer by calling the relevant driver.
     120 * '''use_irq''' : boolean (use descheduling mode if supported by the IOC driver)
     121 * '''to_mem''' : boolean (from block device to memory if non zero)
     122 * '''lba''' : logical block address on block device
     123 * '''buf_vaddr''' : memory buffer virtual address
     124 * ''' count''' : number of blocks to be transferred
     125It returns 0 if success /  It returns -1 if failure.
     126