ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2018-2019-1) > student homework > >
homework 9 Version 0
👤 Author: by 1529775928qqcom 2019-01-01 10:31:27
aims:

1.Effective use of disk space

2.Quick access to files

 

There are three common types of distribution methods:

1.Continuous allocation

2.Link assignment

3.Index allocation

 

Contiguous allocation

The continuous allocation method requires each file to occupy a contiguous block of disks.

 

advantage:

  1. Simple - just record the starting position (block number) and length of the file.

  2. Accessing files is easy and requires minimal seek time


Sequential access

direct interview.

 

Disadvantages:

  1. It is difficult to find space for new documents

  2. For the first time, the best, the worst

  3. The file is difficult to grow


 

Linked allocation

Link assignments solve all the problems of continuous allocation.

 

With link assignment, each file is a linked list of disk blocks:

  • Disk blocks are distributed anywhere on the disk.

  • Each directory entry has a pointer to the first block of the file.

  • The pointer is initialized to nil (the value of the footer pointer) to identify an empty file.


 

advantage:

  1. Simple - just the starting position

  2. File creation and growth is easy


 

Disadvantages:

  1. Can not be randomly accessed

  2. The link pointer between the block and the block takes up space

  3. There are reliability issues


 

Indexed allocation

Features:

  1. Put all the data block pointers into the index block


The ith entry in the index block points to the ith block of the file.

  • The directory entry includes the address of the index block



  1. Each file has an index block;



  • Array of disk block addresses



  1. Index allocation supports direct access, and there is no external fragmentation problem

  2. The index block itself may waste space


Link scheme: An index block is usually a disk block.For large files, multiple index blocks can be linked together.

Multi-layer index: Indirect addressing similar to memory (primary, secondary, indirect...)

 

 

Please login to reply. Login

Reversion History

Loading...
No reversions found.