VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Several hardware seems to be misdetected?

From detlog.txt:

Checking for: Serial Communication Port
QueryIOMem: Caller=DETECTCOM, rcQuery=0
IO=3f8-3ff
GetCOMIRQ: failed to detect IRQ, use default 4
GetCOMIRQ: IIR=1
Detected: *PNP0500\0000 = [11] Communications Port
IO=3f8-3ff
IRQ=4
SetVar: COMIRQ3f8=4,0
QueryIOMem: Caller=DETECTCOM, rcQuery=0
IO=2f8-2ff
GetCOMIRQ: failed to detect IRQ, use default 3
GetCOMIRQ: IIR=1
Detected: *PNP0500\0001 = [12] Communications Port
IO=2f8-2ff
IRQ=3
SetVar: COMIRQ2f8=3,0
Checking for: Serial Mouse
QueryIOMem: Caller=DETECTSERIALMOUSE, rcQuery=2
IO=3f8-3ff
Serial mouse ID: M (004d)
Detected: *PNP0F0C\0000 = [13] Standard Serial Mouse
SetVar: COMIRQ3f8=4,0
QueryIOMem: Caller=DETECTSERIALMOUSE, rcQuery=2
IO=2f8-2ff
Serial mouse ID: M\ (5c4d)
Detected: *PNP0F0C\0001 = [14] Standard Serial Mouse
SetVar: COMIRQ2f8=3,0
Detected: *PNPB000\0000 = [18] Creative Labs Sound Blaster
IO=220-22f,388-389
DMA=1

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

Reply 1 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. Just made the IRR register edge-triggered, only setting it when raised(as before), but now only cleared when acnowledged by the CPU when starting the IRQ handler for it(as Qemu seems to do).

I did notice the serial mouse stopped working until reboot when finishing the add new hardware wizard?

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

Reply 2 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

Oh, great. The Sound Blaster still doesn't detect, while the first COM port reports IIR=4(no IRQ still), and the second IIR=1(Also no IRQ).

Almost think it's some undocumented bug?

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

Reply 3 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. Now, It once again reports the IIR=1 value, with the IRQ never starting? So there's definitely a IRQ issue at play here...

Edit: Just changed the paralllel IR lines on the AT architecture and up to directly drive their respective IR bit to be set, instead of waiting for the IRR bit to be cleared before acnowledging the hardware(for performing parallel IR lines, which isn't needed on AT and up, since there are plenty IR lines).

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

Reply 4 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. After those PIC changes, every UART IRQ that gets sent actually is properly acnowledged, setting the IRR(PIC) and IIR(UART) registers properly.

But during the add new hardware wizard, only once do I see such an UART IRQ actually raised(for 2 UARTs(one of the two UARTs raising it once only))?

Edit: Hmmmm.... I somehow see port 2FE is not responding, even though there's 2 UARTs?

Edit: Hmmm... I see port 2FE both being read and processed and being read and not processed, which should be impossible(except if the handler returns when it shouldn't)... Hmmmm...

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

Reply 5 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just adjusted the until now unimplemented OUT2 line from the Modem Status Register(only when not in loopback mode, status retained in loopback mode) to raise an Modem Status IRQ when it goes from 0 to 1.

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

Reply 6 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just have been thinking: what does the Alternative Output 2 do on a UART? Does the connected hardware send a byte or something when it's raised? Or is there something else that has to do with IRQ detection?

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

Reply 7 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just implemented a new interrupt request cause(0-3 were the original UART IRQs being reported in the IRR). Now it will report cause 7(which is the first undefined one) for the IRQ request(which is done by rising edge of the OUT2 bit in the Modem Control Register.

Is that perhaps what Windows requires to detect the IRQ? If not, how does it detect the IRQ when no device is connected to the UART?

Some (I'd assume) linux drive (https://github.com/intel/idxd-driver/blob/mas … 250/8250_port.c) seems to trigger an IRQ in the same way? Otherwise, it wouldn't work without a valid device plugged into the port?
Anyone knows more about this?
Edit: It's indeed the same as the linux driver: https://github.com/torvalds/linux/blob/master … 250/8250_port.c

Edit: Perhaps it triggers the IRQ simply by writing bit 4 of the MCR with the value of 1?

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