1 / 20

Operating Systems Chapter 4

Operating Systems Chapter 4. The File System. File Attributes. Name – only information kept in human-readable form. Type – needed for systems that support different types. Location – pointer to file location on device. Size – current file size.

kirk-walsh
Download Presentation

Operating Systems Chapter 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating SystemsChapter 4 The File System

  2. File Attributes • Name – only information kept in human-readable form. • Type – needed for systems that support different types. • Location – pointer to file location on device. • Size – current file size. • Protection – controls who can do reading, writing, executing. • Time, date, and user identification – data for protection, security, and usage monitoring. Information about files are kept in the directory structure, which is maintained on the disk.

  3. File Operations • create • write • read • reposition within file – file seek • delete • truncate • open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory. • close (Fi) – move the content of entry Fi in memory to directory structure on disk.

  4. Access Methods • Sequential Access read next write next reset • Direct Access (Random) read n write n position to n n = relative block number

  5. Directory Files F 1 F 2 F 3 F 4 F n Directory Structure • A collection of nodes containing information about all files.

  6. Tree-Structured Directories

  7. Acyclic-Graph Directories

  8. Acyclic-Graph Directories (Cont.) • Two different names (aliasing) • If dict deletes w/list  dangling pointer. Solutions: • Backpointers, so we can delete all pointers -> Variable size records a problem. • Entry-hold-count solution.

  9. Acyclic-Graph Directories (Cont.) • How do we guarantee no cycles? • Allow only links to file not subdirectories. • Every time a new link is added use a cycle detectionalgorithm to determine whether it is OK.

  10. group owner public chmod 761 game Access Lists and Groups • Mode of access: read, write, execute • Three classes of users RWX a) owner access 7  1 1 1 RWX b) groups access 6  1 1 0 RWX c) public access 1  0 0 1 • Attach a group to a file chgrp G game

  11. In-Memory File System Structures

  12. File-System Allocation Methods • Contiguous Allocation • Linked Allocation • Indexed Allocation

  13. Contiguous Allocation

  14. Linked Allocation • Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. • Simple – need only starting address • Free-space management system – no waste of space • No random access • Allocate as needed, link together; e.g., file starts at block 9

  15. Linked Allocation (cont.)

  16. File-Allocation Table • File-allocation table (FAT) – disk-space allocation used by MS-DOS and OS/2.

  17. index table Indexed Allocation • Brings all pointers together into the index block.

  18. Example of Indexed Allocation

  19. Indexed Allocation (Cont.) • Need index table • Random access • have overhead of index block. • Mapping from logical to physical in a file of maximum size of 256K words and block size of 512 words. We need only 1 block for index table.

  20. UNIX inode (UFS)

More Related