PS/2 Self-testing problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
adev5311
Posts: 11
Joined: Sun Oct 13, 2024 2:29 am
Libera.chat IRC: adev531
GitHub: https://github.com/adev531

PS/2 Self-testing problem

Post by adev5311 »

Im trying to Initialize PS/2 Controller.
Its working properly in QEMU and other emulators,
and I tried in my laptop as my laptop supports CSM and In device manager,
Its displaying Keyboard/Touch pad as PS/2 device. But in my laptop returning 0x1C (After Pressing Enter on Grub) or 0xFA on Self-test. I already added code to Flush buffer and Disable devices.
What should I fix?
Hello, hi. :D
I'm alt account.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: PS/2 Self-testing problem

Post by Octocontrabass »

USB legacy support will interfere with initializing the PS/2 controller. If you don't have USB drivers yet, you can try disabling USB legacy support in the BIOS setup.

Which self-test are you talking about? Both the PS/2 controller and the keyboard have self-test commands. (Do not use the PS/2 controller self-test command.)

Sharing your code will help us figure out what's going on.
User avatar
adev5311
Posts: 11
Joined: Sun Oct 13, 2024 2:29 am
Libera.chat IRC: adev531
GitHub: https://github.com/adev531

Re: PS/2 Self-testing problem

Post by adev5311 »

I'm using PS/2 Controller self-test, Is there problem?
Why self-test on PS/2 Controller is bad?
(+ There's no option to disable USB legacy support. Its Samsung UEFI BIOS.)
Hello, hi. :D
I'm alt account.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: PS/2 Self-testing problem

Post by Octocontrabass »

adev5311 wrote: Sun Oct 13, 2024 3:42 pmI'm using PS/2 Controller self-test, Is there problem?
Why self-test on PS/2 Controller is bad?
The self-test command can change the PS/2 controller configuration. Firmware, especially on laptops, does not handle the change gracefully. For example, laptop Fn keys may stop working or activate when the wrong keys are pressed.
User avatar
adev5311
Posts: 11
Joined: Sun Oct 13, 2024 2:29 am
Libera.chat IRC: adev531
GitHub: https://github.com/adev531

Re: PS/2 Self-testing problem

Post by adev5311 »

I reset config after checking self-test.
and after I remove controller self-testing...
First port Test is returning 0x54 (0 for second port)
and Identify command is not working properly in my laptop.
Hello, hi. :D
I'm alt account.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: PS/2 Self-testing problem

Post by Octocontrabass »

adev5311 wrote: Sun Oct 13, 2024 4:52 pmI reset config after checking self-test.
You might not be able to reset everything. There are lots of nonstandard extensions to the PS/2 controller.
adev5311 wrote: Sun Oct 13, 2024 4:52 pmFirst port Test is returning 0x54 (0 for second port)
That sounds like the keyboard and mouse IDs. I think there's something wrong in your code to receive data from the PS/2 controller.
User avatar
adev5311
Posts: 11
Joined: Sun Oct 13, 2024 2:29 am
Libera.chat IRC: adev531
GitHub: https://github.com/adev531

Re: PS/2 Self-testing problem

Post by adev5311 »

Octocontrabass wrote: Sun Oct 13, 2024 8:27 pm
adev5311 wrote: Sun Oct 13, 2024 4:52 pmI reset config after checking self-test.
You might not be able to reset everything. There are lots of nonstandard extensions to the PS/2 controller.
Sorry, I meant "I'm setting config of PS/2 Controller after self-testing."
Octocontrabass wrote: Sun Oct 13, 2024 8:27 pm
adev5311 wrote: Sun Oct 13, 2024 4:52 pmFirst port Test is returning 0x54 (0 for second port)
That sounds like the keyboard and mouse IDs. I think there's something wrong in your code to receive data from the PS/2 controller.
Probably flushing buffer is not working properly. #-o I'm doing :

Code: Select all

while ((inb(0x64) >> 0) & 1 == 1) inb(0x60)
To flush buffer.
Hello, hi. :D
I'm alt account.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: PS/2 Self-testing problem

Post by Octocontrabass »

adev5311 wrote: Sun Oct 13, 2024 11:57 pmSorry, I meant "I'm setting config of PS/2 Controller after self-testing."
You're setting the standard configuration byte. What about nonstandard configurations?
adev5311 wrote: Sun Oct 13, 2024 11:57 pmProbably flushing buffer is not working properly. #-o I'm doing :

Code: Select all

while ((inb(0x64) >> 0) & 1 == 1) inb(0x60)
To flush buffer.
That's the right way to flush the output buffer. Are you flushing the output buffer at the right time?
User avatar
adev5311
Posts: 11
Joined: Sun Oct 13, 2024 2:29 am
Libera.chat IRC: adev531
GitHub: https://github.com/adev531

Re: PS/2 Self-testing problem

Post by adev5311 »

Octocontrabass wrote: Mon Oct 14, 2024 4:03 pm
adev5311 wrote: Sun Oct 13, 2024 11:57 pmSorry, I meant "I'm setting config of PS/2 Controller after self-testing."
You're setting the standard configuration byte. What about nonstandard configurations?
Probably that's the Reason.
Octocontrabass wrote: Mon Oct 14, 2024 4:03 pm
adev5311 wrote: Sun Oct 13, 2024 11:57 pmProbably flushing buffer is not working properly. #-o I'm doing :

Code: Select all

while ((inb(0x64) >> 0) & 1 == 1) inb(0x60)
To flush buffer.
That's the right way to flush the output buffer. Are you flushing the output buffer at the right time?
Before disabling devices.
Hello, hi. :D
I'm alt account.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: PS/2 Self-testing problem

Post by Octocontrabass »

adev5311 wrote: Mon Oct 14, 2024 4:29 pmBefore disabling devices.
That sounds like the right time to flush the output buffer. You should share your code if it's still not working.
Post Reply