4.3 Disk organization and management

4.3.1 The structure of the disk

一个扇区为一个磁盘块,各个扇区存放数据量相同。

最内侧磁道的扇区面积最小,密度最大。

可用 (柱面号、盘面号、扇区号)Locate a disk block
Insert picture description here

Insert picture description here
Insert picture description here

4.3.2 Disk scheduling algorithm Only affect the seek time

Insert picture description here


Insert picture description here


(1)先来先服务算法
Insert picture description here
优点:Fair, performance is acceptable if concentrated.
缺点:A large number of processes compete, and the track distribution is relatively scattered, and the performance is poor


(2)最短寻道时间优先算法 how are you Choose the best track at hand


Insert picture description here
Hunger

(3)扫描(SCAN)算法 Also called (elevator scheduling algorithm)

磁盘移到最外侧才能往内移动 No hunger
Insert picture description here


(4)循环扫描算法(C-SCAN)

Move to the outermost,Return to the outermost side of the other side
Insert picture description here
移到最外侧的请求即可,不需要访问到最外侧磁道
Insert picture description here
Insert picture description here
LOOK和SCAN 都是为了方便处理接近最礼物和最外的磁道请求


Insert picture description here


In addition to reducing the search time, reducing the delay time, it can be performed on the disk sector 交替编号, and the different disk surfaces in the disk group错位命名

Insert picture description here


4.3.3 Disk management

1) Initialization
of the disk Carry out low-level formatting and logical formatting of the disk.

A new disk is just a blank disk containing magnetic recording material. Before the disk can store data, itMust be divided into sectorsSo that the disk controller can read and write operations, this process is calledLow-level format (physical partition)(分扇区)

OS将自己的数据结构记录在磁盘上

  • The first step is to divide the disk into 由一个或多个柱面组成的分区(that is, the familiar C disk, D disk, etc. partitions);
  • The second step of the physical partition逻辑格式化(创建文件系统) Create a root directory to initialize the storage of free disk block information

2) Boot block When the computer starts, it needs to run one by one , which initializes the CPU, registers, device controller and memory.存放自举程序
初始化程序(自举程序)
The bootloader is usually stored in ROM

  • 先运行自举装入程序,通过该程序就可以找到引导块,并将完整的 Loader Load the memory.

3) Bad block

One or more sectors are easily damaged
1、对于简单磁盘 Bad sectors are marked on FAT

2、对于复杂磁盘 Control equipment available 备用块Come 逻辑替换坏块 Sector spare

Guess you like

Origin blog.csdn.net/weixin_38220799/article/details/109279783