OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:28 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PS/2 ignores 0xF5 (disable command)
PostPosted: Fri Aug 20, 2021 4:07 am 
Offline
Member
Member

Joined: Sun Apr 05, 2020 1:01 pm
Posts: 182
Hi, I have a problem with this one computer that completely ignores the disable command.

Here's a few things that I know:
1. This computer has xHCI, which I take ownership of from BIOS before touching PS/2.
2. This computer has a Synaptics touchpad (so PS/2 must also be real).
3. I know its not a multiplexed PS/2 controller.
4. My simple test that I made works on 2 other laptops & qemu/vmware.

Here's the test that I tried (in pseudocode):
Code:
disable_all_ports();
enable_port(1);

// sends 0xF5 and waits for ACK
disable_scanning(port1);

for (;;) {
    data = try_to_read_data_with_some_timeout();
    if (!timeout) {
       panic("got data with scanning disabled? %d", data);
    }
}


On this one laptop I consistently get a panic with the exact scancode that corresponds to that key that I pressed.
Is this a buggy PS/2 implementation? How am I supposed to safely initialize a device if i can get random garbage data at any time?

UPD: I "solved" the problem by rewriting every function to handle garbage bytes correctly.


Top
 Profile  
 
 Post subject: Re: PS/2 ignores 0xF5 (disable command)
PostPosted: Fri Aug 20, 2021 8:43 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
8infy wrote:
1. This computer has xHCI, which I take ownership of from BIOS before touching PS/2.

It doesn't have any other USB host controllers, right?

8infy wrote:
2. This computer has a Synaptics touchpad (so PS/2 must also be real).

Synaptics makes I2C touchpads too. Does ACPI say the PS/2 controller is real?

OSes typically disable scanning only briefly during hardware initialization, so I can imagine no one noticing a buggy keyboard that ignores the command.


Top
 Profile  
 
 Post subject: Re: PS/2 ignores 0xF5 (disable command)
PostPosted: Fri Aug 20, 2021 1:03 pm 
Offline
Member
Member

Joined: Sun Apr 05, 2020 1:01 pm
Posts: 182
Octocontrabass wrote:
It doesn't have any other USB host controllers, right?

Yep, it's 2 xHCI ports and that's it.

Octocontrabass wrote:
Synaptics makes I2C touchpads too. Does ACPI say the PS/2 controller is real?

Good question, I'd have to check

Octocontrabass wrote:
OSes typically disable scanning only briefly during hardware initialization, so I can imagine no one noticing a buggy keyboard that ignores the command.

Yeah this seems possible, I was only able to break initialization if I spam the keyboard really hard, might be possible they didn't really test that themselves.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot], SemrushBot [Bot] and 59 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group