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

This page cannot be seen from the preview

Don't miss anything!

bg1
ECS 150 (Operating Systems) File Systems
Spring Quarter 2008 1
F i l e S y s t e m s
F i l e S y s t e m s
Goa l
To learn how files are represented both in memory and on the
secondary storage devices.
pf3
pf4
pf5
pf8
pf9
pfa

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!

F i l eF i l e^ S y s t e m sS y s t e m s

Goal To learn how files are represented both in memory and on the secondary storage devices.

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”.

Access Control Typical protection modes are: read, write, append, delete, privilege (allows modification of others' rights), owner (indicates owner of file), and search (grants permission to search directory). example: UNIX; note difference in meaning of execute for files and directories. implementation: describe access lists, abbreviation association of rights: are privileges associated with a name or a file? That is, if x is an alias for y, can a user have read permission on x but not on y?

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

Informati on in disk dire ctory file 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).

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 256^2 = 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)

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