用汇编语言弹出 CD/光驱
这再简单不过了,但并没有改变。
我有一个简单的代码,我用它来查看光驱是否会弹出
该代码采用汇编语言,intel nasm 语法。
[BITS 16]
[ORG 0X07C00]
STI
Eject:
mov ah, 46h
mov al, 00h
mov dl, 00h
int 13h
endprogram:
times 510-($-$$) db 0
db 0x55
db 0xAA
我可以简单地增加驱动器编号,但如果驱动器为 0,这是否不能正常工作?可能是驱动器从十进制 128 左右开始,
谢谢,
This couldn't have been simpler, but isn't budging.
I have a simple code that I'm using to see if the optical drive will eject
The code is in assembly language, intel nasm syntax.
[BITS 16]
[ORG 0X07C00]
STI
Eject:
mov ah, 46h
mov al, 00h
mov dl, 00h
int 13h
endprogram:
times 510-($-$) db 0
db 0x55
db 0xAA
I could simply increase the drive number, but shouldn't this work correctly if the drive was 0? may be the drive start somewhere around 128 decimal
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
似乎没有任何标准化 BIOS 中断可以从驱动器中弹出 CD。因此,基本上,如果您想要此功能,您需要做很多工作。您需要编写 ATA 驱动程序并发送原始命令以强制 CD 驱动器弹出。
但这需要做的事情比听起来要多得多。您必须检测 ATA 驱动器,将其过滤到 CD 驱动器,然后发送命令。
您需要查看 OSDev 的 ATA 文章 及其 ATAPI 文章
There does not appear to be any standardized BIOS interrupt to eject a CD from a drive. So, basically, you have a lot of work to do if you want this feature. You'll need to write an ATA driver and send out the raw commands to force the CD drive to eject.
This entails a lot more than it sounds though. You have to detect the ATA drives, filter them out to the CD drive, and then send the command.
You'll need to check out OSDev's ATA article and their ATAPI article
尝试使用函数 48h 获取驱动器参数。看看你会得到什么。可能是不同的驱动器号。或者,对于您的特定 BIOS 中的驱动器类型,此扩展功能可能不可用/不支持。
Try function 48h to get drive parameters. See what you get. Might well be a different drive number. Or, this extended function may not be available/supported for your drive types in your particular BIOS.
您可以尝试重新上线时发布的代码:
或者更简单的 FASM 版本(这曾经是内置示例之一)。
You can try this code that was posted a while back online:
Or the simpler FASM version (This used to be one of the built in examples ).