= GIET-VM / FAT32 Handler = This section define the kernel data structure and functions that are used to access a FAT32 file system stored on a mass storage block device (such as BDV, HBA, SDC, or RDK peripherals). [[PageOutline]] * The [source:soft/giet_vm/giet_fat32/fat_sync.c fat_sync.c] and [source:soft/giet_vm/giet_fat32/fat_sync.h fat_sync.h] files define the functions to access the block device with a polling policy on the peripheral status. * The [source:soft/giet_vm/giet_fat32/fat_irq.c fat_irq.c] and [source:soft/giet_vm/giet_fat32/fat_irq.h fat_irq.h] files define the functions to access the block device with a a descheduling / completion IRQ policy. * The [source:soft/giet_vm/giet_fat32/fat_common.c fat_common.c] and [source:soft/giet_vm/fat_common.h fat_common.h] files define the functions that are independant on the blockdevice access mode. All these functions are prefixed by ''_'' to remind that they can only be executed by a processor in kernel mode. The [source:soft/giet_vm/giet_kernel/sys_handler.c _syscall_vector] array contains the 64 kernel functions (syscal handlers) defined by the GIET-VM to handle system calls. == Common FAT32 access functions == == Polling based FAT32 access functions == The following functions are intended to be used by the GIET_VM boot-loader, when the interrupts are not yet enabled. They use a polling strategy on the block device status to detect completion. === 1) int '''_fat_sync_open'''( ) === === 2) int '''_fat_sync_read'''( unsigned int fd_id , unsigned int buffer , unsigned int count , unsigned int offset ) === This function transfer an integer number of blocks from an open file on the block device to a memory buffer, after checking the arguments. If the number of requested sectors exceeds the file size, this number of sectors is reduced. * '''fd_id''' : file descriptor index * '''buffer''' : memory buffer virtual base address * '''count''' : number of blocks to transfer * '''offset''' : number of blocks to skip in file Returns number of sectors transfered if success, returns -1 if error. === 3) int '''_fat_sync_ioc_access( unsigned int to_memory , unsigned int lba , unsigned int buf_vaddr , unsigned int count ) === This function computes the buffer physical address, and call the proper block device driver, as specified in the mapping. * '''to_memory''' : to memory transfer if non zero. * '''lba''' : first block index on the block device. * '''buf_vaddr''' : memory buffer virtual base address * '''count''' : number of blocks to transfer Returns 0 if success, returns -1 if error. == Interrupt based FAT32 access functions ==