Skip to content

Conversation

@hecatia-elegua
Copy link
Contributor

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.

Copy link
Member

@kevinaboos kevinaboos left a 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.

Comment on lines 569 to 570
//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
Copy link
Member

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:

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.

@hecatia-elegua
Copy link
Contributor Author

Should be good for merging now.

@hecatia-elegua hecatia-elegua marked this pull request as ready for review March 18, 2023 12:29
Copy link
Member

@kevinaboos kevinaboos left a 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!

@kevinaboos kevinaboos merged commit 5be2f94 into theseus-os:theseus_main Mar 20, 2023
github-actions bot pushed a commit that referenced this pull request Mar 20, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants