Machine restarting when placing command 0xF4 on PS2 controll

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
Patrick367
Posts: 3
Joined: Tue Jul 27, 2021 6:26 pm

Machine restarting when placing command 0xF4 on PS2 controll

Post by Patrick367 »

I'm trying out the idea of ​​creating a keyboard driver, but I have a problem:

Code: Select all


[bits 16]
[org 0x500]

jmp StartKeyboard

StartKeyboard:
	
	mov al, 0xf4
	mov dx, 0x64 
	out dx, al
	
	mov ah, 0x0E
	mov al, "P"
	int 10h
ret
This is the code, I'm sure it arrives on this label because I printed a letter as soon as I got to StartKeyboard (More was just for testing)


the problem is that when I run this code on qemu it keeps restarting all the time
but if I put the 0xED command in al, it works normal, I wanted to know why this is
Octocontrabass
Member
Member
Posts: 5492
Joined: Mon Mar 25, 2013 7:01 pm

Re: Machine restarting when placing command 0xF4 on PS2 cont

Post by Octocontrabass »

You're sending command 0xF4 to the keyboard controller, not the keyboard. Command 0xF4 is one of several commands that tells the keyboard controller to reset the CPU.
Patrick367
Posts: 3
Joined: Tue Jul 27, 2021 6:26 pm

Re: Machine restarting when placing command 0xF4 on PS2 cont

Post by Patrick367 »

Octocontrabass wrote:You're sending command 0xF4 to the keyboard controller, not the keyboard. Command 0xF4 is one of several commands that tells the keyboard controller to reset the CPU.
And how would I send this command to the keyboard?, do I need this command to receive keyboard data?
Octocontrabass
Member
Member
Posts: 5492
Joined: Mon Mar 25, 2013 7:01 pm

Re: Machine restarting when placing command 0xF4 on PS2 cont

Post by Octocontrabass »

Patrick367 wrote:And how would I send this command to the keyboard?
Assuming the keyboard is plugged into the first PS/2 port, all you need to do is write it to port 0x60.
Patrick367 wrote:do I need this command to receive keyboard data?
If you want to properly initialize the keyboard controller, you'll send several different commands to the keyboard. But you can't properly initialize the keyboard controller until after you initialize USB, so I wouldn't bother right now.
Post Reply