OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 8:03 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Multiple Keys on Return at First
PostPosted: Sat May 16, 2009 9:14 pm 
Offline

Joined: Sat May 16, 2009 4:30 pm
Posts: 9
I implemented a fixed PIC and have set up the KeyCode Descriptor Table, but I have an error.
I already fixed the keys so that I shouldn't get a repeated (make/break) key, but I do have an issue.

Ok, so as a test right now I just have my OS infinitely call my getKey method and display that character on the screen. It works fine after you enter like three letters, but I get problems during the first part.

As a note when you look at the screenshot, any "unprintable characters" are at the moment being handled by just acting like the '*' character! Keep that in mind.


Code:
char Keyboard::getChar()
{
   char toRet;
   while (toRet == keyOp)
   {
      toRet = readInC(0x60);
   }
   if (stopRepeat)
   {
      keyOp = toRet;
      stopRepeat = false;
      return 0;
   }
   keyOp = toRet;
   stopRepeat = true;
   return KEYCODE[toRet-1];
}


Any ideas?

(Included a screen shot)
In my screen shot I typed the keys: "hello, world (enter) (enter) what is up?" to show you what it does...


Attachments:
File comment: Note that
"Hello"
"Welcome to A.E.R.I.O.S."
is printed by the OS.

error.jpg
error.jpg [ 24.42 KiB | Viewed 736 times ]
Top
 Profile  
 
 Post subject: Re: Multiple Keys on Return at First
PostPosted: Sat May 16, 2009 10:00 pm 
Offline

Joined: Sat May 16, 2009 4:30 pm
Posts: 9
The following code I tried also is buggy...

Code:
   char toRet = 0;
   do
   {
      toRet = readInC(0x60);
   } while (!(readInC(0x64) & 1));

   if ((toRet & 0x80))
   {
      return 0;
   }
   else
   {
      keyOp = toRet;
      return KEYCODE[toRet-1];
   }


what is ends up doing is screwing up at the start, but also some characters I have to press a couple times or hold down to get them to appear...


Top
 Profile  
 
 Post subject: Re: Multiple Keys on Return at First
PostPosted: Sat May 16, 2009 10:11 pm 
Offline

Joined: Sat May 16, 2009 4:30 pm
Posts: 9
Sorry about posting on my own thing...


Ignore this thread ya'll, I'm going to go the IRQ route.


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: Bing [Bot] and 267 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