Grabbing keyboard input from user (PMODE)

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.
User avatar
imate900
Member
Member
Posts: 80
Joined: Sat Feb 28, 2009 11:43 am

Re: Grabbing keyboard input from user (PMODE)

Post by imate900 »

After exposing myself to http://files.osdev.org/mirrors/geezer/o ... m#snippets, this code should work:

Code: Select all

int monitor_getchar()
{
 int t = inb(0x64);
 do {
  t  = inb(0x64);
 } while (t == 0x00);
 return inb(0x60);
}
I can use the assembler snippet, or use this C code (pretty rusty, I think, but I think it works.)
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image
quok
Member
Member
Posts: 490
Joined: Wed Oct 18, 2006 10:43 pm
Location: Kansas City, KS, USA

Re: Grabbing keyboard input from user (PMODE)

Post by quok »

Locking this thread; the answer has been provided multiple times.

@inmate900: As has been pointed out to you, this question is easily answered by searching the osdev wiki. It's also been asked on the forums many times in the past. You've been found guilty of not following the forum rules. There's also a nice big link to the wiki on the top of the forum pages, specifically directing you to search the wiki first.

Also, read the responses to your questions, rather than just responding to them. You would have saved yourself heaps of trouble by actually reading the links that were provided to you.

While you're at it, go ahead and read this: http://www.catb.org/~esr/faqs/smart-questions.html (also linked to from the forum rules).

Thanks,

quok
Locked