读取比int 13h轨道更多的扇区 [英] Reading more sectors than there are on a track with int 13h

查看:89
本文介绍了读取比int 13h轨道更多的扇区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有 ah = 02h int 13h 的顺序是什么,它将读取从(C,H,S)开始的 19 个扇区.=(0,0,1)提供了一个2磁头,每磁道18个扇区,每侧80个磁道的(软盘)磁盘几何.

What is the order int 13h with ah=02h will read 19 sectors starting at (C, H, S) = (0, 0, 1) provided a (floppy) disk geometry of 2 heads, 18 sectors per track and 80 tracks per side.

或更笼统地说,当磁道到达磁道0的结尾,磁头0时会发生什么?它会追踪1还是朝向1?在这种情况下,它甚至还能正常工作吗?

Or, more generally, what happens when it reaches the end of track 0, head 0? Does it go to track 1 or head 1? Does it even work properly in this case?

等等.这实际上是小时,分钟,秒吗?如果我们到达曲目的结尾(S大于18),那么H会增加吗?

Wait.. is this actually like hours, minutes, seconds? If we reach the end of the track (S is greater than 18), then H is increased?

推荐答案

现代BIOS支持multitrack 1 读写的概念.如果您读或写的曲目结束后,它将继续以下曲目.为了与最广泛的BIOS(旧的和新的)兼容,您可能希望考虑不要跨磁道边界进行读取或写入.

Modern BIOSes support the concept of multitrack1 reads and writes. If you read or write past the end of a track it will continue on with the following track. To be most compatible with the widest array of BIOSes (old and new) you may wish to consider not reading or writing across a track boundary.

驱动器几何结构为每磁道18个扇区/2个磁头/80个柱面(3.5英寸1.44MB软盘),CHS(0,0,18)之后的扇区为CHS(0,1,1).在CHS(0,1,18)处的下一个扇区是CHS(1,0,1).在某种程度上,它类似于HH:MM:SS.

With a drive geometry of 18 sector per track/2 heads/80 cylinders (3.5" 1.44MB floppy), the sector after CHS(0,0,18) is CHS(0,1,1). After you reach sector at CHS(0,1,18) the next one is CHS(1,0,1). In a way this is similar HH:MM:SS.

根据驱动器的几何形状,总共有2880(80 * 2 * 18)个扇区.如果将扇区编号为0到2879(含),则将它们称为逻辑块地址(LBA).

With your drive geometry there are a total of 2880(80*2*18) sectors. If you number the sectors from 0 to 2879 (inclusive) they are called the logical block addresses (LBA).

Int 13h/ah = 2 需要 CHS 值.您可以使用以下公式(或等效公式)将 LBA 转换为 CHS 值:

Int 13h/ah=2 takes CHS values. You can convert an LBA to CHS values with the formula (or equivalent):

C = (LBA ÷ SPT) ÷ HPC
H = (LBA ÷ SPT) mod HPC
S = (LBA mod SPT) + 1

HPC = Heads per cylinder (aka Number of Heads)
SPT = Sectors per Track, 
LBA = logical block address

"mod" is the modulo operator (to get the remainder of a division)

我在其他将LBA转换为CHS 部分中的Stackoverflow答案.如果您使用这些计算创建了表格,则编号将如下所示:

I have written more about the LBA to CHS calculation in this other Stackoverflow answer in the section Translation of LBA to CHS. If you created a table using these calculations, the numbering would look like:

LBA =    0:   CHS = ( 0,  0,  1)
LBA =    1:   CHS = ( 0,  0,  2)
LBA =    2:   CHS = ( 0,  0,  3)
LBA =    3:   CHS = ( 0,  0,  4)
LBA =    4:   CHS = ( 0,  0,  5)
LBA =    5:   CHS = ( 0,  0,  6)
LBA =    6:   CHS = ( 0,  0,  7)
LBA =    7:   CHS = ( 0,  0,  8)
LBA =    8:   CHS = ( 0,  0,  9)
LBA =    9:   CHS = ( 0,  0, 10)
LBA =   10:   CHS = ( 0,  0, 11)
LBA =   11:   CHS = ( 0,  0, 12)
LBA =   12:   CHS = ( 0,  0, 13)
LBA =   13:   CHS = ( 0,  0, 14)
LBA =   14:   CHS = ( 0,  0, 15)
LBA =   15:   CHS = ( 0,  0, 16)
LBA =   16:   CHS = ( 0,  0, 17)
LBA =   17:   CHS = ( 0,  0, 18)
LBA =   18:   CHS = ( 0,  1,  1)
LBA =   19:   CHS = ( 0,  1,  2)
LBA =   20:   CHS = ( 0,  1,  3)
LBA =   21:   CHS = ( 0,  1,  4)
LBA =   22:   CHS = ( 0,  1,  5)
LBA =   23:   CHS = ( 0,  1,  6)
LBA =   24:   CHS = ( 0,  1,  7)
LBA =   25:   CHS = ( 0,  1,  8)
LBA =   26:   CHS = ( 0,  1,  9)
LBA =   27:   CHS = ( 0,  1, 10)
LBA =   28:   CHS = ( 0,  1, 11)
LBA =   29:   CHS = ( 0,  1, 12)
LBA =   30:   CHS = ( 0,  1, 13)
LBA =   31:   CHS = ( 0,  1, 14)
LBA =   32:   CHS = ( 0,  1, 15)
LBA =   33:   CHS = ( 0,  1, 16)
LBA =   34:   CHS = ( 0,  1, 17)
LBA =   35:   CHS = ( 0,  1, 18)
LBA =   36:   CHS = ( 1,  0,  1)
LBA =   37:   CHS = ( 1,  0,  2)
LBA =   38:   CHS = ( 1,  0,  3)
LBA =   39:   CHS = ( 1,  0,  4)
LBA =   40:   CHS = ( 1,  0,  5)
LBA =   41:   CHS = ( 1,  0,  6)

... [snip] ...

LBA = 2859:   CHS = (79,  0, 16)
LBA = 2860:   CHS = (79,  0, 17)
LBA = 2861:   CHS = (79,  0, 18)
LBA = 2862:   CHS = (79,  1,  1)
LBA = 2863:   CHS = (79,  1,  2)
LBA = 2864:   CHS = (79,  1,  3)
LBA = 2865:   CHS = (79,  1,  4)
LBA = 2866:   CHS = (79,  1,  5)
LBA = 2867:   CHS = (79,  1,  6)
LBA = 2868:   CHS = (79,  1,  7)
LBA = 2869:   CHS = (79,  1,  8)
LBA = 2870:   CHS = (79,  1,  9)
LBA = 2871:   CHS = (79,  1, 10)
LBA = 2872:   CHS = (79,  1, 11)
LBA = 2873:   CHS = (79,  1, 12)
LBA = 2874:   CHS = (79,  1, 13)
LBA = 2875:   CHS = (79,  1, 14)
LBA = 2876:   CHS = (79,  1, 15)
LBA = 2877:   CHS = (79,  1, 16)
LBA = 2878:   CHS = (79,  1, 17)
LBA = 2879:   CHS = (79,  1, 18)


脚注:

1 多轨支持并不意味着磁盘访问可以跨越柱面.多磁道磁盘访问必须在同一圆柱上开始和结束.


Footnotes:

1Multitrack support doesn't mean a disk access can cross cylinders. A multitrack disk access must start and end on the same cylinder.

这篇关于读取比int 13h轨道更多的扇区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