文件管理系统:设备驱动程序和基本文件系统
File management systems: device drivers and basic file systems
William Stallings 编写的教科书 操作系统 – 内部原理和设计原则 的第 526 页说了以下内容:
At the lowest level, device drivers communicate directly with peripheral devices or their controllers or channels. A device driver is responsible for starting I/O operations on a device and processing the completion of an I/O request. For file operations, the typical devices controlled are disk and tape drives. Device drivers are usually considered to be part of the operating system.
第 527 页继续说以下内容:
The next level is referred to as the basic file system, or the physical I/O level. This is the primary interface with the environment outside of the computer system. It deals with blocks of data that are exchanged with disk or tape systems.
设备驱动程序和基本文件系统的功能对我来说似乎是一样的。因此,我不确定 Stallings 如何区分它们。这两者有什么区别?
编辑
出自同教材第9版第555页:
The next level is referred to as the basic file system, or the physical I/O level. This is the primary interface with the environment outside of the computer system. It deals with blocks of data that are exchanged with disk or tape systems. Thus, it is concerned with the placement of those blocks on the secondary storage device and on the buffering of those blocks in main memory. It does not understand the content of the data or the structure of the files involved. The basic file system is often considered part of the operating system.
将其分解为层:
层 1) 物理 I/O 磁盘需要指定盘片、扇区和磁道以读取或写入块。
第 2 层)逻辑 I/O 磁盘以数字序列排列块,并且读取或写入特定的逻辑块编号,该编号被转换为 track/platter/sector.
操作系统通常支持逻辑 I/O 和物理 I/O 磁盘。也就是说,现在大多数磁盘都进行逻辑到物理的转换。 O/S 仅旧磁盘需要对此的支持。
如果设备支持逻辑 I/O,设备驱动程序将执行 I/O。如果设备只支持物理 I/O 设备驱动程序通常会同时处理逻辑层和物理层。因此,物理 I/O 层仅存在于磁盘的驱动程序中,而在硬件中不执行逻辑 I/O 。如果磁盘支持逻辑I/O,则驱动中没有第1层。
以上都是您的第一个引述地址中出现的内容。
第 3 层)虚拟 I/O 将特定字节或块(取决于 O/S)写入文件。该层通常在设备驱动程序之外处理。在这一层,每个支持的文件系统都有单独的模块。对使用同一文件系统的所有磁盘的虚拟 I/O 请求通过同一模块。
处理虚拟 I/O 需要比简单地读取写入磁盘块复杂得多。虚拟 I/O 层需要使用底层磁盘文件系统结构来将块分配给特定文件。
这似乎是第二个引用中提到的内容。令我困惑的是为什么它称其为 "physical I/O" 层而不是 "virtual I/O" 层。
我到过的所有物理 I/O 和逻辑 I/O 都是将原始块写入磁盘,而不考虑磁盘上的文件系统。
William Stallings 编写的教科书 操作系统 – 内部原理和设计原则 的第 526 页说了以下内容:
At the lowest level, device drivers communicate directly with peripheral devices or their controllers or channels. A device driver is responsible for starting I/O operations on a device and processing the completion of an I/O request. For file operations, the typical devices controlled are disk and tape drives. Device drivers are usually considered to be part of the operating system.
第 527 页继续说以下内容:
The next level is referred to as the basic file system, or the physical I/O level. This is the primary interface with the environment outside of the computer system. It deals with blocks of data that are exchanged with disk or tape systems.
设备驱动程序和基本文件系统的功能对我来说似乎是一样的。因此,我不确定 Stallings 如何区分它们。这两者有什么区别?
编辑
出自同教材第9版第555页:
The next level is referred to as the basic file system, or the physical I/O level. This is the primary interface with the environment outside of the computer system. It deals with blocks of data that are exchanged with disk or tape systems. Thus, it is concerned with the placement of those blocks on the secondary storage device and on the buffering of those blocks in main memory. It does not understand the content of the data or the structure of the files involved. The basic file system is often considered part of the operating system.
将其分解为层:
层 1) 物理 I/O 磁盘需要指定盘片、扇区和磁道以读取或写入块。
第 2 层)逻辑 I/O 磁盘以数字序列排列块,并且读取或写入特定的逻辑块编号,该编号被转换为 track/platter/sector.
操作系统通常支持逻辑 I/O 和物理 I/O 磁盘。也就是说,现在大多数磁盘都进行逻辑到物理的转换。 O/S 仅旧磁盘需要对此的支持。
如果设备支持逻辑 I/O,设备驱动程序将执行 I/O。如果设备只支持物理 I/O 设备驱动程序通常会同时处理逻辑层和物理层。因此,物理 I/O 层仅存在于磁盘的驱动程序中,而在硬件中不执行逻辑 I/O 。如果磁盘支持逻辑I/O,则驱动中没有第1层。
以上都是您的第一个引述地址中出现的内容。
第 3 层)虚拟 I/O 将特定字节或块(取决于 O/S)写入文件。该层通常在设备驱动程序之外处理。在这一层,每个支持的文件系统都有单独的模块。对使用同一文件系统的所有磁盘的虚拟 I/O 请求通过同一模块。
处理虚拟 I/O 需要比简单地读取写入磁盘块复杂得多。虚拟 I/O 层需要使用底层磁盘文件系统结构来将块分配给特定文件。
这似乎是第二个引用中提到的内容。令我困惑的是为什么它称其为 "physical I/O" 层而不是 "virtual I/O" 层。
我到过的所有物理 I/O 和逻辑 I/O 都是将原始块写入磁盘,而不考虑磁盘上的文件系统。