如何使用 BIOS 中断读取第二张软盘
How to read the second floppy with BIOS interrupt
我需要制作一个可以 write/read 软盘 B 的迷你 OS(从软盘 A 启动)。
环境是vmware工作站。软盘是 A.img 和 B.img。
在A.img中,我设置了一个MBR程序和一个func.bin。我需要在 func.bin 中实现上述功能。以下是其中的代码片段。
... ; set es:bx
mov ah, 0x03 ; read sectors
mov al, 0x01 ; 1 sector
mov ch, 0x00 ; cylinder
mov cl, 0x03 ; sector
mov dh, 0x00 ; head
mov dl, 0x01 ; B.img
int 0x13
然后我得到了return代码:ah = 0x01。这意味着 "illegal command" 但我不知道是什么原因造成的。
我试过把mov dl, 0x01
改成mov dl, 0x00
(A.img)或者mov dl, 0x80
(硬盘),都成功了。所以想知道怎么解决。
更新我的问题:
B.img 已设置为 "be auto-connected when vm runs"。
A 的大小:31.5KB
B 的大小:1.44MB
问题已自行解决
不知道虚拟机的配置造成的
By default, only one floppy drive is enabled in the virtual machine's BIOS. If you are adding a second floppy drive to the virtual machine, click inside the virtual machine window and press F2 as the virtual machine boots to enter the BIOS setup utility. On the main screen, choose Legacy Diskette B: and use the plus (+) and minus (-) keys on the numerical keypad to select the type of floppy drive you want to use. Then press F10 to save your changes and close the BIOS setup utility.
https://www.vmware.com/support/ws5/doc/ws_disk_add_floppy.html
我需要制作一个可以 write/read 软盘 B 的迷你 OS(从软盘 A 启动)。
环境是vmware工作站。软盘是 A.img 和 B.img。
在A.img中,我设置了一个MBR程序和一个func.bin。我需要在 func.bin 中实现上述功能。以下是其中的代码片段。
... ; set es:bx
mov ah, 0x03 ; read sectors
mov al, 0x01 ; 1 sector
mov ch, 0x00 ; cylinder
mov cl, 0x03 ; sector
mov dh, 0x00 ; head
mov dl, 0x01 ; B.img
int 0x13
然后我得到了return代码:ah = 0x01。这意味着 "illegal command" 但我不知道是什么原因造成的。
我试过把mov dl, 0x01
改成mov dl, 0x00
(A.img)或者mov dl, 0x80
(硬盘),都成功了。所以想知道怎么解决。
更新我的问题:
B.img 已设置为 "be auto-connected when vm runs"。
A 的大小:31.5KB B 的大小:1.44MB
问题已自行解决
不知道虚拟机的配置造成的
By default, only one floppy drive is enabled in the virtual machine's BIOS. If you are adding a second floppy drive to the virtual machine, click inside the virtual machine window and press F2 as the virtual machine boots to enter the BIOS setup utility. On the main screen, choose Legacy Diskette B: and use the plus (+) and minus (-) keys on the numerical keypad to select the type of floppy drive you want to use. Then press F10 to save your changes and close the BIOS setup utility.
https://www.vmware.com/support/ws5/doc/ws_disk_add_floppy.html