I am using qemu-system-i386
on a Windows 10 PC to emulate an MS-DOS system. I have installed MS-DOS 6.22 successfully from disk images from original Microsoft media.
I am starting QEMU using this command:
c:\program files\qemu\qemu-system-i386.exe -hda msdos.disk -m 64 -L . -soundhw sb16,adlib,pcspk -k en-gb -vga cirrus -nic user,model=pcnet -boot order=d -drive file=.\cdrom.iso,media=cdrom,index=2,if=ide,format=raw
cdrom.iso
is an image created by mkisofs (running under WSL) using this command:
mkisofs -pad -b disks/msdos/msd622_b.img -R -J -o cdrom.iso cdrom
This includes an El Torito boot floppy of MS-DOS 6.22. When running QEMU with the above command, it successfully boots from CD-ROM into MS-DOS. XDVD2.SYS
detects the CD-ROM correctly, identifying it as a QEMU virtual DVD-ROM. MSCDEX
runs correctly and assigns the CD drive a drive letter, as illustrated:
SeaBIOS (version rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org)
iPXE (http://ipxe.org) 00:03.0 C980 PCI2.10 PnP PMM+03F914B0+03EF14B0 C980
Booting from DVD/CD...
Starting MS-DOS...
XDVD2, 1-05-2016. CD/DVD name is DVDROM.
IDE0 Controller at I-O address C020h, Chip I.D. 80867010h
CD0: IDE0 Secondary-master, QEMU DVD-ROM, ATA-100.
MODE prepare code page function completed
MODE select code page function completed
MSCDEX Version 2.23
Copyright (C) Microsoft Corp. 1986-1993. All rights reserved.
Drive D: = Driver DVDROM unit 0
A:\>_
However, whenever I try to access the CD - for example, with dir d:\
, I get this error:
CDR101: Not ready reading drive D
Abort, Retry, Fail?
The QEMU virtual CD-ROM and the ISO file are both clearly valid, otherwise QEMU would not have been able to boot the El Torito image. I have repeated the test using an old Windows 95 setup boot disk that uses a different CD driver and it too fails in the same way, so this appears to be something specific about MSCDEX inside QEMU. I have also tried a different ISO image in case there is a problem with my ISO image, with no difference in results.
How can I access the QEMU virtual CD-ROM from MS-DOS?
For reference, here are the boot disk's startup files.
CONFIG.SYS
DOS=HIGH,UMB
BUFFERS=11,0
FILES=60
LASTDRIVE=H
FCBS=1,0
STACKS=0,0
DEVICE=A:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=A:\DOS\EMM386.EXE X=B800-C7FF I=B000-B7FF A=64 H=128 D=256 ON
DEVICEHIGH=A:\DOS\SETVER.EXE
COUNTRY=044,,A:\DOS\COUNTRY.SYS
DEVICEHIGH=A:\DOS\DISPLAY.SYS CON=(EGA,,1)
DEVICEHIGH=A:\EXTRAS\XDVD2.SYS /D:DVDROM
SET TEMP=A:\TEMP
SET TMP=A:\TEMP
AUTOEXEC.BAT
@ECHO OFF
A:\DOS\SMARTDRV.EXE /X
PROMPT $p$g
PATH A:\DOS
A:\DOS\MODE.COM CON CODEPAGE PREPARE=((437) A:\DOS\EGA.CPI)
A:\DOS\MODE.COM CON CODEPAGE SELECT=437
LH A:\DOS\KEYB.COM UK,,A:\DOS\KEYBOARD.SYS
LH A:\DOS\DOSKEY.COM /INSERT
LH A:\DOS\MSCDEX.EXE /D:DVDROM /M:20 /E
qemu-system-i386 -cdrom cdrom.iso
?-drive
instead of-cdrom <filename>
maybe theformat=raw
parameter isn't really helpful? It's your own image anyway, isn't it?