HOME

Top 10 List of Week 03

  1. A file is an abstract data type defined and implemented by operating system. The operating system can provide system calls to create, write, read, reposition, delete and truncate files.There are many types of files, text file (sequence of characters organized into lines and pages), source file (sequence of functions followed by executable statements) and executable file (series of code sections that the loader can bring into memory and execute). File has many attributes, for example name, identifier,type, location, size, protection, etc.

  2. Some operating system provide facilities for locking an open file. File locks allow one process to lock a file and prevent other processes from gaining access to it. File locks are useful for files that are shared by several processes. Not all operating system provide both shared lock (akin to reader lock) and exclusive lock (akin to writer lock), but operating system may provide either mandatory or advisory file-locking mechanisms.

  3. Operating system requires that an executable file have a specific structure so that it can determine where to load the file. Some OS extend this idea into supporting multiple file structure. Meanwhile this has maximum flexibility, it has advantages. One of them is that it makes the operating system large and heavy. For example if the OS defines 5 different file structres, it needs to contain the code to support these file structures.

  4. There are 3 methods to access file:
    • Sequential Access : Information in the file is processed in order, one record after the other. This method of access is the most common. This method is used by editors and compilers.
    • Direct access : File is made up of fixed-length logical records that allow programs to read and write records rapidly in no particular order.
    • Using index: This method is built on top of a direct-access method. It involve the construction of an index for the file. The index, like an index in the back of the book, contains pointers to the various blocks.
  5. A directory is a file system cataloging structure which contains references to other computer files, and possibly other directories. There are 2 methods to implement directories :
    • Linear list : The simplest method is to use a linear list of file names with pointers to the data blocks. This method is simple to program but time-consuming to execute. An advantage of this method is that finding a file requires a linear search. Directory information is used frequently and users will notice if access to it is slow. An advantage of the sorted list is that a sorted directory listing can be produced without a seperate sort step
    • Hash table : In this method, a linear list stores the directory entries, but a hash data structure is also used. The hash table takes value computed from the file name and returns a pointer to the file name in the linear list. Therefore, it can greatly decrease the directory search time. The disadvantage of this method is its generally fixed-size and the dependence of the hash funtion on the size.
  6. Free-space allocation methods influence the efficiency of disk-space use, the performance of file system, and the reliability of secondary storage. The methods used include bit vectors and linked lists. Optimizations include grouping, and the FAT, which places the linked list in one contiguous area.

  7. Allocation methods :
    • Contiguous Allocation : In this scheme, each file occupies a contiguous set of blocks on the disk Advantage: Both sequential and direct access are supported by this. This is also extremely fast since the number of seeks are minimal because of contiguous allocation of file blocks. Disadvantage: This method suffers from both internal and external fragmentation. This makes it inefficient in terms of memory utilization.Increasing file size is also difficult.
    • Linked List Allocation : In this scheme, each file is a linked list of disk blocks which need not be contiguous. The disk blocks can be scattered anywhere on the disk. Advantage: Very flexible in terms of file size. This method does not suffer from external fragmentation. Disadvantage: Because the file blocks are distributed randomly on the disk, a large number of seeks are needed to access every block individually. This makes linked allocation slower. It also does not support random or direct access.
    • Indexed Allocation : In this scheme, a special block known as the Index block contains the pointers to all the blocks occupied by a file. Each file has its own index block. Advantage:This supports direct access to the blocks occupied by the file and therefore provides fast access to the file blocks.This method also overcomes the problem of external fragmentation Disadvantage:The pointer overhead for indexed allocation is greater than linked allocation.
  8. Free Space Management :
    • Bitmap : Series or collection of bits where each bit corresponds to a disk block. It is simple to understand and finding the first free block is efficient.
    • Linked list : Free disk blocks are linked together.
    • Grouping : This approach stores the address of the free blocks in the first free block. This makes the addresses of a group of free disk blocks can be found easily.
    • Counting : Stores the address of the first free disk block and a number n of free contiguous disk blocks that follow the first block.
  9. General-purpose operating system provide many file-system types, from special-purpose through general.Just as a file must be opened before it can be used, a file system must be mounted before it can be available to processes on the system. Depending on the OS, file-system space can be seamless (mounted into directory) or distinct (having its own designation). At least one file-system must be bootable for the system to be able to start.

  10. To simplify implementation of multiple file-systems, an OS can use layered approach, with a virtual system interface making access to possibly dissimilar file system seamless. Meanwhile Remote file sharing (RFS) is a type of distributed file system technology. RFS can be implemented by using program such as ftp or client-server model. NFS is an exmple of a RFS, providing clients with seamless access to directories, files, and even entire file systems.