Changes between Version 1 and Version 2 of file_system

Jan 11, 2020, 8:25:02 PM (4 years ago)



  • file_system

    v1 v2  
    5 == A) General principles ==
     5== __A) General principles__ ==
    7 TBD...
     7As most POSIX compliant operating systems,  ALMOS-MKH sees the external storage device as an array of clusters, where each clusters can store one page of 4 Kbytes. Each cluster occupies eight  512 bytes physical sectors, and is indexed by a cluster identifier, calledd ''cluster_id''.
     9To support various File System types, ALMOS-MKH defines a generic Virtual File System API defined in the
     10 [  almos-mkh/kernel/fs/vfs.c] et [ almos-mkh/kernel/fs/vfs.h] files.
     12All supported fille systems are supposed to have a hierarchical tree_based structure, where some special ''directory'' files contain ''links''  to other files that can be ''directory'' files, or ''terminal'' files. Therefore, any file X in the file system can be unambiguously defined by a ''pathname'' describing the path from the VFS root to the X file. A ''directory'' file has only on single path name, but a ''terminal'' file can have several ''parent'' directories, defining several path names for one single file.
     14The ''directory'' file format is specific for each file system type.
     16Any ''cluster_id'' can be allocated to any file (terminal or directory), and for all supported file systems, the ordered set of clusters allocated to a given file is registered in a structure called ''File Allocation Table'' (FAT).
     18The ''FAT'' format is specific for each file system type.
     20Any file system stores three types of informations:
     21 1. some clusters are used to store the '''terminal files''',
     22 1. other clusters are used to store the '''directory files''',
     23 1. specific clusters are used to store the ''FAT''.
     25As all UNIX or Microsoft operating systems ALMOS-MKH implements a File System Cache, that is a partial copy, in kernel memory, of the file system on device. The VFS is actually the implementation of this generic File System Cache.
     27The file systems currently supported by ALMOS-MKH are
     28 * the '''FATFS''' respects the Microsoft FAT32 format,
     29 * the '''DEVFS''' describes all peripheral devices available in the hardware architecture,
     30 * the '''RAMFS''' isentirely implemented in physical memory, and does not require any access to an external block device.
     32== B) __VFS implementation__ ==
     34To reduce the memory footprint of this File System Cache, ALMOS-MKH uses two methods:
     35 * For the '''directory''' files, only a subset or the directory entries contained is copied in the File System Cache.
     36 * For the '''terminal'' files, only the pages that have been actually accessed are copied in the File System Cache.
     37This File System Cache is therefore dynamically extended by the OS to satisfy the user processes requests.
     38The physical memory allocated to this cache is only released when a file is removed from the file system on device.
     40=== B.1 Inodes Tree ===
     43=== B.2 File Mapper ===
     46=== B.3 FIle Descriptor ===