UniPCemu's Dosbox-based CD-ROM swap issues?

Emulation of old PCs, PC hardware, or PC peripherals.

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 16:44

Just curious, what driver are you using? In my case it's the VIDE-CDD.SYS driver combined with MS-DOS 6.22 MSCDEX.EXE. Or is a different driver better to test(e.g. OAKCDROM.SYS)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 17:32

Just tried OAKCDROM.SYS again. It now can't seem to find the CD-ROM drives anymore? I see it's apparently waiting for something, but no ATAPI command is executed at all anymore?

Current code is always at: https://bitbucket.org/superfury/unipcem ... ware/ide.c

Edit: I see an ATAPI reset command being executed(ATA command 0x08)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 17:59

Hmmmm.... I do see it writing the drive head a bunch of times after the DEVICE RESET command? And then checking the status register, which only seems to indicate busy?

During the device reset, it's reporting a status register value of 0x80, so not ready(because it's resetting) and busy? It never seems to become ready to process a command, before executing a new drive select by writing the drive/head register? Or is it not supposed to become more busy(resetting the timer for the drive select timeout) when it doesn't toggle the drive select line?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 18:46

Just implemented an IRQ to trigger when an ATAPI device receives command 0x08(DEVICE RESET command for ATAPI devices). I now see it properly executing a 0xEC IDENTIFY DEVICE command(which aborts of course), then a 0xA1 IDENTIFY PACKET DEVICE command :D

And after that, a PACKET command :D

Edit: Huh? Then a read sub-channel command?

Edit: After that one errors out, though, OAKCDROM does seem to execute a REQUEST SENSE command?
Edit: Then it executes command 0x00 again, which of course gives a not present CD-ROM error sense(code 0x20 in the error register).
Edit: Then another REQUEST SENSE ( :D )...

Then another read sub-channel, which of course still fails...
Edit: Then mode sense. And it then continues :D

Edit: OK. Now to change the inserted disk...
Edit: OK. The dir starts...
It uses command 0x00, then REQUEST SENSE for the new media?
Then Read TOC... It gives a MEDIUM NOT PRESENT(then a drive not ready immediately happens in the MS-DOS prompt)... That's a REQUEST SENSE...
Then a CD-INSERTED EVENT happens(from the disk change)!
Eventually(read TOC still waiting), it gives a 0x02,0x28,0x00 error(Medium is ready (has changed)).
Then a REQUEST SENSE.
And then another READ TOC, which succeeds :D
Then a Read Sectors, with LBA 0x10(16) :D

Edit: More sectors follow, and it fully sees the new disk having been inserted, with the new directory list :D

But that only seems to happen with the OAKCDROM driver? The VIDE-CDD.SYS driver seems to utterly fail at that?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 19:31

So the problem is with the VIDE-CDD.SYS driver itself, not with the hardware? What does VIDE-CDD.SYS do with your emulator when you switch a disk?

Also, I assume those odd read subchannel commands are somehow for verifying it's a data disk instead of a CD-ROM disk?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-12 @ 22:33

Just tried Windows 3.11 with OAKCDROM and MSCDEX combination. Inserting various disks, both cue and iso seems to work like a charm.

So since there's no issues with OAKCDROM, perhaps there's error issues with VIDE-CDD itself? Are any such problems known with the driver?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby Stenzek » 2019-7-13 @ 01:48

VIDE-CDD seems to work fine for me after a disc swap. Two ATA channels, CD-ROM is on primary slave. FWIW it's the same on the secondary channel.

