中断 №13 (ah=48) - 不工作

发布于 2024-09-05 12:29:11 字数 427 浏览 5 评论 0原文

我想获取我的硬盘的参数。使用此处描述的技术。

  • 这是显示软盘正常参数的代码:

    <前><代码>mov dl,00h 移动啊,08h 13小时内
  • 这是显示无效硬盘参数的代码(可能是,我的硬盘空间很大(LBA)):

    <前><代码>mov dl,80h 移动啊,08h 13小时内
  • 我写了这段代码:

    <前><代码>mov dl,80h 移动啊,48小时 13小时内

该代码给出 cf = 1(错误)。我该如何修复它?

I want fetch the parameters of my hard disk. Using the technique described here.

  • This is code showing normal parameters of floppy disk:

    mov dl,00h
    mov ah,08h
    int 13h
    
  • This is code, showing not valid parameters of hard disk (may be, my hard disk space is big (LBA)):

    mov dl,80h 
    mov ah,08h 
    int 13h
    
  • And I've written this code:

    mov dl,80h
    mov ah,48h
    int 13h
    

The code is giving cf = 1(error). How do I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

桃扇骨 2024-09-12 12:29:11

出现错误时,AH 应包含错误代码。那是什么?

Ralf Brown 的(优秀)中断列表详细介绍了它们:

 00h    successful completion
 01h    invalid function in AH or invalid parameter
 02h    address mark not found
 03h    disk write-protected
 04h    sector not found/read error
 05h    reset failed (hard disk)
 05h    data did not verify correctly (TI Professional PC)
 06h    disk changed (floppy)
 07h    drive parameter activity failed (hard disk)
 08h    DMA overrun
 09h    data boundary error (attempted DMA across 64K boundary or >80h sectors)
 0Ah    bad sector detected (hard disk)
 0Bh    bad track detected (hard disk)
 0Ch    unsupported track or invalid media
 0Dh    invalid number of sectors on format (PS/2 hard disk)
 0Eh    control data address mark detected (hard disk)
 0Fh    DMA arbitration level out of range (hard disk)
 10h    uncorrectable CRC or ECC error on read
 11h    data ECC corrected (hard disk)
 20h    controller failure
 31h    no media in drive (IBM/MS INT 13 extensions)
 32h    incorrect drive type stored in CMOS (Compaq)
 40h    seek failed
 80h    timeout (not ready)
 AAh    drive not ready (hard disk)
 B0h    volume not locked in drive (INT 13 extensions)
 B1h    volume locked in drive (INT 13 extensions)
 B2h    volume not removable (INT 13 extensions)
 B3h    volume in use (INT 13 extensions)
 B4h    lock count exceeded (INT 13 extensions)
 B5h    valid eject request failed (INT 13 extensions)
 B6h    volume present but read protected (INT 13 extensions)
 BBh    undefined error (hard disk)
 CCh    write fault (hard disk)
 E0h    status register error (hard disk)
 FFh    sense operation failed (hard disk)

您也不知道指定您的 DS:SI 设置为接收信息。是否已正确设置?


从你的评论来看:

01h AH 中的函数无效或参数无效。

检查 INT13 扩展是否适用于您的 BIOS。 AH = 41h,DL = 80h(第一个驱动器),BX = 55AAh,INT13,如果存在扩展,则返回时进位将被清除。

On error, AH should contain the error code. What was it?

Ralf Brown's (excellent) interrupt list details them:

 00h    successful completion
 01h    invalid function in AH or invalid parameter
 02h    address mark not found
 03h    disk write-protected
 04h    sector not found/read error
 05h    reset failed (hard disk)
 05h    data did not verify correctly (TI Professional PC)
 06h    disk changed (floppy)
 07h    drive parameter activity failed (hard disk)
 08h    DMA overrun
 09h    data boundary error (attempted DMA across 64K boundary or >80h sectors)
 0Ah    bad sector detected (hard disk)
 0Bh    bad track detected (hard disk)
 0Ch    unsupported track or invalid media
 0Dh    invalid number of sectors on format (PS/2 hard disk)
 0Eh    control data address mark detected (hard disk)
 0Fh    DMA arbitration level out of range (hard disk)
 10h    uncorrectable CRC or ECC error on read
 11h    data ECC corrected (hard disk)
 20h    controller failure
 31h    no media in drive (IBM/MS INT 13 extensions)
 32h    incorrect drive type stored in CMOS (Compaq)
 40h    seek failed
 80h    timeout (not ready)
 AAh    drive not ready (hard disk)
 B0h    volume not locked in drive (INT 13 extensions)
 B1h    volume locked in drive (INT 13 extensions)
 B2h    volume not removable (INT 13 extensions)
 B3h    volume in use (INT 13 extensions)
 B4h    lock count exceeded (INT 13 extensions)
 B5h    valid eject request failed (INT 13 extensions)
 B6h    volume present but read protected (INT 13 extensions)
 BBh    undefined error (hard disk)
 CCh    write fault (hard disk)
 E0h    status register error (hard disk)
 FFh    sense operation failed (hard disk)

You also don't specify what your DS:SI is set to to recive the information. Has that been set correctly?


From your comment:

01h invalid function in AH or invalid parameter.

Check to see if the INT13 extensions are available for your BIOS. AH = 41h, DL = 80h (first drive), BX = 55AAh, INT13, carry will be clear on return if extensions are there.

那片花海 2024-09-12 12:29:11

有些计算机无法正确保存 ds 和 es 寄存器,因此应在从 int-13 function-48 返回时恢复这些寄存器,并根据版本检查缓冲区大小为 1A 1E 或 42。

Some computers do not save your ds and es registers properly so these should be restored upon returning from int-13 function-48 also check the buffer size as 1A 1E or 42 depending on version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文