Need help fixing ATAPI CD-ROM emulation in UniPCemu

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

Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-1-06 @ 17:20

I'm trying to get the ATAPI CD-ROM emulation in UniPCemu working. So far I've found out that the CD-ROM(SCSI) Inquiry command doesn't fail when no media is inserted, and fixed it accordingly. Then I notice that the IRQ is trying to be raised, but it's already raised(not lowered by reading the ATA Status register), thus not triggering the IRQ that's needed for the command to be recognized.

Is it correct that the IRQ line is only lowered when the Status Register is read?

Edit: I now see the driver (vide-cdd.sys) execute a ATAPI Inquiry command, which has strange packet data (6 words of 0x12 in little endian, so 0x12 0x00 0x12 0x00 0x12 0x00 0x12 0x00 etc...), then it waits some thing until finally giving up? Anyone can tell me what's going wrong? The IRQ(IRQ15 for the CD-ROM controller, the Secondary ATA controller) should be triggered? So why doesn't it continue? I've also implemented the missing ATAPI packet size that's returned when the packet's sent(in the Mid and High registers), but it won't read the resulting data for some reason?
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-1-06 @ 18:21

The current version can be found at:
https://bitbucket.org/superfury/unipcem ... ?at=master

The driver (vide-cdd.sys) doesn't seem to read the result from the buffer for some reason after transferring the complete command?
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-1-07 @ 15:33

After the latest CPU OUTSB/W fix, now the correct packet is loaded into the ATAPI4 CD-ROM drive. Then it starts to infinitely read the Status Register(IRQ is asserted directly when the packet is fully received, commandstatus becoming 1(Indicating it's to read the packet result from the device)). The LBA registers in total contain 0xA0240001(Sector number 0x01, Size 0x24).

Strangely I eventually notice that the status returns to 0(Which usually is the case because of an invalid command or device reset)?
https://bitbucket.org/superfury/unipcem ... ?at=master
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-1-11 @ 09:39

After the latest changes in the 80286 emulation, the OAKCDROM.SYS doesn't seem to crash just like that anymore. Now it seems to be doing something strange: it's outputting some byte to the ATA data port, then reading the status register, expecting it to not set bits 6&4(!=0x50)? Why would it do this? Is some kind of ready/not ready behaviour expected and required for CD-ROM drivers?

The controller itself is in the default command status(status 0, which means ready for command), ready to accept a command. The status register contains 0x40.
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-1-14 @ 23:34

Anyone can see why the cd-rom driver fails to continue after sending the inquiry command with parameters? Why isn't it reading the result?

https://bitbucket.org/superfury/unipcem ... ?at=master
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: Need help fixing ATAPI CD-ROM emulation in UniPCemu

Postby superfury » 2017-5-28 @ 20:13

It's clearing the IDE busy flag, since it's not doing anything while transferring packet data(the result data that's in the buffers, or transferring packet data(like Mode data tables)). Also no sector count register is set(it's in polling mode always). Is that a problem with CD-ROM drivers?

Current source code: https://bitbucket.org/superfury/unipcem ... ?at=master
superfury
Oldbie
 
Posts: 1627
Joined: 2014-3-08 @ 11:25
Location: Netherlands


Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 2 guests