Trace:
Code: Select all
[  235.7322] T/i8259_PIC: PIC 1 mask 0x8F
[  235.7324] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7337] T/HW::HDC: ATA read status register 0/1 <- 0x50
[  235.7339] T/HW::HDC: ATA write command block features 0/1 0x00
[  235.7340] T/HW::HDC: ATA write command block 0/1 cylinder low 0x00
[  235.7342] T/HW::HDC: ATA write command block 0/1 cylinder high 0x00
[  235.7343] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7345] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[  235.7346] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[  235.7348] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[  235.7350] T/HW::HDC: ATA read status register 0/1 <- 0x58
[  235.7351] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[  235.7353] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[  235.7354] T/HW::CDROM: CDROM executing command 0x00 length 12
[  235.7356] D/HW::CDROM: CDROM test unit ready
[  235.7357] B/HW::CDROM: Raising CDROM interrupt
[  235.7359] T/HW::ATADevice: Raising ATA interrupt line 0/1
[  235.7360] T/CPU_X86::CPU: IRQ line signaled
[  235.7361] T/CPU_X86::CPU: IRQ line signaled
[  235.7363] T/CPU_X86::CPU: Hardware interrupt 118
[  235.7365] T/HW::HDC: ATA read status register 0/1 <- 0x41
[  235.7366] T/i8259_PIC: EOI interrupt 6
[  235.7368] T/i8259_PIC: EOI interrupt 2
[  235.7369] T/HW::HDC: ATA read status register 0/1 <- 0x41
[  235.7371] T/HW::HDC: ATA read sector count 0/1 <- 0x03
[  235.7372] T/HW::HDC: ATA read alt status register 0/1 <- 0x41
[  235.7374] T/HW::HDC: ATA read status register 0/1 <- 0x41
[  235.7375] T/HW::HDC: ATA read error register 0/1 <- 0x60
[  235.7379] T/i8259_PIC: PIC 1 mask 0x8F
[  235.7380] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7382] T/HW::HDC: ATA read status register 0/1 <- 0x41
[  235.7383] T/HW::HDC: ATA write command block features 0/1 0x00
[  235.7385] T/HW::HDC: ATA write command block 0/1 cylinder low 0x0C
[  235.7387] T/HW::HDC: ATA write command block 0/1 cylinder high 0x00
[  235.7388] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7390] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[  235.7391] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[  235.7393] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[  235.7394] T/HW::HDC: ATA read status register 0/1 <- 0x48
[  235.7396] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[  235.7398] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[  235.7415] D/HostInterface: Key scancode 54 up
[  235.7446] T/HW::CDROM: CDROM executing command 0x43 length 12
[  235.7447] D/HW::CDROM: CDROM read TOC msf=0,start_track=0,format=1,max_length=12
[  235.7449] B/HW::CDROM: Raising CDROM interrupt
[  235.7450] T/HW::ATADevice: Raising ATA interrupt line 0/1
[  235.7452] T/CPU_X86::CPU: IRQ line signaled
[  235.7453] T/CPU_X86::CPU: IRQ line signaled
[  235.7455] T/CPU_X86::CPU: Hardware interrupt 118
[  235.7457] T/HW::HDC: ATA read status register 0/1 <- 0x48
[  235.7458] T/i8259_PIC: EOI interrupt 6
[  235.7460] T/i8259_PIC: EOI interrupt 2
[  235.7461] T/HW::HDC: ATA read sector count 0/1 <- 0x02
[  235.7463] T/HW::HDC: ATA read cylinder low 0/1 <- 0x0C
[  235.7464] T/HW::HDC: ATA read cylinder high 0/1 <- 0x00
[  235.7466] T/HW::ATADevice: Raising ATA interrupt line 0/1
[  235.7468] T/CPU_X86::CPU: IRQ line signaled
[  235.7469] T/CPU_X86::CPU: IRQ line signaled
[  235.7471] T/CPU_X86::CPU: Hardware interrupt 118
[  235.7472] T/HW::HDC: ATA read status register 0/1 <- 0x50
[  235.7474] T/i8259_PIC: EOI interrupt 6
[  235.7475] T/i8259_PIC: EOI interrupt 2
[  235.7477] T/HW::HDC: ATA read sector count 0/1 <- 0x03
[  235.7478] T/HW::HDC: ATA read alt status register 0/1 <- 0x50
[  235.7480] T/HW::HDC: ATA read status register 0/1 <- 0x50
[  235.7482] T/HW::HDC: ATA read error register 0/1 <- 0x00
[  235.7483] T/i8259_PIC: PIC 1 mask 0x8F
[  235.7485] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7487] T/HW::HDC: ATA read status register 0/1 <- 0x50
[  235.7488] T/HW::HDC: ATA write command block features 0/1 0x00
[  235.7490] T/HW::HDC: ATA write command block 0/1 cylinder low 0x00
[  235.7491] T/HW::HDC: ATA write command block 0/1 cylinder high 0x08
[  235.7493] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[  235.7495] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[  235.7496] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[  235.7498] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[  235.7499] T/HW::HDC: ATA read status register 0/1 <- 0x58
[  235.7501] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[  235.7502] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[  235.7504] T/HW::CDROM: CDROM executing command 0x28 length 10
[  235.7506] D/HW::CDROM: CDROM read 1 sectors at LBA 16
Stenzek
Newbie
 
