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

    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
  • Better Essays

    Technology is the building block of any society: it allows for new advancements to be made that improve daily life. Two such societies that made advancements in technology included the Han Dynasty and the Roman Empire. As the expansion of the empire increased, the Romans built roads that linked these regions together. These roads were built in such a way that allowed for easier travel: roads were paved and allowed for water to run off. In addition, the empire also developed the transportation of water throughout the city through the construction of aqueducts, which were canals. Likewise, the Han Dynasty made advancements in the distribution of water: there were water ways, canals, and pools that were inspected by hydraulic engineers. Water was also used to power a blowing-engine. Because of the advancements that were made, the Han Dynasty is regarded by historians as the “Golden Age.” Similarly, the Romans created a large empire that stretched from Europe to the Middle East. Because of the vastness of both empires, water and technology were heavily relied upon, yet unlike the Han officials, the upper-class Romans had a negative attitude towards technology.…

    • 1236 Words
    • 5 Pages
    Better 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

    Why Is Prohibition Bad

    • 1135 Words
    • 5 Pages

    “Prohibition goes beyond the bounds of reason in that it attempts to control a man’s appetite by legislation and makes crimes out of things that are not crimes.” -Abraham Lincoln The banning of alcohol only made people want to buy more of it, and break the law. Although most people agree that the banning alcohol was a good thing, some also think that it was a bad thing.…

    • 1135 Words
    • 5 Pages
    Good Essays
  • Better Essays

    “During the 19th and 20th centuries, individuals who broke the law were seen as the creation of social disorders, therefore punishment was considered to be justified only as of the following (1) it protected society by acting as a deterrent or by temporarily or permanently removing one who has injured it or (2) it aimed at the moral or social regeneration of the criminal.” (Bernard, 2014)…

    • 1161 Words
    • 4 Pages
    Better 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