Skip to content

Keyboard rework and PS/2 mouse register-level access support #2287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 21, 2023

Conversation

FeralChild64
Copy link
Collaborator

@FeralChild64 FeralChild64 commented Feb 18, 2023

User visible changes:

  • fixes Windows 3.11 for Workgroups problem Windows 3.1x keyboard problem #2175
  • CtMouse 2.0 PS/2 driver works now (previously 2.1 was working, but not 2.0)
  • Microsoft IntelliMouse Explorer is now emulated (5 buttons + wheel); relevant to Windows 9x only, tested with Windows 95 and IntelliPoint 3.0 driver (2.0 does not support this model, 4.0 contains some bloatware)
  • HP Vectra fast A20 line switching is now emulated; to use boot MS-DOS (or PC-DOS) and load HIMEM.SYS with /MACHINE:14 parameter (was trivial to implement)

Under the hood changes:

  • both keyboard and mouse emulation was moved to hardware/input directory, as they share important parts
  • the mouse_queue.cpp is not needed anymore, due to PS/2 emulation being much more clean
  • Intel 8042 micro-controller part is now placed in a separate file; it communicates with keyboard.cpp and
    mouseif_ps2_bios.cpp, similarly as a real-life micro-controller communicates with keyboard and mouse
  • many more PS/2 hardware register commands are now emulated
  • added scancodes for many keys (multimedia, ACPI, F13-F24, etc.), everything I could find - just for reference and possible support in a far future, keys itself are not emulated
  • same with scancode sets 2 or 3 - the code is there, but not enabled (can be enabled in keyboard.h) - so far I haven't came across anything that uses them
  • another partially implemented feature are keyboard LEDs; the micro-controller part is implemented, but neither the BIOS sets the LEDs, nor the GFX subsystem displays them

I suggest to review commit by commit.

@FeralChild64 FeralChild64 added bug Something isn't working enhancement New feature or enhancement of existing features labels Feb 18, 2023
@FeralChild64 FeralChild64 self-assigned this Feb 18, 2023
@FeralChild64 FeralChild64 force-pushed the fc/ps2-mouse-registers-2 branch from 3fa7f96 to f9b20de Compare February 18, 2023 16:45
@FeralChild64 FeralChild64 marked this pull request as ready for review February 18, 2023 17:27
@ThomasEricB
Copy link
Contributor

This is the most beautiful thing I've ever seen.

Copy link
Member

@johnnovak johnnovak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a monumental piece of work @FeralChild64! 🚀

I was able to review it only superficially, mainly just the general code-quality, and it's top-notch stuff, as always. Left a few very minor comments and suggestions.

We're lucky to have you! ❤️ 🤘🏻 😎

@FeralChild64 FeralChild64 force-pushed the fc/ps2-mouse-registers-2 branch 2 times, most recently from 52553af to b5a35c7 Compare February 19, 2023 13:07
Copy link
Member

@kcgen kcgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a pleasure to read through, @FeralChild64. The 8042 is at a level that reads like pseudo-code. It sets an example for how other logic devices should be emulated!

Just a couple minor comments / suggestions for you to consider. Feel free to merge when ready.

All tests are passing on my side - but I don't have anything in particular to exercise all the IO routines on the 8042.

@FeralChild64 FeralChild64 force-pushed the fc/ps2-mouse-registers-2 branch 2 times, most recently from bbd945a to f765790 Compare February 20, 2023 21:12
@FeralChild64 FeralChild64 force-pushed the fc/ps2-mouse-registers-2 branch from f765790 to f8886e7 Compare February 21, 2023 14:46
@FeralChild64
Copy link
Collaborator Author

@kcgen: I'm getting a problem with the pipeline:

This is a scheduled Ubuntu-18.04 brownout. The Ubuntu-18.04 environment is deprecated and will be removed on April 1st, 2023. For more details, see actions/runner-images#6002

Maybe it's time to remove the Ubuntu 18.04 jobs? Unless we are planning a release before April 1st.

@kcgen
Copy link
Member

kcgen commented Feb 21, 2023

@kcgen: I'm getting a problem with the pipeline:

This is a scheduled Ubuntu-18.04 brownout. The Ubuntu-18.04 environment is deprecated and will be removed on April 1st, 2023. For more details, see actions/runner-images#6002

Maybe it's time to remove the Ubuntu 18.04 jobs? Unless we are planning a release before April 1st.

Yes, I think it's time.

I've been manually re-running them, but as time gets closer to April, GitHub keeps increasingly the likelhood that the 18.04 jobs will brown-out.

It's a good policy.. like the alarm clock that gently gets louder :-)

@kcgen kcgen merged commit 15ed39c into main Feb 21, 2023
@delete-merged-branch delete-merged-branch bot deleted the fc/ps2-mouse-registers-2 branch February 21, 2023 18:54
@johnnovak johnnovak added the input handling Issues related to handling any input (keyboard, mouse, joystick & game controllers) label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or enhancement of existing features input handling Issues related to handling any input (keyboard, mouse, joystick & game controllers)
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants