光盘启动 (Boot from CDROM) Part 2- SakiProject

本文介绍了如何通过BIOS扩展13h中断读取光驱内容,重点讲解了Disk Address Packet(DAP)的构造和使用。在解析光盘文件系统ISO 9660时,讨论了主卷描述符和目录项,阐述了通过路径表或层级查找文件的方法,并展示了如何逐级找寻并加载文件。
摘要由CSDN通过智能技术生成

继续上1P,我们现在要开始读取光驱里面的内容了。以前我描述过BIOS显示服务和磁盘服务(这里),但是我只将了CHS读软盘,没有涉及到硬盘和光驱。由于硬盘和光驱的构造与软盘截然不同,使用读软盘的手段是行不通的,为此,BIOS给我们提供了扩展13h中断。

Continue to the next part, we are going to read the content in the cdrom. I described the bios display service and disk service in previous posts (Here, in Chinese), but I only introduced the way to read floppy through CHS method, but not harddisk and cdrom. Because the hardware construction of these devices are totally different, we cannot apply the floppy-way to harddisk(ATA) and cdrom(ATAPI) devices. In order to solve the problem, BIOS provides us extended int 13h.

Register Value Description
AH Function(0x42) Extended Read from ATA/ATAPI Device
DL Drive Number
DS:SI Address of Disk Address Packet

参数和读软盘不一样了。我们使用Disk Address Packet(DAP, 磁盘地址包)来间接传递参数,而不是传CHS信息。DAP的构造如下表:

The argument is different from the normal read function. We no longer pass the CHS arguments to the BIOS, but a Disk Address Packet(DAP) instead. The format of DAP is described by the following table:

Offset Size Name Description
0 1 Packet Size Always 16 (At least now)
1 1 Reserved Should be zero
2 2 Sector Count Number of sectors to read
4 4 Buffer Address Format is segment:offset, a word-long offset is stored first
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值