[Operating system] concept document management

Hierarchical organizational structure of the file system

(Top-down)

  • Logical file system
    • Responsible for the logical structure of the file system (metadata)
  • File organization system
    • Responsible for allocating disk blocks of text data
    • Management of free disk blocks
  • The basic file system
    • To read and write disk blocks as a unit to the file
  • IO Control
    • There are device drivers and interrupt handlers. Transfer of information between memory and disk

 

First, the file directory management

 

1, the directory: a set of all nodes of a file containing, for organizing files; directory structure and files reside on disk

2, directory related operations

  • Search for files
  • Create a file
  • Delete Files
  • Directory traversal
  • Rename the file
  • Traversing File Systems

 

3, the directory structure

  • Flat directory

File system builds a table of contents for all file storage devices

  • A directory corresponding to all users
  • Name: does not allow the existing file.
  • Packet
  • Double Directory

The directory is divided into two: the home directory (MFD) and a user file directory (the UFD)

  • MFD = {user name, user's physical location subdirectory located}
  • UFD = {register the user FCB all files}

Generating multi-user sharing system, home directories and files by user entry points, each user has a user file directory.

Features:

  • Different users can take the same name as a file
  • Effective search
  • No grouping feature
  • Directory tree

Feature

  • Effective search
  • Support groups
  • But the concept of directory: file pathname is generally longer, and users always use the file locally. Therefore, for convenience, you can put frequently used files in the directory specified as the working directory (or the current directory)
  • It can be stored access control
  • Acyclic graph directory
    • Hard links
    • Symbolic link

Feature

  • With shared subdirectories and files
  • File may have multiple absolute pathname (different file names point to the same file)

 

Second, file organization system implementation

 

1, disk space allocation

  • Continuous distribution
    • Feature
      • Simple: only the recording start block number & document length (number of blocks)
      • It can easily support random access
    • Shortcoming
      • Wasted space exists, a continuous storage space requirements
      • Variable-length file when more difficult to deal
        • You must know in advance the length of the file, not the future growth dynamic (reserved space, redistribution and movement control)
        • It is not conducive to insert deleted files
        • The presence of external fragmentation
    • Solution: Compact
  • Link assignment
    • Each disk block, leaving a pointer address to the block link
    • Space management: waste less
    • Disadvantages: does not support random access
  • Index Allocation
    • File information is stored in a number of discrete physical block. The system creates a private data structure, an index table for each file, and the block number stored in an index table. Index table to complete the mapping logical block numbers and the physical block numbers.
    • advantage:
      • Both to meet the growing demand for dynamic file, they can more quickly and easily implement random access (after all, the logical block numbers and the physical block numbers put together, this series they are dispersed)
    • Disadvantages:
      • The use of the index table and add overhead storage space
      • When accessing a file at least two memory access (access time index table, a physical block number in accordance with the information to access the file index table provided), very slow. It is possible to improve the position of a file system in advance before operating the index table into memory.
    • Improve:
      • Large file index table is also great - indirect index (multiple index)

2, free space management

  • Free file directory Act
    • To a contiguous unallocated areas (which may include a number of free blocks) as a file, called a blank file
    • The system for all files to create a blank directory, i.e., a blank directory file, each directory table file corresponds to a free, instant recording start block number and the free file.
    • And a variable partition memory management method of allocating a free block which is similar to the first adaptation can also be used, best fit, worst adaptation.
    • Cons: free file directory is a continuous table, to take up a larger auxiliary storage space
  • Method chain of free blocks
    • A method according to order of linked space area
      • Increases or large overhead when the moving block
    • According to the release order link
    • Press into a set of links law
      • The file storage device all free blocks are divided into groups according to a 50
      • The group is divided from the back once divided
    • Disadvantages: To complete the slide fastener is released each time the physical block work, although only a byte write block, but almost the same workload and write a
  • Bit method shown in FIG.
    • With a bit according to the use of a physical fast. The system builds a bit map storage device for each file. Idle 0, 1 occupied. N looking for a free block, it can first search Bitmap, found the N 0, then after a simple conversion to give the corresponding address.
    • Disadvantages: assigning sequential scan to Idle (0) is slow, and the physical block number is not again reflected FIG directly, the need for further calculations.

Third, the underlying file system

  • A disk can be divided into multiple partitions, one partition can span multiple disks
  • A volume (file system) must be installed prior to use; you can not cancel the installation after visit
  • Disk Scheduling
    • FCFS
      • The order of arrival to move the head
    • SSTF algorithm shortest seek time is limited
      • Latest head position is selected request pending
      • Is essentially a short job scheduling wire, may cause hunger
    • SCAN elevator algorithm
      • Disk arm (mean direction) from an end of the disk is moved to the other end, while the head moves past each cylinder, on the process requesting the service located in the cylinder. When reaching the other end, change direction to continue processing.
    • C-SCAN provides a more uniform latency
      • The head from one end to another end of the disk, while moving the processing request. However, when the head is moved to the other end of the disk starts to return immediately, returned when the request is not processed. (As is the cylindrical ring, the first and the last cylinder is connected to a cylinder w)
    • C-LOOK algorithm
      • Only the head is moved to the farthest in one direction until the request, and then returns immediately, instead of moving to the end disk

Guess you like

Origin blog.csdn.net/sinat_39763590/article/details/93157208