- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我知道 linux 内核使用驱动程序与硬盘设备通信,并且设备上有固件代码来为驱动程序的请求提供服务。我的问题是:
固件公开了什么样的功能(即 api)?例如,它是否只公开内核管理的地址空间,或者 linux 内核中是否有一些代码处理与硬盘驱动器相关的一些物理(即磁道/扇区/盘片等上的数据布局...... )
是内核安排磁盘的磁头移动,还是固件?
是否有针对硬盘设备公开的 api 的标准规范?
最佳答案
I understand that the linux kernel uses a driver to communicate with the hard disk device
所有外围设备都是如此。
there is firmware code on the device to service the driver's requests
现代 HDD(自 IDE 出现以来)具有集成磁盘 Controller 。
“固件”本身不会做任何事情,而且是一个模棱两可的描述。 IE。什么在执行这个“固件”?
- what kind of functionality (i.e. api) does the firmware expose? For example, does it only expose an address space that the kernel manages, or is there some code in the linux kernel that deals with some of the physics related to the hard drive (i.e. data layout on track/sector/platter etc...)
SATA 驱动器使用 ATA Packet Interface, ATAPI .
旧的 SMD 和 ST506 驱动器接口(interface)使用柱面、磁头和扇区(也称为 CHS)寻址。此类驱动器的磁盘 Controller 通常在主机端保持类似的接口(interface),因此操作系统有义务了解驱动器的(物理)几何结构。操作系统将尝试通过将分区与柱面对齐来优化性能,并通过按柱面地址对请求进行排序来最小化查找/访问时间。
虽然磁盘 Controller 通常需要 CHS 寻址,但操作系统的较高层会使用顺序逻辑扇区地址。只要驱动器的几何结构已知,逻辑扇区地址到柱面、磁头和扇区地址之间的转换就很简单。
磁盘 Controller 主机端的 SCSI 和 IDE (ATA) 接口(interface)提供逻辑 block 寻址( block = 扇区)而不是 CHS 寻址。操作系统不再需要知道驱动器的物理几何形状,并且磁盘 Controller 能够使用逻辑寻址的抽象来使用区域位记录实现每个扇区更一致的面密度。
因此操作系统应该只使用逻辑 block 地址发出读取或写入 block 操作,而不要太关心驱动器的几何形状。
例如,不再可能通过 ATA 接口(interface)进行低级格式化,并且由于区域位记录,驱动器的几何结构是可变的(主机不知道)。坏扇区管理通常由集成 Controller 单独控制。但是,您可能仍然可以在各种操作系统中找到 CHS 优化的一些残余(例如,驱动器分区与“圆柱体”对齐)。
- Does the kernel schedule the disk's head movement, or is it the firmware?
使用寻道操作是可能的,但更可能是操作系统将 R/W 操作与自动寻道或 LBA R/W 操作一起使用。
然而,对于具有大量缓存和区域位记录的 LBA 和现代 HDD,不需要此类寻道操作,而且可能会适得其反。
最终磁盘 Controller 执行实际寻道。
- Is there a standard spec for the apis exposed by hard disk devices?
ATA/ATAPI 是已发布的规范(虽然它似乎处于“工作草案”状态已有 20 年)。
参见 http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf
ABSTRACT This standard specifies the AT Attachment command set used to communicate between host systems and storage devices. This provides a common command set for systems manufacturers, system integrators, software suppliers, and suppliers of storage devices. The AT Attachment command set includes the PACKET feature set implemented by devices commonly known as ATAPI devices. This standard maintains a high degree of compatibility with the ATA/ATAPI Command Set - 2 (ACS-2).
关于linux - sata 硬盘暴露什么样的 api?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38578259/
我知道 linux 内核使用驱动程序与硬盘设备通信,并且设备上有固件代码来为驱动程序的请求提供服务。我的问题是: 固件公开了什么样的功能(即 api)?例如,它是否只公开内核管理的地址空间,或者 li
使用 DISKPART命令行实用程序,我可以获得称为“位置路径”的东西,它似乎可以满足我的需要,您可以使用命令 detail disk 查看它在 diskpart 中选择您的一个磁盘后. 看来我可以通
ESXi下查看磁盘SMART比较麻烦,并且SATA协议的和NVMe协议的操作不一样,下面分别进行详细陈述 SATA ——使用smartctl查看 本部分参考梦幻生命@CSDN
我有一个正在运行的应用程序需要使用适用于 Linux 的 SATA AHCI 驱动程序。我有 AHCI.so 可以使用,但我正在寻找一些文件(.h 文件),它将发布我的应用程序可以使用的 api(计划
我正在研究 2.6.35.9 版本的 Linux 内核,并试图禁用命令完成合并。 lspci 的输出如下图: 00:00.0 Host bridge: Intel Corporation 82P965
我正在调试带有 SATA AHCI Controller 的 PC 的第二阶段引导加载程序。我能够枚举 PCI 总线并找到硬盘。到现在为止还挺好。现在,我笔记本(Dell Inspiron 1525)
看了很多书后,我才知道没有单一的计算 CRC 的方法。我需要专门为串行 ATA (SATA) 计算 CRC 的方法/算法/VHDL 代码 最佳答案 SATA 使用 IEEE 802.3 CRC。以下是
有谁知道我可以用来以编程方式检测 SATA 硬盘驱动器是否已拔出的方法?当我们需要检测驱动器的移除时,我们的文件系统以只读模式挂载。前几天我们注意到,我们能够拔下硬盘驱动器,一切都继续顺利运行,直到我
我是 Linux 内核的新手,所以我可能会搞混。但是任何建议都会对我有所帮助;) 我有一个通过 PCIe SATA 卡连接的 SATA HDD,我尝试像在 block 设备上一样使用 read 和 w
我目前正在开展一个项目,我需要将数据批量导入到 Hadoop 集群中。需要导入 Hadoop 的数据驻留在 SATA 磁盘上。需要导入的数据是Encase取证磁盘镜像(E01)。我创建了一个从这些图像
我正在为 PXE 环境编译我自己的 Linux 内核和用户区工具,用于克隆和重新镜像。现在,我坚持使用特定的内核版本并使用预配置的 .config 来构建 Linux 内核。 我需要从使用预配置的 .
我正在尝试编写一个 C/C++ 程序来检测 Windows 7 中的新 SATA SSD(固态驱动器)连接。 这款 SATA SSD 还附带一条 SATA-USB 数据线。我已经将 SATA 端连接到
如何在 VB.NET 中读取 IDE 和 SATA 驱动器的硬盘序列号?(我不想要卷序列号)。 如果没有管理权限,应该为 XP 和 Vista 收集此信息。 最佳答案 您可以使用 WMI (Windo
我是一名优秀的程序员,十分优秀!