0

If we want to access(read/write) SATA drive via AHCI in EFI shell, is there any read/write interface used for this purpose ?

That is, does EFI shell application need to implement the AHCI spec to access drive ? (build command, issue command and process the command completion...)

Or application just calls specific "read/write" interfaces(like SCSI_PATH_THROUGH in Windows) and the "EFI ahci driver" converts these to low-level access routines ?

4

1 回答 1

1

如果您的 UEFI 中有可用于 SATA 驱动器的驱动程序,并且您希望访问的文件系统受支持,则读取/写入文件的行为是通过简单的(ish)协议调用完成的。

我能想到的最好的例子是 Linux 内核存根加载程序(它将 Linux 内核变成能够自行加载的 EFI 应用程序)。确保使用当前的 3.15 rc 或更高版本,因为早期代码中存在错误。 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/efi/efi-stub-helper.c?id=refs/tags/v3.15- rc5使用https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/boot/compressed/eboot.c?id=refs/tags/v3中定义的函数.15-rc5进行文件系统访问。

或者,应用程序可以像 GRUB 一样使用原始块设备访问方法 - 使应用程序能够访问 UEFI 本身不支持的文件系统。

此外,一些应用程序(如 rEFInd)通过在运行时加载协议(随 rEFInd 的安装提供)在 UEFI 中启用额外的文件系统支持。

于 2014-05-10T14:21:25.920 回答