Page 2 of 2

Re: Grabbing keyboard input from user (PMODE)

Posted: Mon Apr 20, 2009 1:53 pm
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.)

Re: Grabbing keyboard input from user (PMODE)

Posted: Mon Apr 20, 2009 4:30 pm
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