























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























File system Interface: The concept of a file, access methods, directory structure, file system mounting, files sharing, protection. File System Implementation: File system structure, allocation methods, free-space management, and secondary storage structure – overview of mass-storage structure, disk scheduling and algorithms File A file is a named collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tapes and optical disks. In general, a file is a sequence of bits, bytes, lines or records whose meaning is defined by the files creator and user. Properties of a File System Here, are important properties of a file system:
Let us now study the directory structure with the help of the figure above. The field File name , contains the name of the concerned file in the directory, Type field indicates the kind or category of the file, Location Info field indicates the location where the file is stored. Protection Info field contains the information whether the file can be accessed by the other user in the system or not. Flag field contains the kind of directory entry like value D in Flag field indicates that the file is a directory, value L indicates that the file is a link, value M indicates that the file is a mounted file system. The Misc info filed in the directory contains the miscellaneous information about the owner of the file, the time of its creation, the time at which the file was modified last. Types of Directory Structures In this section, we will be discussing the most common types of directories, their benefits and drawbacks.
1. Single-level directory structure Single level directory structure has only one directory which is called the root directory. The users are not allowed to create subdirectories under the root directory. All the files created by the several users are present in the root directory only. As you can see in the diagram below all the file F1, F2, F3, F4 created by the different users are present at the root directory.
There is one drawback of Single-level directory structure, a user cannot use the same file name used by another user in the system. Even if the file with the same name is created the old file will get destroyed first and replaced by the new file having the same name.
2. Two-level directory structure In Two-level directory structure, the users create directory directly inside the root directory. But once a user creates such directory, further he cannot create any subdirectory inside that directory. Observe the figure below, 4 users have created their separate directory inside the root directory. But further, no subdirectory is created by the users.
The tree directory structure provides an asymmetric way for the user to access the shared files of a different user. For example, a user can access a file of its own user directory with a shorter path than the other user.
5. Acyclic-Graph Directory Structure This problem can be solved by the acyclic-graph directory structure. As this directory structure allows a directory or a file to have many parent directories. So, a shared file in a directory can be pointed by the other user directories who have access to that shared file using the links. In the diagram below you can see that the directory having file F7 and F8 have two parent directories.
Operations on Directory As discussed above, a directory contains the entries of all the related files. For organizing the directory in the better way the user must be able to insert, delete, search, list the entries in the directory. Below we will be discussing the operation that can be performed on the directory.
1. Searching A directory can be searched for a particular file or for another directory. It can also be searched to list all the files with the same name. 2. Creating
As another example, a system may allow the same file system to be mounted repeatedly, at different mount points; or it may only allow one mount per file system. Consider the actions of the Macintosh operating system. Whenever the system encounters a disk for the first time (hard disks are found at boot time, and floppy disks are seen when they are inserted into the drive), the Macintosh operating system searches for a file system on the device. If it finds one, it automatically mounts the file system at the root level, adding a folder icon on the screen labeled with the name of the file system (as stored in the device directory). The user is then able to click on the icon and thus display the newly motinted file system. The Microsoft Windows family of operating systems (95, 98, NT, small 2000, XP) maintains an extended two-level directory structure, with devices and volumes assigned drive letters. Volumes have a general graph directory structure associated with the drive letter. The path to a specific file takes the form of drive-letter;\path\to\file. The more recent versions of Windows allow a file system to he mounted anywhere in the directory tree, just as UNIX does. Windows operating systems automatically discover all devices and mount all located file systems at boot time. In some systems, like UNIX, the mount commands are explicit. A system configuration file contains a list of devices and mount points for automatic mounting at boot time, but other mounts may be executed manually. Files sharing File sharing is the practice of sharing or offering access to digital information or resources, including documents, multimedia (audio/video), graphics, computer programs, images and e- books. It is the private or public distribution of data or resources in a network with different levels of sharing privileges. File sharing can be done using several methods. The most common techniques for file storage, distribution and transmission include the following: i. Removable storage devices ii. Centralized file hosting server installations on networks iii. World Wide Web-oriented hyperlinked documents iv. Distributed peer-to-peer networks File sharing is a multipurpose computer service feature that evolved from removable media via network protocols, such as File Transfer Protocol (FTP). Beginning in the 1990s, many remote file-sharing mechanisms were introduced, including FTP, hotline and Internet relay chat (IRC). Operating systems also provide file-sharing methods, such as network file sharing (NFS). Most file-sharing tasks use two basic sets of network criteria, as follows: Peer-to-Peer (P2P) File Sharing: This is the most popular, but controversial, method of file sharing because of the use of peer-to- peer software. Network computer users locate shared data with third-party software. P2P file
The need to protect files is a direct result of the ability to access files. Systems that do not permit access to the files of other users do not need protection. Thus, we could provide complete protection by prohibiting access. Alternatively, we could provide free access with no protection. Both approaches are too extreme for general use. What is needed is controlled access. access that can be made. Access is permitted or denied depending on several factors, one of which is the type of access requested. Several different types of operations may be controlled:
list associated with that file. If that user is listed for the requested access, the access is allowed. Otherwise, a protection violation occurs, and the user job is denied access to the file. This approach has the advantage of enabling complex access methodologies. The main problem with access lists is their length. If we want to allow everyone to read a file, we must list all users with read access. This technique has two undesirable consequences:
File Protection Another difficulty is assigning precedence when permission and ACLs conflict. For example, if Joe is in a file's group, which has read permission, but the file has an ACL granting Joe read and write permission, should a write by Joe be granted or denied? Solaris gives ACLs permission (as they are more fine-grained and are not assigned by default). This follows the general rule that specificity should have priority. 10.6.3 Other Protection Approache s Another approach to the protection problem is to associate a password with each file. Just as access to the computer system is often controlled by a password, access to each file can be controlled in the same way. If the passwords are chosen randomly and changed often, this scheme may be effective in limiting access to a file. The use of passwords has a few disadvantages, however. First, the number of passwords that a user needs to remember may become large, making the scheme impractical. Second, if only one password is used for all the files, then once it is discovered, all files are accessible; protection is on an all-or-none basis. Some systems (for example, TOPS-20) allow a user to associate a password with a subdirectory, rather than with an individual file, to deal with this problem. The IBMVM/CMS operating system allows three passwords for a minidisk—one each for read, write, and multiwrite access. Some single-user operating systems—such as MS-DOS and earlier versions of the Macintosh operating system prior to Mac OS X—provide little in terms of file protection. In scenarios where these older systems are now being placed on networks where file sharing and communication are necessary, protection mechanisms must be retrofitted into them. Designing a feature for a new operating system is almost always easier than adding a feature to an existing one. Such updates are usually less effective and are not seamless. In a multilevel directory structure, we need to protect not only individual files but also collections of files in subdirectories; that is, we need to provide a mechanism for directory protection. The directory operations that must be protected are somewhat different from the file operations. We want to control the creation and deletion of files in a directory.
File Protection In addition, we probably want to control whether a user can determine the existence of a file in a directory. Sometimes, knowledge of the existence and name of a file is significant in itself. Thus, listing the contents of a directory must be a protected operation. Similarly, if a path name refers to a file in a directory, the user must be allowed access to both the directory and the file. In systems where files may have numerous path names (such as acyclic or general graphs), a given user may have different access rights to a particular file, depending on the path name used. File System Implementation: File system structure, allocation methods, free-space management, secondary storage structure – overview of mass-storage structure, disk scheduling and algorithms File System Structure 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 of the Operating Systems use layering approach for every task including file systems. Every layer of the file system is responsible for some activities. The image shown below, elaborates how the file system is divided in different layers, and also the functionality of each layer.
mapped to physical blocks. This mapping is done by File organization module. It is also responsible for free space management. o Once File organization module decided which physical block the application program needs, it passes this information to basic file system. The basic file system is responsible for issuing the commands to I/O control in order to fetch those blocks. o 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. allocation methods The allocation methods define how the files are stored in the disk blocks. There are three main disk space or file allocation methods.
Advantages: