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 Systems in Operating Systems: Organization, Access, and Allocation, Study notes of Operating Systems

An overview of file systems in operating systems, covering their organization, access methods, and allocation techniques. It explains the concepts of virtual and physical files, directories, access control, and process view of files. The document also discusses various access methods like sequential, direct, mapped, and structured, and the information kept in disk directory files. Additionally, it covers the allocation of disk blocks to files using contiguous, linked, and indexed methods.

Typology: Study notes

Pre 2010

Uploaded on 07/30/2009

koofers-user-103
koofers-user-103 🇺🇸

3

(1)

10 documents

1 / 11

Toggle sidebar

Related documents


Partial preview of the text

Download File Systems in Operating Systems: Organization, Access, and Allocation and more Study notes Operating Systems in PDF only on Docsity! ECS 150 (Operating Systems) File Systems Spring Quarter 2008 1 F i l e S y s t em s Goal To learn how files are represented both in memory and on the secondary storage devices. ECS 150 (Operating Systems) File Systems Spring Quarter 2008 2 File Systems A file is a collection of data. There are two aspects of it: • virtual: this is how the user (process) sees the file • physical: this is how the file is represented to the hardware and operating system. A file's name often reflects something about the file. example: in TOPS-20, file names are name.ext, where ext is a three- character extension describing the file; “bas” for BASIC, “for” for FORTRAN, “bli” for BLISS, “obj” for object, “exe” for executable, “txt” for text, and so forth. On Linux, FreeBSD, and MINIX, the last letter may designate something; for example, C source files end in “.c” and C++ source files in “.cc”. ECS 150 (Operating Systems) File Systems Spring Quarter 2008 5 Process View of File Processes operate on files using the following commands: • create: find space for the file, allocate it, and make an entry in the directory • open: begin operations on a file • close: end operations on a file • read: transfer information from the file • write: transfer information to the file • rewind: move to the beginning (or a random point) in the file • delete: remove the file ECS 150 (Operating Systems) File Systems Spring Quarter 2008 6 Access Methods How can processes access files? • sequential: one block after the other. The process keeps track of a read/write pointer (part of the PCB) indicating where the next action is to be done; the pointer always advances. • direct: the read/write pointer can move freely. • mapped: map the file into a virtual segment, and return the segment number rather than the file descriptor; then treat the file as part of the process' virtual store. On closing, just release the storage. example: TOPS-20, MULTICS, FreeBSD • structured: the file consists of a sequence of records; often the operating system knows about the file type. example: ISAM (Indexed Sequential Access Method). In this, a small master index points to blocks in a secondary index, which in turn point to real file blocks. Thus, it takes at most 2 reads to locate any record ECS 150 (Operating Systems) File Systems Spring Quarter 2008 7 Information in disk directory fi le A disk directory is like a directory for a disk; it describes what blocks are in use and which are free. This means it must keep track of what blocks are not in use; such a list is a free list. Several representations: • a bit map, with 1 bit per block • a linked list of blocks • like linked list, but in each block of size n on the free list, store n-1 numbers of free blocks; the n-th is the address of the next block making up the list • pairs of (block number, number of free blocks from that block on); if there is more than one contiguous block free, this usually saves same space The latter three are often called file maps because each free block is represented by 1 word (pointer). ECS 150 (Operating Systems) File Systems Spring Quarter 2008 10 implementation issue If you need more than 1 index block, link them together. Or, use indirection: if you can have 256 pointers/block, 2 levels of indirection allows 2562 = 65,536 blocks. example: UNIX scheme: the first 12 blocks of a file are data, the 13th is an index block, the 14th is a doubly-indexed block (ie, it contains pointers to index blocks), and the 15th is a triply-indexed block (ie, it contains pointers to doubly-indexed blocks) ECS 150 (Operating Systems) File Systems Spring Quarter 2008 11 Network File Systems These require that the system know where the file is kept, and be able to communicate with the server. • centralized server: the system determines where the file is kept sing a table that shows where it is Example: NFS and mount points; use the file system to determine which server to talk to • distributed file data: a file contains metadata; when you request a file, the system locates this file and uses it to acquire the contents of the file. BitTorrent does this. NFS protocol • To the kernel, it’s just another file until you get to the mount point, at which point a lower part of the kernel acts as a client to the server. 1. Mount the file system; this exchanges messages to make the file system available to the client; access modes controlled by various configuration files. Common options: a. soft: file system calls that fail after a certain number of retries fail rather than continue retrying forever b. rdonly: read only c. nosuid: ignore setuid bits d. nodev: ignore device files 2. On open, system walks down directory tree to mount point, then uses file handles to get the “pointer” to the file. a. Handle is all that is needed for access b. Handle includes generation number to detect conflicts c. All accesses use the handle
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved