Preview

Linux

Powerful Essays
Open Document
Open Document
3651 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Linux
DRAFT as of November 19, 2010: Copyright 2009 Cox, Kaashoek, Morris

Chapter 7 File system data structures
The disk driver and buffer cache (Chapter 6) provide safe, synchronized access to disk blocks. Individual blocks are still a very low-level interface, too raw for most programs. Xv6, following Unix, provides a hierarchical file system that allows programs to treat storage as a tree of named files, each containing a variable length sequence of bytes. The file system is implemented in four layers:
------------pathnames ------------directories ------------inodes ------------blocks -------------

The first layer is the block allocator. It manages disk blocks, keeping track of which blocks are in use, just as the memory allocator in Chapter 2 tracks which memory pages are in use. The second layer is unnamed files called inodes (pronounced inode). Inodes are a collection of allocated blocks holding a variable length sequence of bytes. The third layer is directories. A directory is a special kind of inode whose content is a sequence of directory entries, each of which lists a name and a pointer to another inode. The last layer is hierarchical path names like /usr/rtm/xv6/fs.c, a convenient syntax for identifying particular files or directories.

File system layout
Xv6 lays out its file system as follows. Block 0 is unused, left available for use by the operating system boot sequence. Block 1 is called the superblock; it contains metadata about the file system. After block 1 comes a sequence of inodes blocks, each containing inode headers. After those come bitmap blocks tracking which data blocks are in use, and then the data blocks themselves. The header fs.h (3550) contains constants and data structures describing the layout of the file system. The superblock contains three numbers: the file system size in blocks, the number of data blocks, and the number of inodes.

Code: Block allocator

1

The block allocator is made up of the two functions: balloc allocates

You May Also Find These Documents Helpful

  • Good Essays

    The operating system occupies low memory, starting with memory address 0. Directly afterwards is system control information, then the various resident operating system…

    • 7085 Words
    • 29 Pages
    Good Essays
  • Satisfactory Essays

    4. When the OS addresses the sectors on a hard drive as one long list of sequential sectors, what is this technology called? LBA…

    • 398 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Which of the following is not a feature of the file system that might be used with a hard disk drive?…

    • 957 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Pm3110 Lesson 4

    • 513 Words
    • 3 Pages

    In indexed storage, when a file is created, the pointers in the index block are all set to ____.…

    • 513 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    2: Redundant via Hamming code; an error-correcting code is calculated across corresponding bits on each data disk, and the bits of the code are stored in the corresponding bit positions on multiple parity disks. 3: Bit-interleaved parity; similar to level 2 but instead of an error-correcting code, a simple parity bit is computed for the set of individual bits in the same position on all of the data disks. 4: Block-interleaved parity; a bit-by-bit parity strip is calculated across corresponding strips on each data disk, and the parity bits are stored in the corresponding strip on the parity disk. 5: Block-interleaved distributed parity; similar to level 4 but distributes the parity strips across all disks. 6: Block interleaved dual distributed parity; two different parity calculations are carried out and stored in separate blocks on different…

    • 1721 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Like Linux, NTFS uses inodes for the same purpose which means inodes has similar functionality and purpose in its two implementations (Pitafi, 2007).…

    • 706 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Nt1310 Unit 3 Os

    • 1341 Words
    • 6 Pages

    With multiple processors executing the same or different parts of the kernel, kernel tables and management structures must be managed properly to avoid data corruption or invalid operations.…

    • 1341 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    Unit 2 Explore and Discuss

    • 1383 Words
    • 6 Pages

    C.1.a) POSIX - a family of standards specified by the IEEE for maintaining compatibility between operating systems.…

    • 1383 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    operating system

    • 464 Words
    • 2 Pages

    1. What is the application Zenmap GUI typically used for? Describe a scenario in which you would use this type of application.…

    • 464 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Linux Hw

    • 287 Words
    • 2 Pages

    What kind of server repond to recursive queries ? how does this server work ?…

    • 287 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Operating System

    • 1099 Words
    • 5 Pages

    Answer: d. It redirects the output of one command to the input of another command.…

    • 1099 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    1. When you designed a file system in the first section of this lab, why did you choose the structure that you selected?…

    • 350 Words
    • 2 Pages
    Satisfactory Essays
  • Best Essays

    Unix/Linux

    • 2760 Words
    • 12 Pages

    Windows, a much younger operating system, released in 1985, has exponentially grown in popularity ever since. Windows popularity is the biggest reason that it suffers malicious attacks more than any other operating system available. The numerous attacks…

    • 2760 Words
    • 12 Pages
    Best Essays
  • Good Essays

    File Management in Unix

    • 557 Words
    • 3 Pages

    When it comes to UNIX systems all user data is organized and stored in files. These files are subsequently organized into a management structure comprising of directories and sub-directories. Much like forest and organizational units when it comes to active directory, UNIX also has the directories and sub-directories organized into a tree-like structure that it calls a file system. UNIX also has three basic types of files. When it comes to security files can be secured through UNIX file permissions as well as access control lists (ACLs).…

    • 557 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Mister

    • 5355 Words
    • 65 Pages

    Heap) are the root node – depending on the type of heap (Min or Max Heap)…

    • 5355 Words
    • 65 Pages
    Good Essays

Related Topics