Keyboard data retrieval
Posted: Mon Apr 21, 2008 1:14 am
I have started on my OS. Right now I am using the tutorials like a bible to creating it though I'm making mine totally in assembly.
Anyways I have been trying to get information from the keyboard controller buffer. Primarrily I want it to keep checking the buffer when told to, and to updating something with the strokes (i'll need a bit help on that part. HECK I'll need help on quite a bit of this) When it encounters an "ENTER" then I want it to send this cumulated something that holds the keystokes to be checked against a list of valid options.
This is what I know that I believe will be needed:
1. 0x64 is the port with the status bit
2. 0x60 contains the actual data
3. it will employ a loop that waits for and enter stroke and when that happens then it will continue
4. to get it to show what has actually been typed it will keep calling Putch32 to write it.
5. When it encounters backspace it will need to remove the last byte from the something that holds all the keystrokes
That is about all I know of what needs to be done, but how to do it I have no clue, though I did see this in tutorial 7:
WaitLoop: in al, 64h ; Get status register value
and al, 10b ; Test bit 1 of status register
jz WaitLoop ; If status register bit not set, no data is in buffer
in al, 60h ; Its set--Get the byte from the buffer (Port 0x60), and store it
I believe that it does indeed monitor the buffer and when the buffer is filled with a keystroke then stores it. At the moment I using this code have it set to loop forever waiting for a keystroke.(using that code) when it gets one then it is sent to putch32. after the print I have it jump back and wait for another charecter. Unfortunally it doesn't work.
While fooling around I took out the jz line... It compiled. But had lots of the letter u with the accent over it. When I hit a key they all turned to the # sign.
I think that it can't retrieve the status of the buffer so it is waiting forever but it can't find it. No triple fault at all it sits there as if I had told it to hlt. Could the problem be that I have a usb keyboard? Also I use MS's virtual PC to test it not Bochs. I couldn't get Bochs to work.
If you know a good tutorial or have suggestions/hints/help can you please tell me?
Anyways I have been trying to get information from the keyboard controller buffer. Primarrily I want it to keep checking the buffer when told to, and to updating something with the strokes (i'll need a bit help on that part. HECK I'll need help on quite a bit of this) When it encounters an "ENTER" then I want it to send this cumulated something that holds the keystokes to be checked against a list of valid options.
This is what I know that I believe will be needed:
1. 0x64 is the port with the status bit
2. 0x60 contains the actual data
3. it will employ a loop that waits for and enter stroke and when that happens then it will continue
4. to get it to show what has actually been typed it will keep calling Putch32 to write it.
5. When it encounters backspace it will need to remove the last byte from the something that holds all the keystrokes
That is about all I know of what needs to be done, but how to do it I have no clue, though I did see this in tutorial 7:
WaitLoop: in al, 64h ; Get status register value
and al, 10b ; Test bit 1 of status register
jz WaitLoop ; If status register bit not set, no data is in buffer
in al, 60h ; Its set--Get the byte from the buffer (Port 0x60), and store it
I believe that it does indeed monitor the buffer and when the buffer is filled with a keystroke then stores it. At the moment I using this code have it set to loop forever waiting for a keystroke.(using that code) when it gets one then it is sent to putch32. after the print I have it jump back and wait for another charecter. Unfortunally it doesn't work.
While fooling around I took out the jz line... It compiled. But had lots of the letter u with the accent over it. When I hit a key they all turned to the # sign.
I think that it can't retrieve the status of the buffer so it is waiting forever but it can't find it. No triple fault at all it sits there as if I had told it to hlt. Could the problem be that I have a usb keyboard? Also I use MS's virtual PC to test it not Bochs. I couldn't get Bochs to work.
If you know a good tutorial or have suggestions/hints/help can you please tell me?