86Box icon indicating copy to clipboard operation
86Box copied to clipboard

CD Drives Not Working Properly as of 6145

Open Mal752 opened this issue 2 years ago • 44 comments

What happened?

"Inserting" a new CD image gives General Drive Read Error. Typing (R)etry a few times finally able to read the drive.

After changing the CD, 86Box still shows the old CD files loaded. Does not refresh.

Configuration file

[Trident TVGA 8900D]
memory = 1024

[Logitech Serial Mouse]
port = 0
buttons = 3
revision = 3
rts_toggle = 1

[Logitech/Microsoft Bus Mouse]
base = 023C
irq = 3
hz = 45
buttons = 3

[System MIDI]
midi = 1

[Roland MPU-IPC-T]
base = 0330
irq = 2
receive_input = 1

[Adaptec AHA-154xCF #1]
base = 0334
irq = 11
dma = 6
bios_addr = 00000
fdc_addr = 0000

[Everex EV-159 RAM 3000 Deluxe #1]
size = 2048
start = 0
length = 0
width = 0
speed = 0
ems = 1
base = 0258
base2 = 0268

[General]
vid_renderer = qt_opengl
force_43 = 1
video_fullscreen_first = 0
confirm_reset = 0
confirm_exit = 0
iconset = legacy
status_icons_fullscreen = 1
sound_gain = 5
host_cpu = Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
emu_build_num = 6145
uuid = 26afe695-0a8e-5918-8600-6203d734614f

[Machine]
machine = cmdsl386sx25
cpu_family = i386sx
cpu_speed = 25000000
cpu_multi = 1
fpu_type = 387
cpu_use_dynarec = 0
time_sync = local
fpu_softfloat = 0
mem_size = 4096

[Video]
gfxcard = vga

[Input devices]
mouse_type = ltserial
joystick_type = 2axis_2button
joystick_0_nr = 1
joystick_0_axis_0 = 0
joystick_0_axis_1 = 1
joystick_0_button_0 = 0
joystick_0_button_1 = 1
joystick_1_nr = 0

[Sound]
sndcard = sbprov2
midi_device = system_midi
mpu401_standalone = 1
fm_driver = nuked

[Ports (COM & LPT)]
lpt1_device = lpt_dac

[Storage controllers]
hdc = ide_isa
cassette_mode = load

[Floppy and CD-ROM drives]
fdd_01_type = 525_2hd
fdd_02_type = 35_2hd
cdrom_01_parameters = 1, atapi
cdrom_01_ide_channel = 0:1
fdd_01_image_history_01 = /home/**user**/FILES/DOSFILES/Dos Games Archives/Disk Images/Where in the World is Carmen Sandiego (5.25 1.2MB)/Where in the World is Carmen Sandiego_ (5.25 1.2MB)Disk 5.img
fdd_01_image_history_02 = /home/**user**/FILES/DOSFILES/Dos Games Archives/Disk Images/Where in the World is Carmen Sandiego (5.25 1.2MB)/Where in the World is Carmen Sandiego_ (5.25 1.2MB)Disk 4.img
fdd_01_image_history_03 = /home/**user**/FILES/DOSFILES/Dos Games Archives/Disk Images/Where in the World is Carmen Sandiego (5.25 1.2MB)/Where in the World is Carmen Sandiego_ (5.25 1.2MB)Disk 3.img
fdd_01_image_history_04 = /home/**user**/FILES/DOSFILES/Dos Games Archives/Disk Images/Where in the World is Carmen Sandiego (5.25 1.2MB)/Where in the World is Carmen Sandiego_ (5.25 1.2MB)Disk 2.img
cdrom_01_type = 86BOX_CD-ROM_1.00
cdrom_01_image_path = /home/**user**/FILES/CDROMS/Mario Teaches Typing (USA).cue

[Other peripherals]
isamem0_type = ev165a

[Hard disks]
hdd_01_parameters = 17, 15, 900, 0, ide
hdd_01_fn = /run/media/**user**/FILES/EMULATION/86Box/hdd/386SX_112MB.img
hdd_01_speed = 1992_3600rpm
hdd_01_ide_channel = 0:0

[Mouse Systems Serial Mouse]
port = 0
buttons = 3
rts_toggle = 1

[rts_toggle]
status_icons_fullscreen = 1

[status_icons_fullscreen]
status_icons_fullscreen = 1

[status_icons_fullscreen]
status_icons_fullscreen = 1

[Tertiary IDE Controller]
irq = 11

[Sound Blaster Pro v1 #1]
base = 0220
irq = 7
dma = 1
opl = 1
receive_input = 1

[Everex Magi Magic EV-165A #1]
size = 2048
start = 0
length = 0
ems = 1
base = 0258

Operating system

Debian

CPU

Core i7 9750H

86Box version

6145

Build architecture

Linux - x64 (64-bit)

Build type

  • [ ] New recompiler
  • [ ] Debug build

Download source

Official website (Jenkins, GitHub)

Additional context

No response

Mal752 avatar Sep 07 '24 08:09 Mal752

Can't reproduce this. It does show the CDR101 message, yes, but after one Retry it reads the disc and shows the correct files.

You might have to upload the full machine files (cfg, nvr, hdd).

eddmanx avatar Sep 07 '24 11:09 eddmanx

This is exactly what's being reported. And I'd like know based on what this is considered improper behavior, given that Windows XP explicitly relies on a medium change being preceded by a not ready state, which also makes perfect sense - a medium change by definition means one medium is being removed and another inserted.

OBattler avatar Sep 08 '24 05:09 OBattler

After changing the CD, 86Box still shows the old CD files loaded. Does not refresh.

Given that we explicitly send the medium changed unit attention in addition to the not ready state, there must be something strange going on.

OBattler avatar Sep 08 '24 05:09 OBattler

Also, which DOS CD-ROM driver exactly is being used?

OBattler avatar Sep 08 '24 05:09 OBattler

Closing this because I can't try to reproduce this without knowing which CD-ROM driver is being used.

OBattler avatar Sep 09 '24 22:09 OBattler

Sorry, I was away for sometime.

The CD-ROM driver is QCDROM.SYS, which is the only driver I have been using since the inception of 86Box, and also in my real DOS machines.

The problem is I only noticed in the version I input above. Before this I didn't notice it.

The problem seems to be somewhere during the evolution and I am unable to pinpoint in which build this problem cropped up.

Mal752 avatar Sep 10 '24 03:09 Mal752

I cannot find the re-open issue button. If OBattler have read this, please re-open this issue. Thank you.

Mal752 avatar Sep 10 '24 03:09 Mal752

Can you upload this QCDROM.SYS somewhere?

OBattler avatar Sep 11 '24 00:09 OBattler

Can you upload this QCDROM.SYS somewhere?

It's downloaded from here:

https://www.hiren.info/downloads/dos-files

I don't think it's a driver error, since I have been using the same in previous builds without problems.

I will try using a clean boot floppy and check again.

Mal752 avatar Sep 11 '24 03:09 Mal752

Tried with a clean boot floppy. Same problem.

Thing is it works, but shows General Read Error on first access after changing a disc, for eg when typing DIR. After typing (R)etry, it loads normally. This behaviour was not noticed before.

Screenshot_2024-09-11_11-12-13 Screenshot_2024-09-11_11-13-23 Screenshot_2024-09-11_11-17-55 Screenshot_2024-09-11_11-20-17

Mal752 avatar Sep 11 '24 03:09 Mal752

Tried other machine configuration. Also the same.

Mal752 avatar Sep 11 '24 03:09 Mal752

Okay, I tried using an older build - 6047. The problem doesn't exist here using the above machine configurations. Changing discs and typing DIR doesn't produce errors and works normally.

Edit: Went up to Build 6080. It doesn't produce any General Read Error.

But I still need to Eject the CDROM and re-insert another CD to see the changes. Otherwise it lists only the previous CD contents.

IINM, using older builds, I can directly choose another CD image and the system recognizes automatically. DIdn't need to eject the CD before "inserting" another one.

Mal752 avatar Sep 11 '24 03:09 Mal752

The problem is that in those older builds, it was Windows XP which had that problem.

OBattler avatar Sep 11 '24 03:09 OBattler

The driver is strange - it sends the TEST UNIT READY command and then proceeds to send READ TOC even if TEST UNIT READY returned error. That's definitely not correct behavior.

OBattler avatar Sep 18 '24 02:09 OBattler

I tried using the latest build (6162), but the problem persists. After "changing" a CD, it STILL gives a general drive read errror. Pressing (R)etry loads it properly, though. By right, once changed the CD, it should be reflected immediately on typing DIR...

shrugs

Screenshot_2024-09-18_16-28-14

Mal752 avatar Sep 18 '24 08:09 Mal752

By right, once changed the CD, it should be reflected immediately on typing DIR...

Are you sure? Because a real drive would also go through a not ready phase before transitioning to medium has changed - I probed my real drive back when I still had that Pentium Dual-Core, and that's how it behaved. This isn't a floppy drive where the controller immediately treats the drive as ready, with the updated change line bit on port 3F7.

OBattler avatar Nov 30 '24 04:11 OBattler

By right, once changed the CD, it should be reflected immediately on typing DIR...

Are you sure? Because a real drive would also go through a not ready phase before transitioning to medium has changed - I probed my real drive back when I still had that Pentium Dual-Core, and that's how it behaved. This isn't a floppy drive where the controller immediately treats the drive as ready, with the updated change line bit on port 3F7.

Sorry for the unclear words. I meant to say that once the CD is changed, it should display the new contents when seeking, like using DIR command. Problem is it doesn't even after waiting much longer.

Yes, the results of seeing the changes is immediate when it comes to using the iso images in emulators (contrary to using actual CD-ROM drive).

But anyway, now I have changed the driver to vide-cdd.sys and mscdex (instead of qcdrom and shsucdx) and now it is working as it should. And the changes are reflected immediately. (Now using build 6300.)

So I think the problem lies with shsucdx.exe or qcdrom.sys running in 86Box.

Mal752 avatar Nov 30 '24 05:11 Mal752

But anyway, now I have changed the driver to vide-cdd.sys and mscdex (instead of qcdrom and shsucdx) and now it is working as it should. And the changes are reflected immediately. (Now using build 6300.)

So I think the problem lies with shsucdx.exe or qcdrom.sys running in 86Box.

This problem also happens with a default FreeDOS installation, which uses shsucdx.exe. I tried substituting vide-cdd.sys as the driver but the problem remains. So I believe it's shsucdx.exe.

It appears the problem was introduced with d5b0fd1, because if I revert just the file scsi_cdrom.c to that version and rebuild 86Box, the problem remains. But if I revert it to the version before, it's fine. This comment, explaining what that change does, ...

    /* Transition, pretend we're not ready for one check so that
       Windows XP can recognize a medium change. */

... seems to give a hint to the crux of the issue. By pretending that the drive isn't ready on the first access after a medium change, we get that "not ready" error in DOS. The user has to respond to the prompt (such as by pressing "R" to retry) so that the drive is then accessed a second time.

In FreeDOS, the error looks like this:

image

and it occurs the first time the CD-ROM drive is accessed after a CD change. There seems to be no way to prevent the message from appearing upon the first access. In this particular screenshot, you can see it's when the volume label of the drive is being read on a "dir" command.

I'm temporarily using a custom 86Box build with the old scsi_cdrom.c file. Unfortunately, since I only run DOS and Windows 9x systems, and not XP, I wouldn't want to try to submitting a fix for the problem myself, as any fix I made could easily re-introduce the problem (#4766) that d5b0fd1 was trying to solve.

RobertSundling avatar Dec 08 '24 16:12 RobertSundling

A real drive would cause this as well, I know because I probed mine years ago, and there would not be a medium change state without a prececing not ready state, also because you had to physically open the tray and then close it.

OBattler avatar Dec 08 '24 20:12 OBattler

I just confirmed that this does not happen on a physical machine. Here's what I did, on a Gateway Pentium 233 MHz machine:

  1. Made a minimal FreeDOS boot floppy that uses vide-cdd.sys and shsucdx.com to map the CD-ROM as drive Z.
  2. Booted a machine with that.
  3. Inserted a Windows 95 install CD-ROM, closed the CD tray, waited 15 seconds.
  4. Changed to that drive (Z:) and did a DIR on that CD-ROM.
  5. Ejected the CD-ROM.
  6. Inserted a Windows 98 install CD-ROM, closed the CD-tray, waited 15 seconds.
  7. Did a DIR on that CD-ROM.

The result was no "(A)bort, (R)etry, (F)ail" message. Instead, it displayed "Volume in drive Z" then paused for a moment as it spun up and read the CD, then displayed the volume name ("is WINDOWS 98"), and listed the directory.

no-arf

However, when booting 86Box 4.2.1 or 4.3.0 (f94a30d) from the same floppy, then doing the exact same process (loading one CD image, waiting, doing a DIR, ejecting the CD image, loading another CD image, waiting, and doing a DIR), I do get the "(A)bort, (R)etry, (F)ail" message. If the machine is booted without a CD-ROM image mounted, I get it twice (on both "DIR" commands). So something is definitely different compared to a real machine. I can wait any length of time after "inserting" the CD (I've tried up to a minute) and I still get the message.

I'm happy to provide the boot floppy image if that's useful.

RobertSundling avatar Dec 08 '24 21:12 RobertSundling