1 / 12

Disk Layout 10/04/14

Disk Layout 10/04/14. Sourav Sarkar 11CS30037. Boot Control Block . Disk. RAM. Contains info needed by the system to boot OS Contains disk address of the block where the OS is stored. Partition Control Block.

rey
Download Presentation

Disk Layout 10/04/14

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. Disk Layout10/04/14 Sourav Sarkar 11CS30037

  2. Boot Control Block Disk RAM • Contains info needed by the system to boot OS • Contains disk address of the block where the OS is stored

  3. Partition Control Block • If the system has multiple OS then the disk must be partitioned into multiple blocks .For each block there is a separate directory structure • Information • No of blocks occupied / free • Size of each block

  4. Partition Control Block(Cont.) Partition Table BootBlock SuperBlock FreeSpaceManagement Inodes Root Files- Directory

  5. Directory Structure • Filenames • Attributes • For each file we have FCB(File Control Block)

  6. In memory File System Structure • Directory Structure holds info about recently accessed directories • Load the entire directory info containing frequently accessed files • Load part of directory(like cache) Filename

  7. System Wide open File Table • Stores the info of all the files that are currently being accessed. It stores FCB of all currently accessed files Per Process open file table File Descriptor Table(Linux) For each process we have an entry in the table with pointers to Appropriate entries in the system wide table(all files opened by the process)

  8. File Handling & The Logical File System • Application program uses the logical file system • Logical Fie System : • Allocates a new FCB • Reads appropriate directory into memory • Updates directory with new filenames and FCB • Write it back to disk

  9. Using the File (I/O) • Open()(Filename) • Directory searched • FCB -> copied into system wide file table • Entry made to per-person open file table(with a pointer to system wide open file table and file descriptor) • Note: For threads proxy tables created in the address space

  10. System Table FCB(k) N(k) • N(k) is the number of process opening file k • When a process closes a particular file its entry is removed from its FDT and n(k) is reduced by 1 • When n(k) = 0 system will write back the file to the disk • Corresponding entry of the system table is removed

  11. Allocating blocks to files • Contiguous allocation : Blocks allocated b,b+1,b+2 … • Performance : • Best in most cases • Simple as only the starting location and length of the file is needed. • Read performance is great • Minimal disk movement • Sequential and direct access

  12. More on block allocation • Problems: • Finding space for file • External Fragmentation • Solution : Compaction • Must know file size a priori ! Not possible file size may gradually increase in most cases. If space exhausted need to move file to new location

More Related