VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I see it issuing an ATAPI Inquiry command, read the resulting data, read the error register(containing the result code), then aborting saying there are no drives? Since it's executed the Inquiry command, it should have detected it, but it doesn't for some reason?

The packet data that's received is filled with UniPCemu's detection data:

		ATA[channel].Drive[drive].data[0] = 0x05; //We're a CD-ROM drive!
ATA[channel].Drive[drive].data[1] = 0x80; //We're always removable!
ATA[channel].Drive[drive].data[3] = ((2<<4)|(1)); //We're ATAPI version 2(high nibble, from SFF-8020i documentation we're based on), response data format 1?
ATA[channel].Drive[drive].data[4] = 31; //Amount of bytes following this byte for the full buffer? Total 36, so 31 more.
strcpy_padded(&ATA[channel].Drive[drive].data[8],8,(byte *)"UniPCemu"); //Vendor ID
strcpy_padded(&ATA[channel].Drive[drive].data[16],16,(byte *)"Generic CD-ROM"); //Product ID
strcpy_padded(&ATA[channel].Drive[drive].data[32],4,&FIRMWARE[1][0]); //Product revision level

The result is read in it's entirety, with no remaining data(the size being the lowest of the Inquiry Packet size and the cylinder registers specifying the maximum size).

So:
1. It issues the ATAPI PACKET command.
2. It sends the ATAPI PACKET.
3. It reads the result data(the above packet data, C/D and I/O is set, REL cleared).
4. It reads the entering result phase from the ATA STATUS register.
5. It reads the error code from the Sector Count register(Interrupt reason register), terminating the command(C/D and I/O and REL cleared).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 1, by superfury

User metadata
Rank l33t++
Rank
l33t++

Is there a generic ATAPI testsuite that can test the I/O of ATAPI emulation? What does stuff like Bochs use to verify the correctness of their CD-ROM controllers(and regression tests)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io