使用BIOS I / O无法读取72以上的软盘扇区

时间:2019-11-14 22:31:23

标签: assembly nasm x86-16 bios

我正在尝试编写一个基本的OS,以了解基本知识。我遇到的问题是扇区数大于72时从软盘读取。

当前工作代码:

KERNEL_SECTORS equ 72

mov    ax,    0x1000            ; to avoid DMA access across 64k boundary
mov    es,    ax
mov    ah,    02h               ; parameters for calling int13 (ReadSectors) - read the Kernel
mov    al,    KERNEL_SECTORS    ; read KERNEL_SECTORS sectors (hardcoded space for Kernel)
mov    ch,    00h     
mov    cl,    0Bh               ; starting from sector 11 - skip first 10 sectors (the MBR + SSL)
mov    dh,    00h     
mov    bx,    0                 ; memory from 0x7E00 - 0x9200 used by SLL;  0x9200 - 0x9FFFF is unused          
int    13h   

如果KERNEL_SECTORS73,则AH为1,表示bad command passed to driver。根据{{​​3}},我应该可以转到128。知道我做错了吗?

0 个答案:

没有答案