Posts: 55
Joined: 2017-12-08 @ 08:30

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-13 @ 02:07

Do I see that correctly that the A0 command (or any ATA command valid for ATAPI) clears the error bit in the status register? Doesn't sff8020i / ATA/ATAPI-4 say it's only cleared by a Request Sense command?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby Stenzek » 2019-7-13 @ 03:10

Hmm, I'm clearing the error register for the CDROM after any successful command. Might be incorrect, that was an assumption.
Stenzek
Newbie
 
Posts: 55
Joined: 2017-12-08 @ 08:30

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-13 @ 03:24

Just thinking about something... What is the purpose of having index 02-99 inside a cue sheet? The software only sees the whole track, doesn't it(using the read TOC command)?

So what happens when you have index 01 and 02 inside a data track? Or an audio track? So far I've only seen tracks with index 00(pregap data in the backend file, HTOA) and 01(the actual track data). What's the purpose of indexes 02-99? What are they used for? Can software even address them individually? Read TOC only gives a whole track after all(thus all indexes)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-13 @ 18:35

Just saw the Read TOC instruction be handled a bit odd. It was generating enough data(just now improved with full track packets instead of a fabricated track 1 only(for the whole cue image, while it's actually supposed to give multiple tracks for such a thing(depending on the amount of tracks in the disk image)), but the parameters it got in the command packets(of 12 bytes long) were read, but incorrectly shifted to their results before being OR-ed to form their native value(e.g. the length fields bytes being combined into a 32-bit integer were using shifts of 0,1,2,3 instead of 0,8,16,24 :S ).

That was the case for mode select bytes 7&8, mode sense bytes 7&8, Read header bytes 7&8, Read sub-channel bytes 7&8, Read TOC bytes 7&8, Read sectors bytes 7&8(and extended form (command A8h) bytes 6,7,8,9) and Mechanism status bytes 8&9. Oops!
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-bases CD-ROM swap issues?

Postby superfury » 2019-7-13 @ 21:48

Just tried booting Minix 3.3.0 again with the improved and bugfixed CD-ROM emulation, but unfortunately. When booting it says it cannot find the netbsd partition(booting from bootable CD-ROM)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-based CD-ROM swap issues?

Postby superfury » 2019-7-15 @ 12:30

Just improved the Read TOC command a bit. It's now properly reporting the A0-A2 records for mode 2 and all tracks being listen instead of just track 1(what Bochs/Dosbox does). I also adjusted the mode 1 result to properly give the track 1 information and starting address. Mode 0 is unchanged, as it already reports according to the standards.

Also, just a confirmation, is mode 0 the only mode that gives MSF and LBA results(based on the bit in the command bytes) instead of always MSF results(like mode 2) or LBA results(like mode 1)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: UniPCemu's Dosbox-based CD-ROM swap issues?

Postby superfury » 2019-7-25 @ 17:04

I managed to improve the cue/bin disk image format quite a lot. It now supports all the different combinations of pregap, postgap, index(only index 1 and up, index 0 counted as invalid to read(as it's pregap)). The data read commands now properly support all different kinds of .cue disk image formats(CD-DA, 2048 byte tracks, 2352 byte tracks in both 2048 byte and 2353 byte read modes). I also added support to the cue sheet parsing and ATAPI emulation to properly skip the pregap/postgap regions for read commands(e.g. read(10/12), read TOC, read MSF etc.). The only basic CD-ROM thing that's not yet supported is the audio commands, but the basic data read commands should all be working fully with both ISO files(sectors converted from LBA like Dosbox, with the 2 second pregap) and standard CUE files(as long as the backend is of type binary) without any extensions.

So far tried various games with the new cue image file support(so far gotten only Earthworm Jim 1 running for those, as the others seem to have still unknown CPU problems(some even complain about no SVGA adapter, even though a ET4000 is pretty much fully emulated on the graphical modes(just not the enhanced text modes, WhatVGA keeps aborting them and returning to the main menus on those for some odd reason).
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Previous

Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 0 guests