Bochs:INT13_diskette:ctrl尚未准备就绪

问题描述

我在boch读取软盘驱动器时遇到问题。读取几个扇区(1-10)后,bochs退出显示以下错误

[BIOS] int13_diskette:ctrl尚未就绪。

在执行中断13h时发生错误,但是给该中断的参数似乎很好:

AX: 0x0201 
BX: 0x0900
CX: 0x0004
DX: 0x0100
ES: 0x0000

这是软盘读取部分:

; input: 
;   dl -> device
;   es:bx -> Buffer to read to
;   ax -> Start sector
;   cx -> Number of sectors
;
; output:
;   carry -> On error

fat_read_device:
    mov di,FAT_READ_RETRIES ; retries for error -> 5

    .try_load:
        push ax
        push bx
        push cx

        push bx
        mov bl,dl ; remember device
        mov dx,ax

        int 0xe2 ; Convert lba to chs -> Writing to cl,ch and dh

        mov dl,bl
        pop bx

        mov ah,0x02 ; Read device es:bx
        mov al,0x01 ; Number of sectors to read
        ;xchg bx,bx
        int 0x13
        jnc .done ; test if succeeded

        xor ax,ax ; Reset disk
        int 0x13
        dec di ; decrement error counter
        pop cx
        pop bx
        pop ax
        jnz .try_load ; attempt to read again

        stc
        ret

    .done:
        int 0xcf ; Feedback disk operation -> Print a "."

        pop cx
        pop bx
        pop ax
        add bx,word [bpbBytesPerSector] ; next sector
        inc ax ; read next sector
        loop fat_read_device ; repeat until cx sectors are read
        ret

我还将使用以下代码将PIT 0(可编程间隔计时器)重新编程为1000hz,而不是18.2hz:

TIMER_DIVISOR EQU 1193

timer_init:
    cli

    mov al,36h ; PIT channel 0
    out 43h,al ; select channel

    mov ax,TIMER_DIVISOR
    out 40h,al ;send low byte
    mov al,ah
    out 40h,al ;send high byte

    sti

    mov word [cs:timer_tick_count],0

    ret

我只在调试模式下使用bochs会收到此错误。如果我以非调试模式启动系统,则可以正常工作。

有人有同样的问题吗?有人知道我在做什么错吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)