9

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
10
  • What happens if you boot QEMU with only qemu-system-i386 -cdrom cdrom.iso? Commented Mar 17, 2019 at 22:32
  • 3
    The emulated FAT formatted floppy image that MS-DOS booted off of will be drive A: Drive D: will be the ISO 9660 file system on the CD-ROM, if any. If there's no ISO 9660 file system on the CD-ROM image then you'll get errors like the one you're receiving.
    – user722
    Commented Mar 17, 2019 at 22:32
  • 1
    @StephenKitt if I do this, then MSCDEX assigns C: to the CD-ROM drive, but I still get the error. Commented Mar 17, 2019 at 22:47
  • 1
    Thinking if it, is there a reason to invoke with -drive instead of -cdrom <filename> maybe the format=raw parameter isn't really helpful? It's your own image anyway, isn't it?
    – Raffzahn
    Commented Mar 17, 2019 at 23:34
  • 2
    +1 Dos emulators are within the scope of this forum. I have the same problem but did not think to ask this forum. I am looking forward to the answer.
    – jwzumwalt
    Commented Mar 21, 2019 at 4:32

1 Answer 1

8

There's reason to believe that this is a qemu bug (actually a problem caused by the configuration of SeaBIOS in qemu 3.0 and 3.1). If this is the case, the CD driver will work fine in qemu 2.12.1 or older (SeaBIOS will be 1.11.1 or older), or qemu 4.0.0 or newer (SeaBIOS will be 1.12.1 or newer). A qemu displaying a SeaBIOS version of 1.11.2 or 1.12.0 will not work.

2
  • 1
    You are correct - trying again with qemu 4.1.0 I got much better results. Thanks! Commented Nov 13, 2019 at 21:11
  • as of today debian 10 does provide qemu 3.1.0 which is then buggy. Commented Jul 18, 2021 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .