-
-
Notifications
You must be signed in to change notification settings - Fork 182
Handle PS/2 better on real hardware #884
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
Handle PS/2 better on real hardware #884
Conversation
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! I'm happy to confirm that this PR makes the keyboard work on my real hw machine, as well as on QEMU and QEMU+KVM! Nice work.
The mouse still does not work on real hw, though it does work on QEMU and QEMU+KVM. Currently the only symptom I'm able to observe on real hw is that as soon as I move or click the mouse, the keyboard also stops working. This might be due to the myriad loops you've inserted throughout the code, or just some other form of interference between the kbd and mouse w.r.t. shared ps2 data ports. We can discuss more here or on discord if you have other ideas to try.
When you get a chance, can you clean up this PR to reduce the amount of verbose logging (or submit a different PR if you want to keep this as is)? Also be sure to remove an loops inserted. After that, I'd be happy to merge it in, since it does at least allow the keyboard to work, which is must more important than the mouse.
Feel free to check out the latest changes to theseus_main, which enable a graphical framebuffer for early printing. It should work for you to get more info during early init more easily.
kernel/ps2/src/lib.rs
Outdated
| //I get random startup blackscreens when multicore is on (no logging) | ||
| //when doing command_to_keyboard, but it could also be caused by completely different things |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you merge in the latest changes from theseus_main, you should be able to disable the code routine that changes graphics mode when bringing up multiple CPUs. You can do that by commenting out this line:
Theseus/kernel/multicore_bringup/src/lib.rs
Line 338 in 0f4f28f
| is_last_ap = ap_count == total_cpus_expected.saturating_sub(2); |
That way, the system will keep using the same framebuffer until the graphics/WM subsystem is initialized.
|
Should be good for merging now. |
kevinaboos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks a lot!
* Be a little less strict about adhering to PS/2 specs, as some hardware doesn't abide by typical behavior. * The PS/2 keyboard should now work on all real hardware, but the mouse support still isn't 100% correct on all systems. 5be2f94
This is the second, actual PR (opposed to #870, which is just for debugging).
We still need to test on more real hardware, so this is a draft and still has some debug statements, which might be useful if early framebuffer logging is possible soon.
When everything works I can deduplicate all those loops as well.