MiSTer-devel / ao486_MiSTer

ao486 port for MiSTer
Other
254 stars 69 forks source link

Recent "scancode" changes break NT keyboard #102

Closed alexoughton closed 2 years ago

alexoughton commented 2 years ago

The changes made in #96 have broken keyboard under Windows NT. Specifically this seems to be related to the change to the core itself, rather than the change to the BIOS.

Mister main version: 20220224 Core version: 22.02.24 BIOS: As-per most recent commit (5e0199a) Behavior in DOS: Working fine. This is not the "corruption" issue people have been experiencing when not properly updating the BIOS. Behavior in NT: Dead keyboard. Unable to CTRL+ALT+DEL to login. Caps-Lock non-responsive.

Mister main version: As above. Core version: Revert back to 22.02.11 BIOS: Do not revert. Keep the new one with the updates. Behavior in DOS: Corrupted (because I should have reverted the BIOS too if I wanted the keyboard to work...) Behavior in NT: Working back to normal.

sorgelig commented 2 years ago

looks like NT requires scancode set 2 while dos uses Scancode set 1. By original idea it supposed to be switched by command to keyboard. Somehow it doesn't happen. I still don't have WinNT running on my MiSTer..

alexoughton commented 2 years ago

@sorgelig I have sent you a PM on the forum with a direct link to download my working image for NT4. Also included in the message is the password for extracting the archive and for logging on to NT as Administrator. This image does not need any work to run on core version 22.02.11, but has the keyboard issue on 22.02.24.

Note: If you have not also reverted the scancode setting changes in the BIOS (i.e. you are in my second scenario above where NT keyboard is working but DOS is not), you will not be able to press ENTER to skip the 30-second timeout in the bootloader selection screen. You should just let the 30 seconds pass and then NT will boot with a working keyboard.

I hope this helps with troubleshooting. I am also digging around in the recent changes to mister_main to see if I can understand what's going on here.

sorgelig commented 2 years ago

got it. thanks! will also check keyboard communication

sorgelig commented 2 years ago

ok, i know why it has wrong scan code set. I need to read more about PS2 keyboards and default scancode set.

sorgelig commented 2 years ago

this commit: https://github.com/MiSTer-devel/ao486_MiSTer/commit/9eb5b85ee810c2d96a28287eb49db872c4e1b9ef must be reverted.

sorgelig commented 2 years ago

fixed

alexoughton commented 2 years ago

Confirmed working under NT and DOS using newly released binaries.

spark2k06 commented 2 years ago

I can't test it now, but it may be that Windows NT is simply resetting the keyboard (F6), or has sent wrong commands (FF) and is resetting to set 2 (Main repository), if so, maybe the solution is to simply leave the set as it is in this point, i.e. 1.

sorgelig commented 2 years ago

nope. That reverted commit was completely wrong. It removed i8042 internal translator Set2->Set1 which is present in real HW.

spark2k06 commented 2 years ago

Does the i8042 IC have a set 2 to set 1 translator? That does seem really curious to me, I was completely unaware of it, I'll check it out and investigate if only out of curiosity. Thanks for the info.

sorgelig commented 2 years ago

https://wiki.osdev.org/%228042%22_PS/2_Controller#Translation

spark2k06 commented 2 years ago

I see it, thank you. What I don't understand is this sentence:

"Whenever this translation is enabled (and by default, it is) there is no way to reverse it in software."

How do you then disable it if necessary if by default it is enabled? by hardware?

"For software to actually use "scan code set 2" (or the even newer, rarely used, "scan code set 3"), or to allow different devices to be used in the keyboard port, you need to disable this translation to avoid having the data from the device mangled."

sorgelig commented 2 years ago

they mean, you cannot translate code back as application doesn't know if it's Set1 or Set2. But you always can disable translation in config byte.