OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Machine restarting when placing command 0xF4 on PS2 controll
PostPosted: Tue Jul 27, 2021 6:50 pm 
Offline

Joined: Tue Jul 27, 2021 6:26 pm
Posts: 3
I'm trying out the idea of ​​creating a keyboard driver, but I have a problem:

Code:

[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


Top
 Profile  
 
 Post subject: Re: Machine restarting when placing command 0xF4 on PS2 cont
PostPosted: Wed Jul 28, 2021 9:09 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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.


Top
 Profile  
 
 Post subject: Re: Machine restarting when placing command 0xF4 on PS2 cont
PostPosted: Wed Jul 28, 2021 3:07 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: Machine restarting when placing command 0xF4 on PS2 cont
PostPosted: Wed Jul 28, 2021 3:28 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: 8infy, DotBot [Bot], SemrushBot [Bot] and 58 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