完成基础下的操作系统内容的图片webp格式更换
continuous-integration/drone/push Build encountered an error
Details
预备添加基础下剩余内容的webp图片switch-png-to-webp
|
@ -113,7 +113,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 根据CPU的命令对相应设备发送命令
|
||||
* 用于实现设备控制功能
|
||||
* 组成图
|
||||
* ![](https://lychee.inksoul.top/uploads/original/f4/a7/7005ad61d01aee024c9ac6cee0e9.webp)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/27/43/c11160ee9f28865c3eb334988c91.webp)
|
||||
|
||||
### 设备控制器的三种寄存器(可被CPU直接访问的寄存器,也叫IO端口)
|
||||
|
||||
|
@ -173,7 +173,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 每个DMA控制器对应一台设备与内存传递数据
|
||||
* DMA方式主要用于块设备,磁盘尤其是典型的块设备
|
||||
* 示例图
|
||||
* ![](https://lychee.inksoul.top/uploads/original/42/f1/1b4442cc3ae2b01bb4dcf72b9cd9.webp)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/6c/03/f773b60ca05a2cb8f7cc60d3a6bb.webp)
|
||||
|
||||
### 通道控制方式
|
||||
|
||||
|
@ -189,7 +189,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 通常包含许多非分配型字通道,数量可以达到几十到几百个,每个通道连接一台IO设备,并控制该设备的IO操作
|
||||
* 常用于连接大量低速或中速IO设备
|
||||
* 示例图
|
||||
* ![](https://lychee.inksoul.top/uploads/original/c4/31/e5d7aa4fb139aa68c3cf5fcdf62a.webp)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/f7/43/029203b2d6e455c455a730974d31.webp)
|
||||
|
||||
### 四种方式比较
|
||||
|
||||
|
@ -247,22 +247,22 @@ date: 2023-07-05T14:13:34+08:00
|
|||
### 设备分配依据的数据结构
|
||||
|
||||
* 设备、控制器、通道间的关系
|
||||
* ![](https://lychee.inksoul.top/uploads/original/f4/a7/7005ad61d01aee024c9ac6cee0e9.webp)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/27/43/c11160ee9f28865c3eb334988c91.webp)
|
||||
* 设备控制表(DCT)
|
||||
* 系统为每个设备配置一张DCT
|
||||
* 用于记录设备情况
|
||||
* ![](../../images/408/《操作系统》IO管理/设备控制表.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/c3/02/3e2798fcb153d946531079d9dd92.webp)
|
||||
* 控制器控制表(COCT)
|
||||
* 每个设备控制器都会对应一张COCT
|
||||
* 操作系统会根据COCT的信息对控制器进行操作管理
|
||||
* ![](../../images/408/《操作系统》IO管理/控制器控制表.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/75/30/dd8508704dcc8f3d67c22b7cfc83.webp)
|
||||
* 通道控制表(CHCT)
|
||||
* 每个通道都会对应一张CHCT
|
||||
* 操作系统会根据CHCT的信息对通道进行操作管理
|
||||
* ![](../../images/408/《操作系统》IO管理/通道控制表.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/64/d5/c56c3ce0f0fb18858734b1e9596d.webp)
|
||||
* 系统设备表(SDT)
|
||||
* 记录了系统中全部设备的情况,每个设备对应一个表目
|
||||
* ![](../../images/408/《操作系统》IO管理/系统设备表.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/34/80/f230f2640fac89147128cbe3bc4b.webp)
|
||||
|
||||
|
||||
### 逻辑设备名到物理设备名的映射
|
||||
|
@ -311,25 +311,25 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 单缓冲
|
||||
* 流程
|
||||
* Max(C,T) + M
|
||||
* ![](../../images/408/《操作系统》IO管理/单缓冲流程图.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/bc/de/74644bf29707fbb46c62f8c5e82b.webp)
|
||||
* T > C 时,处理一块数据需要(T + M)
|
||||
* ![](../../images/408/《操作系统》IO管理/单缓冲T大于C.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/f8/79/2182afa85837c7f60e7dfadc1894.webp)
|
||||
* T < C 时,处理一块数据需要(C + M)
|
||||
* ![](../../images/408/《操作系统》IO管理/单缓冲T小于C.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/70/cc/47c780ffa35684cf6ffbe1080e4d.webp)
|
||||
* 双缓冲
|
||||
* 流程
|
||||
* Max(T,C + M)
|
||||
* ![](../../images/408/《操作系统》IO管理/双缓冲流程图.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/c9/41/39106528cd38fad66670ebda09cf.webp)
|
||||
* T > C + M 时,平均处理一个数据块需要时间T
|
||||
* ![](../../images/408/《操作系统》IO管理/双缓冲T大于C+M.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/c0/4c/5bdb95aa0b00aae9c57fe353c572.webp)
|
||||
* T < C + M 时,平均处理一个数据块需要时间(C + M)
|
||||
* ![](../../images/408/《操作系统》IO管理/双缓冲T小于C+M.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/ac/23/066dfc2a705e7824e63e315a41fc.webp)
|
||||
* 循环缓冲
|
||||
* 将多个大小相等的缓冲区连接成一个循环队列
|
||||
* 下图中橙色表示已充满数据的缓冲区,绿色表示空缓冲区
|
||||
* 当需要向缓冲区中充入数据时,只要找到in指针指向的空缓冲区,向其中充入数据,然后再把in指针指向下一个空缓冲区
|
||||
* 当需要取出满缓冲区的内容时,找到out指针执行的满缓冲区,读取完数据后,将指针指向下一个满缓冲区
|
||||
* ![](../../images/408/《操作系统》IO管理/循环缓冲流程图.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/61/b0/8081e7d506e41a75d67a80aff71c.webp)
|
||||
* 缓冲池
|
||||
* 缓冲池由系统中共用的存放在主存中的缓冲区组成,被认为是最好的方法
|
||||
* 缓冲区根据使用情况分为
|
||||
|
@ -341,7 +341,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 用于提取输入数据的工作缓冲区(sin)
|
||||
* 用于收容输出数据的工作缓冲区(hout)
|
||||
* 用于提取输出数据的工作缓冲区(sout)
|
||||
* ![](../../images/408/《操作系统》IO管理/缓冲池流程图.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/64/fb/95ef428992c16ee7fe1ff3866a70.webp)
|
||||
|
||||
|
||||
## SPOOLing技术(假脱机技术)
|
||||
|
@ -371,7 +371,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 输入缓冲区用于暂存从输入设备输入的数据,之后再转存到输入井中
|
||||
* 输出缓冲区用于暂存从输出井传送的数据,之后再传送到输出设备上
|
||||
* 流程图
|
||||
* ![](../../images/408/《操作系统》IO管理/SPOOLing系统的运行过程.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/e2/cb/d011a4a724c9256aba7b5cab0220.webp)
|
||||
|
||||
|
||||
### SPOOLing系统的优特点
|
||||
|
@ -397,7 +397,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
|
||||
### 基本概念和结构
|
||||
|
||||
![](../../images/408/《操作系统》IO管理/磁盘结构示例图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/f6/02/3a8e76155755af00c49f8b9c5cd1.webp)
|
||||
|
||||
* 基本结构
|
||||
* 磁盘
|
||||
|
@ -509,7 +509,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 处理顺序
|
||||
* 98,183,37,122,14,124,65,67
|
||||
* 寻道示例图
|
||||
* ![](../../images/408/《操作系统》IO管理/磁盘调度-先来先服务.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/5b/43/b8be7813907cd2bfcd508fa398db.webp)
|
||||
* 最短寻找时间优先(SSTF)
|
||||
* 思想
|
||||
* 优先选择从当前磁头位置所需寻道时间最短的请求
|
||||
|
@ -522,7 +522,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 处理顺序
|
||||
* 65,67,37,14,98,122,124,183
|
||||
* 寻道示例图
|
||||
* ![](../../images/408/《操作系统》IO管理/磁盘调度-最短寻道时间优先.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/55/57/064d927f543dea7f214575ce0956.webp)
|
||||
* 扫描/电梯算法(SCAN)
|
||||
* 思想
|
||||
* 磁头在一个方向上移动,访问所有未完成的请求,直到磁头到达该方向上的最后的磁道,才调换方向
|
||||
|
@ -536,7 +536,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 磁头先响应左边的请求,到达最左端后才开始反向移动,响应右边的请求
|
||||
* 37,14,0,65,67,98,122,124,183
|
||||
* 寻道示例图
|
||||
* ![](../../images/408/《操作系统》IO管理/磁盘调度-扫描算法.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/39/66/ac470363b7d89d3f03927225982c.webp)
|
||||
* C-SCAN算法
|
||||
* 思想
|
||||
* 只有磁头朝某个特定方向移动时,才处理磁道访问请求
|
||||
|
@ -553,7 +553,7 @@ date: 2023-07-05T14:13:34+08:00
|
|||
* 直到到达最开始的磁道后,才继续顺序响应右边的请求
|
||||
* 65,67,98,122,124,183,199,0,14,37
|
||||
* 寻道示例图
|
||||
* ![](../../images/408/《操作系统》IO管理/磁盘调度-C-SCAN算法.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/66/f6/29c00355469ea4dec47daba8690b.webp)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
|
||||
过程图
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/程序链接与接入过程图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/54/11/97d9b0ea12b94ea78ab84ec026b1.webp)
|
||||
|
||||
* 编译
|
||||
* 由编译程序将用户源代码编译程若干目标模块
|
||||
|
@ -62,7 +62,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 可重定位装入:装入时把逻辑地址转换为物理地址,但装入后不能改变
|
||||
* 动态重定位装入:执行时再决定装入的地址并装入,装入后有可能会换出
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/重装入类别例图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/1c/ce/b6e9dba57d889e30e534c2f9cf9e.webp)
|
||||
|
||||
### 逻辑地址与物理地址
|
||||
|
||||
|
@ -91,7 +91,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 堆:用来存放动态分配的变量【动态的】
|
||||
* 栈:用来实现函数调用的【动态的】
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/内存映像的例图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/2e/7e/d2ba153083a733e9be4aa30b8847.webp)
|
||||
|
||||
|
||||
### 内存保护
|
||||
|
@ -105,7 +105,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 界地址寄存器含逻辑机制的最大值【用于比】
|
||||
* 逻辑地址+重定位寄存器的值 = 物理地址
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/重定位寄存器和界地址寄存器的硬件支持.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/05/49/4869cf02db361330c3f124413dd1.webp)
|
||||
|
||||
|
||||
### 内存共享
|
||||
|
@ -274,11 +274,11 @@ date: 2023-07-03T20:39:49+08:00
|
|||
|
||||
利用段表实现物理内存区映射
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/利用段表实现物理内存区映射.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/d0/d3/e53f784dc6b2866f6c0a8be89a1c.webp)
|
||||
|
||||
分段系统的地址变换过程
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/分段系统的地址变换过程.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/83/ae/3e11e38fa42704c70ebd98f6af02.webp)
|
||||
|
||||
|
||||
### 分页
|
||||
|
@ -333,7 +333,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 分页产生的页表过大,使用多级页表来解决空间上的问题
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/基本地址变换结构图.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/38/24/d666c6b3db887d6c214536372a3f.webp)
|
||||
|
||||
* 两级页表地址变换
|
||||
* 一级页表覆盖到全部虚拟地址空间,二级页表在需要时创建
|
||||
|
@ -341,7 +341,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 页表寄存器存放的是一级页表起始物理地址
|
||||
* 多层参与,时间上开销大,加入TLB,提高地址的转换速度
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/两级页表地址变化结构图.png)
|
||||
![](https://lychee.inksoul.top/uploads/medium/df/5d/96551021cbb78e0532d3825aff1d.webp)
|
||||
|
||||
* 具有快表的地址变换
|
||||
* 快表是相联存储器(TLB)
|
||||
|
@ -351,7 +351,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* CPU芯片中,封装了MMU(内存管理单元)
|
||||
* MMU用来完成地址转换和TBL的访问与交互
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/具有快表的地址变换结构图.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/21/80/bb05899161040a2fefd4155a35a6.webp)
|
||||
|
||||
|
||||
### 段页
|
||||
|
@ -364,9 +364,9 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 对内存的管理以存储块为单位,地址空间是二维的
|
||||
* 演示图例
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/段页式系统的地址变换机构图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/fb/79/93a67e5e95084988d59345778f2b.webp)
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/段页式系统的逻辑地址结构图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/f0/fa/cdb041b48c9c5e17ca7964595fc1.webp)
|
||||
|
||||
|
||||
* 得到物理地址的3次内存访问
|
||||
|
@ -470,7 +470,7 @@ date: 2023-07-03T20:39:49+08:00
|
|||
* 从内存中换出一页
|
||||
* 地址变换过程
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/地址变换过程演示图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/4e/b9/cb1740726f181da5c99283319096.webp)
|
||||
|
||||
### 页框分配(进程准备执行时,由OS决定给特定进程分配几个页框)
|
||||
|
||||
|
@ -591,5 +591,5 @@ date: 2023-07-03T20:39:49+08:00
|
|||
|
||||
使用页表的地址翻译
|
||||
|
||||
![](../../images/408/《操作系统》内存管理/使用页表的地址翻译流程图.png)
|
||||
![](https://lychee.inksoul.top/uploads/medium/9b/e1/745706d0a61322386e63ae8b3e62.webp)
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ date: 2023-07-06T11:24:18+08:00
|
|||
|
||||
----
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/生产者消费者问题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/ab/ec/6ab00f9e1ca414581c4cea758dd4.webp)
|
||||
|
||||
``` C
|
||||
|
||||
Semaphore mutex1 = 1 //互斥访问F1
|
||||
|
@ -75,7 +76,7 @@ F_C(){
|
|||
|
||||
```
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/生产者消费者问题三.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/6a/7a/7be0bf2eb19ccfb5cd3b2f7d4b18.webp)
|
||||
|
||||
```C
|
||||
|
||||
|
@ -156,7 +157,7 @@ while(1){
|
|||
```
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/理发师问题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/3d/72/d1067d172a895094998eff135ee0.webp)
|
||||
|
||||
```C
|
||||
Semaphore empty = 10;//空座位的数目
|
||||
|
@ -236,7 +237,7 @@ process(){
|
|||
|
||||
```
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/哲学家问题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/db/e1/ed22be998422081aae2e57ca1d0d.webp)
|
||||
|
||||
通常解
|
||||
|
||||
|
@ -352,7 +353,7 @@ solo(){
|
|||
```
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/读者写者问题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/a6/d4/74e8e2b6e6fc6f4a922b4666debc.webp)
|
||||
|
||||
(1)
|
||||
```C
|
||||
|
@ -407,7 +408,7 @@ NtoS(){//北到南
|
|||
}
|
||||
|
||||
```
|
||||
![](../../images/408/《操作系统》大题总结/读者写者问题二.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/75/8a/fa213f171a2a7285840dedd68768.webp)
|
||||
|
||||
```C
|
||||
Semaphore room = 1;
|
||||
|
@ -497,21 +498,21 @@ P3(){
|
|||
* 一级页表+虚拟内存+TLB
|
||||
* 二级页表+虚拟内存+TLB
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理知识体系.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/c7/b6/3d42bb2a3eb23a3f623b5625b072.webp)
|
||||
|
||||
TLB+二级页表+Cache(全相联映射)
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/TLB全相联映射.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/62/62/afdde2594f9c51f47eb670eb3954.webp)
|
||||
|
||||
TLB+二级页表+Cache(2路组相联映射)
|
||||
![](../../images/408/《操作系统》大题总结/TLB2路组相联映射.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/61/61/67c696778a1bcb6345fd983486e2.webp)
|
||||
|
||||
TLB + 二级页表 + Cache(直接映射)
|
||||
![](../../images/408/《操作系统》大题总结/TLB直接映射.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/f4/b4/ff5fea0be661df57e0729b223676.webp)
|
||||
|
||||
---
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/e9/22/9df2db6e4946fccab35619260a03.webp)
|
||||
|
||||
(1)
|
||||
<br>
|
||||
|
@ -539,7 +540,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
<br>
|
||||
代码2起始物理地址 = 00901000H
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题二.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/e9/22/9df2db6e4946fccab35619260a03.webp)
|
||||
|
||||
页的大小 = 4KB = $2^{12}$B,页面位移比虚拟地址低12位
|
||||
|
||||
|
@ -570,7 +571,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
物理地址 = 101565H
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题三.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/22/38/c4c268827942286cdd5a8e80356e.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -594,7 +595,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
|
||||
物理地址为 0000 1011 1100 1010 = 0BCAH
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题四.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/e5/55/98c0c031454ed358a64dd7fe1a8d.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -617,7 +618,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
适合,程序的时间局部性越好,从空闲页框链表中重新取回的机会越大,该策略优势越明显
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题五.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/aa/89/6febeebd56da7e5b3e3bee31ca09.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -644,7 +645,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
访问的是同一个二级页表,即供访问一个二级页表
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题六.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/cb/d8/ca81273904bee3769a1123fca589.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -668,7 +669,7 @@ TLB + 二级页表 + Cache(直接映射)
|
|||
|
||||
修改位$\rightarrow$修改字段
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/内存管理真题七.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/ae/5e/22026fc03008e1b0638eedef21cd.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -706,16 +707,16 @@ a[1][2]的虚拟地址为 10801000H + 4 $\times$ 2 = 10801008H
|
|||
|
||||
显式链表分配法(FAT文件系统,即DOS)
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/FAT文件系统示意图.png)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/dd/d0/e4a8e02445c47d55158e49119375.webp)
|
||||
|
||||
混合索引法(Unix文件系统)
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/UFS文件系统示意图.png)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/b6/df/eb222d51132aa6a759e64aab4239.webp)
|
||||
|
||||
|
||||
### 考题
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/文件管理真题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/69/7e/ec3dd430b748a6df97713adae363.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -729,7 +730,7 @@ FCB集中存放,文件数据集中存放
|
|||
|
||||
这样在随机查找文件名时,只需访问FCB对应的块,可减少磁头移动和磁盘IO访问次数
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/文件管理真题二.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/e1/6c/b74b2eee0e6075aa78ecab6e550a.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -753,7 +754,7 @@ FCB集中存放,文件数据集中存放
|
|||
|
||||
块数可表示$2^{32}$个块,共4TB
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/文件管理真题三.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/34/47/928c9f9dce3b68f1a51e263ad5c5.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -794,7 +795,7 @@ FAT最大长度 = $2^{16} \times 2B = 128KB$
|
|||
即访问48号簇,106号簇
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/文件管理真题四.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/3a/b0/c094beafcdec6b3351bdbb8d9e5d.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -820,7 +821,7 @@ F的文件控制区的起始块号和文件长度内容会发生改变
|
|||
|
||||
文件长度为$1020B \times 4G = 4080GB$
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/文件管理真题五.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/1d/f8/0c2436c145b300cf1f31d7927296.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -860,7 +861,7 @@ $F_2$采用一级索引$\rightarrow$ 还需读一级索引表
|
|||
|
||||
### 大题
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/磁盘管理真题一.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/12/9a/317bd0a10b1d1615ede07d640e90.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -893,7 +894,7 @@ Flash半导体存储器不需要考虑寻道时间和旋转延迟
|
|||
可直接按IO请求的先后顺序服务
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/磁盘管理真题二.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/01/69/aa1c7ae2651f40889cfd3026c1ca.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
@ -922,7 +923,7 @@ $30 \times 2 = 60$
|
|||
将簇号转换成磁盘物理地址的过程由磁盘驱动程序完成
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》大题总结/磁盘管理真题三.png)
|
||||
![](https://lychee.inksoul.top/uploads/original/4a/da/e177d677686800a6d4340a53b1b0.webp)
|
||||
|
||||
(1)
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ date: 2023-07-04T16:56:55+08:00
|
|||
* 新增内容:索引节点编号;状态;访问计数;逻辑设备号;链接指针
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》文件管理/书目录和计算机目录对比举例.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/3b/52/0d19d61c49c2ed8e16d8e9101539.webp)
|
||||
|
||||
### 文件操作
|
||||
|
||||
|
@ -206,7 +206,7 @@ close(fd);//关闭文件
|
|||
* 缺点
|
||||
* 要求连续的存储空间,会产生外部碎片,不利于文件的动态扩充
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/顺序分配例图.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/8c/b0/eb0fe9bfa64672e9553fe84dea71.webp)
|
||||
* 链表分配
|
||||
* 特点
|
||||
* 存放是离散的,不用连续的,于是就可以消除磁盘碎片
|
||||
|
@ -222,7 +222,7 @@ close(fd);//关闭文件
|
|||
* 缺点
|
||||
* 只能按照文件的指针链顺序访问,查找效率低,指针信息存放消耗内存或磁盘空间
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/非连续空间存放方式-链表方式.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/de/f5/1147f9177cb7ea4796e01a45c2ee.webp)
|
||||
* 索引分配
|
||||
* 特点
|
||||
* 为每个文件创建一个索引数据块存放指向文件数据块的指针列表
|
||||
|
@ -234,12 +234,12 @@ close(fd);//关闭文件
|
|||
* 缺点
|
||||
* 索引表增加存储空间的开销,索引表的查找策略对文件系统效率影响较大
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/非连续空间存放方式-索引方式.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/af/c6/53200b3a295538efb4b35f7f7a1d.webp)
|
||||
* 链表 + 索引
|
||||
* 特点
|
||||
* 索引数据块留出一个存放下一个索引数据块的指针
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/链式索引块.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/39/90/c6903f2f8e86df775a65136c4842.webp)
|
||||
* 索引 + 索引(多级索引)
|
||||
* 特点
|
||||
* 通过一个索引块来存放多个索引数据块
|
||||
|
@ -265,12 +265,12 @@ close(fd);//关闭文件
|
|||
* 为所有空闲空间建立一张表
|
||||
* 表内容包括空闲区的第一个块号和该空闲区的块个数
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/空闲表法.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/b0/b8/241f96662aa6babf6c9a40655aa3.webp)
|
||||
* 空闲链表法
|
||||
* 每一个空闲块里有一个指针指向下一个空闲块
|
||||
* 这样能够很方便地找到空闲块并管理起来
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/空闲块链表.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/c5/4b/7dae46b384bc4c13f3bd2ea9c787.webp)
|
||||
* 位图法
|
||||
* 位图时利用二进制的一位来表示磁盘中一个盘块的使用情况
|
||||
* 磁盘上所有的盘块都有一个二进制与之对应
|
||||
|
@ -328,7 +328,7 @@ close(fd);//关闭文件
|
|||
|
||||
* 在磁盘中的结构
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/块组.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/e1/0c/97c0fa24db5c7451f1d62bacb1f0.webp)
|
||||
* 引导块
|
||||
* 在系统启动时用于启用引导
|
||||
* 块组
|
||||
|
@ -371,7 +371,7 @@ close(fd);//关闭文件
|
|||
|
||||
### 用户空间、系统调用、虚拟文件系统、缓存、文件系统和存储之间的关系
|
||||
|
||||
![](../../images/408/《操作系统》文件管理/虚拟文件系统.png)
|
||||
![](https://lychee.inksoul.top/uploads/medium/33/0d/00893d08c49606eb0d2039281bc3.webp)
|
||||
|
||||
|
||||
### 分区和安装
|
||||
|
@ -415,7 +415,7 @@ close(fd);//关闭文件
|
|||
* 不便于文件共享
|
||||
* 不适合多用户的OS
|
||||
* 结构图
|
||||
* ![](../../images/408/《操作系统》文件管理/单级目录结构.jpg)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/98/75/8072452cfa354a436e12d25611d8.webp)
|
||||
* 两级目录结构
|
||||
* 定义
|
||||
* 文件目录分为主文件目录MDF和用户文件目录UFD
|
||||
|
@ -427,7 +427,7 @@ close(fd);//关闭文件
|
|||
* 缺点
|
||||
* 缺乏灵活性,不能对文件分类
|
||||
* 结构图
|
||||
* ![](../../images/408/《操作系统》文件管理/两级目录结构.png)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/6e/69/fcafe831e9b3096daec59ce79414.webp)
|
||||
* 树型目录结构
|
||||
* 定义
|
||||
* 使用绝对路径,相对路径,当前路径的结构
|
||||
|
@ -440,7 +440,7 @@ close(fd);//关闭文件
|
|||
* 利于文件共享
|
||||
* 查找文件增加了磁盘访问次数,会影响查询速度
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/树型目录结构.jpg)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/db/ce/faef6ae7cd83dea33f82b14b8a53.webp)
|
||||
* 无环图目录结构
|
||||
* 定义
|
||||
* 在树型目录结构上
|
||||
|
@ -450,7 +450,7 @@ close(fd);//关闭文件
|
|||
* 缺点
|
||||
* 使系统的管理变得更加复杂
|
||||
* 例图
|
||||
* ![](../../images/无环图目录结构.jpg)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/89/56/eabf857b6bfbd20cdcc46d67c92a.webp)
|
||||
|
||||
|
||||
### 目录的查询/检索
|
||||
|
@ -494,7 +494,7 @@ close(fd);//关闭文件
|
|||
* 若得到的值不为0,则不能删除此文件
|
||||
* 即只要还有一个指针在,索引节点就不会被删除
|
||||
* 例图
|
||||
* ![](../../images/408/《操作系统》文件管理/基于索引结点的共享方式.jpg)
|
||||
* ![](https://lychee.inksoul.top/uploads/original/f4/cd/49dd3cf3de0acebe0a70b14bf213.webp)
|
||||
* 基于符号链实现文件共享【软链接】
|
||||
* 定义
|
||||
* 软链接相当于重新创建一个文件
|
||||
|
|
|
@ -301,7 +301,7 @@ date: 2022-08-18T15:53:40+08:00
|
|||
|
||||
|
||||
|
||||
![](../../images/408/《操作系统》计算机系统概述/system_boot_pic.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/aa/b6/dd60b007959187b3c7f5b066b100.webp)
|
||||
|
||||
* 启动过程
|
||||
1. CPU加电,CS:IP指向FFFF0H
|
||||
|
|
|
@ -332,7 +332,7 @@ date: 2023-07-01T15:59:00+08:00
|
|||
* 克服了多对一模型的并发度不高的缺点
|
||||
* 克服了一对一模型的一个用户进程占用太多内核线程而开销打的缺点
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/muti-thread_model.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/55/1b/4301b742f9da2710e3372576f79e.webp)
|
||||
|
||||
|
||||
## 处理机调度
|
||||
|
@ -348,7 +348,7 @@ date: 2023-07-01T15:59:00+08:00
|
|||
* 调度是多道程序OS的基础:调度是OS设计的核心问题
|
||||
* 层次分类模型图
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/调度层次分类模型图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/73/f4/f278b5759ce6d4c59811230fec88.webp)
|
||||
|
||||
* 高级调度、作业调度
|
||||
* 是内存与辅存的调度,从后备队列中调度作业
|
||||
|
@ -371,7 +371,7 @@ date: 2023-07-01T15:59:00+08:00
|
|||
|
||||
* 调度程序结构图
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/调度程序结构图.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/original/e6/68/fbb0e00bfa16e66f382572917a19.webp)
|
||||
|
||||
* 调度器的组成
|
||||
* 用于调度和分派CPU的组件
|
||||
|
@ -949,16 +949,16 @@ do{
|
|||
|
||||
#### 安全性算法和银行家算法例题举例
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/安全性算法和银行家算法举例.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/76/f2/dc5c769dc8aca10080713acbc556.webp)
|
||||
|
||||
安全性算法解法
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/安全性算法和银行家算法举例安全性算法解法.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium/d7/c7/1e7b70fe44ca83f931b64be59038.webp)
|
||||
|
||||
|
||||
银行家算法解法
|
||||
|
||||
![](../../images/408/《操作系统》进程与线程/安全性算法和银行家算法举例银行家算法解法.jpg)
|
||||
![](https://lychee.inksoul.top/uploads/medium2x/1b/43/50826d649f36e4e0210eb8c5c532.webp)
|
||||
|
||||
|
||||
|
||||
|
|
Before Width: | Height: | Size: 140 KiB |
Before Width: | Height: | Size: 348 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 200 KiB |
Before Width: | Height: | Size: 265 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 283 KiB |
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 2.4 MiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 196 KiB |
Before Width: | Height: | Size: 214 KiB |
Before Width: | Height: | Size: 309 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 122 KiB |
Before Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 141 KiB |
Before Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 212 KiB |
Before Width: | Height: | Size: 288 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 1003 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 358 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 633 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 130 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 172 KiB |
Before Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 501 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 158 KiB |
Before Width: | Height: | Size: 374 KiB |
Before Width: | Height: | Size: 643 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 41 KiB |