从软盘上的扇区读取


mov     ah, 0x02                ; read floppy sector function
    mov     al, 1                   ; read 1 sector
    mov     ch, 1                   ; we are reading the second sector past us, so its still on track 1
    mov     cl, 2                   ; sector to read (The second sector)
    mov     dh, 0                   ; head number
    mov     dl, 0                   ; drive number. Remember Drive 0 is floppy drive.
    int     0x13                    ; call BIOS - Read the sector

这是来自以下示例的代码: http://www.brokenthorn.com/Resources/OSDev5.html

我真的不明白这部分:

        mov     ch, 1                   ; we are reading the second sector past us, so its still on track 1
        mov     cl, 2                   ; sector to read (The second sector)

好的,所以第一个扇区是引导扇区(扇区 0)。因此,之后的扇区是扇区 1。

所以不应该吗?

mov ch, 0       ;First track
mov cl, 1       ;second sector on first track

扇区编号从 1 开始,而磁道编号从 0 开始。Int13 就是这样时髦。

http://stanislavs.org/helppc/int_13-2.html

相关内容

  • 没有找到相关文章