os202

Repository for Operating Systems 202 Course 2020/2021

View project on GitHub

HOME
« PREVIOUS | | NEXT »

Top 10 List of Week 03

  1. File Access Methods
    There are three ways to access a file into a computer system: Sequential Access, Direct Access, and Indexed Access methods.

    In Sequential Access, the OS read the file word by word. A pointer is maintained which initially points to the base address of the file. If the user wants to read first word of the file then the pointer provides that word to the user and increases its value by 1 word. This process continues till the end of the file.

    The Direct Access method is mostly required in the case of database systems. In most of the cases, we need filtered information from the database. Direct access will give the required result despite the fact that the operating system has to perform some complex tasks.

    The Indexed Access method constructs an index for the file. The index, like an index in the back of a book, contains the pointer to the various blocks. To find a record in the file, we first search the index and then by the help of pointer we access the file directly.

  2. Concept of Single Level Directory
    The simplest method is to have one big list of all the files on the disk. The entire system will contain only one directory which is supposed to mention all the files present in the file system. The directory contains one entry per each file present on the file system.

    Advantages: Since it is a single directory, its implementation is very easy. If the files are smaller in size, searching will become faster. The operations like file creation, searching, deletion, updating are very easy in such a directory structure.

    Disadvantages: We cannot have two files with the same name. If the directory is big, searching for a file may take so much time. Protection cannot be implemented for multiple users. There are no ways to group same kind of files.

  3. Concept of Two Level Directory
    In two level directory systems, we can create a separate directory for each user. There is one master directory which contains separate directories dedicated to each user. For each user, there is a different directory present at the second level, containing group of user’s file.

    Advantages: Each file has a full path name like “/User-name/directory-name/”. Different users can have the same file name. Searching becomes more efficient as only one user’s list needs to be traversed.

    Disadvantages: A user is not allowed to share files with other users. Still it not very scalable, two files of the same type cannot be grouped together in the same user.

  4. Concept of Tree-Structured Directory
    In Tree structured directory system, any directory entry can either be a file or sub directory. Tree structured directory system overcomes the drawbacks of two level directory system. The similar kind of files can now be grouped in one directory.

    Advantages: Very generalize, since full path name can be given. Very scalable, the probability of name collision is less. Searching becomes very easy, we can use both absolute path as well as relative.

    Disadvantages: Every file does not fit into the hierarchical model, files may be saved into multiple directories. We still can not share files. It is inefficient, because accessing a file may go under multiple directories.

  5. Concept of Acyclic-Graph Structured Directory
    An acyclic graph is a graph with no cycle and allows to share subdirectories and files. In this system, two or more directory entry can point to the same file or sub directory. That file or sub directory is shared between the two directory entries.

    Advantages: We can share files. Searching is easy due to different-different paths.

    Disadvantages: We share the files via linking, just in case deleting it may create the problem> If the link is softlink then after deleting the file we left with a dangling pointer. In case of hardlink, to delete a file we have to delete all the reference associated with it.

  6. File System Implementation in Operating System
    File System provide efficient access to the disk by allowing data to be stored, located and retrieved in a convenient way. A file System must be able to store the file, locate the file and retrieve the file. Most Operating Systems use layering approach for every task including file systems. Every layer of the file system is responsible for some activities.

    Logical File System : When an application program asks for a file, the first request is directed to the logical file system. The logical file system contains the Meta data of the file and directory structure.

    File Organization Module : In order to store and retrieve the files, the logical blocks need to be mapped to physical blocks. This mapping is done by File organization module. It is also responsible for free space management.

    Basic File System : The basic file system is responsible for issuing the commands to I/O control in order to fetch those blocks.

    I/O Control : I/O controls contain the codes by using which it can access hard disk. These codes are known as device drivers. I/O controls are also responsible for handling interrupts.

  7. Directory Implementation in Operating System
    The directory implementation algorithms are classified according to the data structure they are using. There are mainly two algorithms which are used in these days.

    Linear List : In this algorithm, all the files in a directory are maintained as singly lined list. Each file contains the pointers to the data blocks which are assigned to it and the next file in the directory. The list needs to be traversed in case of every operation (creation, deletion, updating, etc) on the files therefore the systems become inefficient.

    Hash Table : The hash table takes a value computed from the file name and returns a pointer to the file. It decreases the directory search time. The insertion and deletion process of files is easy. The major difficulty of hash tables are its generally fixed size and dependency on hash function on that size.

  8. What is Access Control?
    Access control for an operating system determines how the operating system implements accesses to system resources by satisfying the security objectives of integrity, availability, and secrecy. Such a mechanism authorizes subjects (e.g., processes and users) to perform certain operations (e.g., read, write) on objects and resources of the OS (e.g., files, sockets). There are two types of access control: physical and logical. Physical access control limits access to campuses, buildings, rooms and physical IT assets. Logical access control limits connections to computer networks, system files and data.

  9. What is the Difference Between Relative & Absolute Path?
    An absolute or full path points to the same location in a file system, regardless of the current working directory. To do that, it must include the root directory. By contrast, a relative path starts from some given working directory, avoiding the need to provide the full absolute path. A filename can be considered as a relative path based at the current working directory. If the working directory is not the file’s parent directory, a file not found error will result if the file is addressed by its name.

  10. What is a Journaling File System?
    The purpose of journaling in computing file systems is to keep track of changes not yet committed to the file system. Even after any crashes or unexpected shutdowns, you can still access the latest file version with a lower likelihood of it becoming corrupted. Journaling allows all the updates to a file to be stored in a contiguous portion of the disk. Journaling saves much time in file storage retrieval because of contiguous memory allocations.