Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

File Management and Organization in Computer Systems, Lecture notes of Operating Systems

An in-depth exploration of file management and organization in computer systems. It covers various operations such as create, delete, open, close, read, write, append, seek, and renaming files. The document also delves into file structures, file-system organization, file directories, storage device management, and file system layout. Additionally, it discusses concepts like access matrix, protection, security, cryptography, and monoalphabetic substitution.

Typology: Lecture notes

2023/2024

Available from 05/09/2024

sonu-yadav-9
sonu-yadav-9 🇮🇳

10 documents

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
File Operations
Files exist to store information and allow it to be retrieved later. Different systems
provide different operations to allow storage and retrieval
Create The file is created with no data.
Delete When the file is no longer needed, it has to be deleted to free up disk
space
Open Before using a file, a process must open it.
Close When all the accesses are finished, the attributes and disk addresses
are no longer needed, so the file should be closed to free up internal table
space
Read Data are read from file
Write Data are written to the file again, usually at the current position.
Append It can add data only to the end of the file
Seek. For random-access files, a method is needed to specify from where to
take the data. One common approach is a system call, seek, that repositions
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download File Management and Organization in Computer Systems and more Lecture notes Operating Systems in PDF only on Docsity!

File Operations Files exist to store information and allow it to be retrieved later. Different systems provide different operations to allow storage and retrieval

  • Create The file is created with no data.
  • Delete When the file is no longer needed, it has to be deleted to free up disk space
  • Open Before using a file, a process must open it.
  • Close When all the accesses are finished, the attributes and disk addresses are no longer needed, so the file should be closed to free up internal table space
  • Read Data are read from file
  • Write Data are written to the file again, usually at the current position.
  • Append It can add data only to the end of the file
  • Seek. For random-access files, a method is needed to specify from where to take the data. One common approach is a system call, seek, that repositions

the file pointer to a specific place in the file. After this call has completed, data can be read from, or written to, that position.

  • Rename. It frequently happens that a user needs to change the name of an existing file

File-system Organization

Basic File System

  • Deals with exchanging blocks of data
  • Concerned with buffering blocks in main memory Logical I/O
  • Enables users and applications to access records
  • Provides general-purpose record I/O capability
  • Maintains basic data about file Figure Elements of File Management

Rename .Directories are just like files and can be renamed the same way files can be. Link. Linking is a technique that allows a file to appear in more than one directory. Two-Level Directory Two-Level Scheme

  • There is one directory for each user and a master directory
  • Master directory has an entry for each user directory providing address and access control information
  • Each user directory is a simple list of the files of that user
  • Names must be unique only within the collection of files of a single user
  • File system can easily enforce access restriction on directories

Storage Device Management

Computer systems must provide mass storage for permanently storing files and data. Modern secondary storage is structured as large one-dimensional arrays of logical block. Drive Formatting, Partitions, and Volumes Before a storage device can store data, it must be divided into sectors that the controller can read and write. NVM pages must be initialized. This process is called low-level formatting, or physical formatting. Low-level formatting fills the device with a special data structure for each storage location. The first step is to partition the device into one or more groups of blocks or pages.

The second step is volume creation and management .. That volume is then ready to be mounted and used. Mounting a file system is making the file system available for use by the system and its users The third step is logical formatting , or creation of a file system. In this step, the operating system stores the initial file-system data structures onto the device. These data structures may include maps of free and allocated space and an initial empty directory. To increase efficiency, most file systems group blocks together into larger chunks, frequently called clusters FILE SYSTEM LAYOUT File systems are stored on disks. Most disks can be divided up into one or more partitions , with independent file systems on each partition. Sector 0 of the disk is called the MBR (Master Boot Record) and is used to boot the computer. The end of the MBR contains the partition table. This table gives the starting and ending addresses of each partition. One of the partitions in the table is marked as active. When the computer is booted, the BIOS reads in and executes the MBR. The first thing the MBR program does is locate the active partition, read in its first block, which is called the boot block, and execute it. The program in the boot block loads the operating system contained in that partition. Method for keeping track of which blocks belong to which file is to associate with each file a data struct ure called an i-node (index-node ), which lists the attributes and disk addresses of the file’s blocks. Caching The most common technique used to reduce disk accesses is the block cache or buffer cache. File allocation table (FAT) – Data structure used to keep track of the portions assigned to a file.

Disk scheduling.

Figure HDD moving-head disk mechanism. The bulk of secondary storage for modern computers is provided by hard disk drives (HDDs ) and nonvolatile memory (NVM ) devices. Each disk platter has a flat circular shape, like a CD. Common platter diameters range from 1.8 to 3.5 inches. The two surfaces of a platter are covered with a magnetic material. We store information by recording it magnetically on the platters, and we read information by detecting the magnetic pattern on the platters. A read – write head “files ” just above each surface of every platter. The heads are attached to a disk arm that moves all the heads as a unit. The surface of a platter is logically divided into circular tracks , which are subdivided into sectors.

The set of tracks at a given arm position make up a cylinder. The transfer rate is the rate at which data flow between the drive and the computer. Another performance aspect, the positioning time, or random-access time , consists of two parts: the time necessary to move the disk arm to the desired cylinder , called the seek time , and the time necessary for the desired sector to rotate to the disk head , called the rotational latency NVM devices are electrical rather than mechanical. Flash-memory-based NVM is frequently used in a disk-drive-like container, in which case it is called a solid-state disk (SSD ). In other instances, it takes the form of a USB drive (also known as a thumb drive or flash drive) or a DRAM stick The simplest form of disk scheduling is, of course, the first-come, first-served (FCFS ) algorithm (or FIFO). This algorithm is intrinsically fair, but it generally does not provide the fastest service. scheduling algorithms with a request queue (0-199) 98, 183, 37, 122, 14, 124, 65, 67 Head pointer 53