VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm currently trying to get my 8042&PS/2 keyboard emulation running without errors, but currently it's giving a AA-301 Keyboard error?

8042 emulation(BUS interface and Transfer timing): https://bitbucket.org/superfury/unipcemu/src/ … 042.c?at=master
Header: https://bitbucket.org/superfury/unipcemu/src/ … 042.h?at=master

PS/2 keyboard connected to the 8042: https://bitbucket.org/superfury/unipcemu/src/ … ard.c?at=master
header (submodule): https://bitbucket.org/superfury/commonemufram … ard.h?at=master

There's an UNIPCEMU define for the submodule header to be used(For easy cross-emulator compatibility with my other GBemu project(based on Imran Nazzar's GB Javascript code tutorial)).

Can anyone see why the AT BIOS is erroring out when resetting the PS/2 keyboard? (Command 0xFF is sent, responding before the error with FA and finally AA, which errors out?)

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

Reply 1 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++

Vladstamate, can you see if there's a problem with the 8042/PS/2 keyboard combo? Somehow the BIOS fails at the Keyboard Reset(0xFF command), which sends both bytes during the initial loop(s), only to be counted as an error by the BIOS? Why would it be giving a AA 301-Keyboard error?

Edit: http://www.minuszerodegrees.net/5150_5160/pos … T_stuck_key.htm indicates it's detecting the 0xAA input as a stuck key instead of a result of the self test?

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

Reply 2 of 6, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

We can both try to run same BIOS and log the in/out and see where we diverge. What BIOS are you running?

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 3 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++

I'm running the 06/10/85 type 2 motherboard(6MHz 80286) BIOS ROM from minuszerodegrees.
Edit: Hmmm... Something's odd: the BIOS reads the entire result, including the AAh result from the buffer, then executes keyboard enable on the 8042. Then at the stuck keys check it finds the filled 8042(0xAA still remaining), while it should have been emptied due to having been read?

Edit: Just fixed a bug in resetting(poweron keyboard) using the 8042 enable first port command(0xAE), while it's already turned on(by writing the 0xFF reset command). Also made it use proper timing instead of timing and also adding one extra 0xAA to the buffer(already done by the timing, so resulting in double AAh being buffered).

Last edited by superfury on 2018-01-25, 02:21. Edited 1 time in total.

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

Reply 4 of 6, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I am running now 286 AT configuration with the IBM BIOS from 10 January 1984 (so the previous version from yours). It seems to boot fine without complaining about keyboard errors. Let me get a lot of IN/OUT for the 8042 and I will post it here. Then you can compare with yours. We can look at instructions later once we find out where (if) we diverge from each other with respect to CPU <-> 8042 communication.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 5 of 6, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just managed to get it working(see edit above post)! 😁 Now the only problem left is the FDC read/DMA case(And CPU of course).

Last edited by superfury on 2018-01-25, 02:34. Edited 2 times in total.

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

Reply 6 of 6, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

Got it, I see it now. Well done!

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/