OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Keyboard in Protected Mode
PostPosted: Thu Aug 01, 2002 11:44 am 
I'm moving from real mode ;D to protected mode, but My procedure I used in rmode for detecting keypresses won't work in pmode because it uses interrupts! How do I get keyboard input in protected mode? (i sure hope it doesn't involve v86 mode or programming the PIC ;) )

[glow=red,2,300]Thanx[/glow]


Top
  
 
 Post subject: Re:Keyboard in Protected Mode
PostPosted: Thu Aug 01, 2002 2:04 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
well, the most basic technique you can do is polling the 0x60 port for new datas:

char waitkey()
{ char k;
while ((k=inb(0x60))<128);
while (inb(0x60)>128);
}

Otherwise, you'll have to remap the interrupt vectors of 8259a to avoid collision with pmode exception and then ... you're back in terra cognita ;)

sample code for 8259a re-programming can be found in my SOS system here

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re: Re:Keyboard in Protected Mode
PostPosted: Fri Jan 11, 2019 4:39 am 
Offline

Joined: Tue Jan 08, 2019 7:20 am
Posts: 20
Pype.Clicker wrote:
well, the most basic technique you can do is polling the 0x60 port for new datas:

char waitkey()
{ char k;
while ((k=inb(0x60))<128);
while (inb(0x60)>128);
}

Otherwise, you'll have to remap the interrupt vectors of 8259a to avoid collision with pmode exception and then ... you're back in terra cognita ;)

sample code for 8259a re-programming can be found in my SOS system here

What's the inb function doing?

_________________
Hello world!


Top
 Profile  
 
 Post subject: Re: Keyboard in Protected Mode
PostPosted: Fri Jan 11, 2019 5:24 am 
Offline
Member
Member
User avatar

Joined: Mon Jul 13, 2009 5:52 am
Posts: 99
Location: Denmark
Reviving a 17 year old post? :shock:

The inb function reads a byte from an I/O port. It is an assembly instruction, have look in the wiki to see how it can be used from C: https://wiki.osdev.org/Inline_Assembly/ ... 2FO_access


Top
 Profile  
 
 Post subject: Re: Keyboard in Protected Mode
PostPosted: Fri Jan 11, 2019 11:07 am 
Offline
Member
Member
User avatar

Joined: Mon Sep 03, 2018 2:25 am
Posts: 66
Please don't bump old posts, especially posts from almost 17 years ago. I'll assume you haven't been on a lot of forums, so please read the forum rules so this won't happen again

viewtopic.php?f=1&t=16944

-thomtl


Top
 Profile  
 
 Post subject: Re: Keyboard in Protected Mode
PostPosted: Fri Jan 11, 2019 1:01 pm 
Offline
Member
Member
User avatar

Joined: Thu Mar 10, 2016 7:35 am
Posts: 167
Location: Lancaster, England, Disunited Kingdom
Well let's consider one of those rules:

Quote:
The Official Forum Rules

1: Please try not to ask answered questions.
Many questions have been asked, and many have been answered. Before you post it's a very good idea to search the forum, the wiki, and even the entire web.


Strikes me that is exactly what has been done here. The answer sought for and found didn't quite answer everything and clarification was sought.
That proper behaviour has been rewarded with two put downs.


Top
 Profile  
 
 Post subject: Re: Keyboard in Protected Mode
PostPosted: Fri Jan 11, 2019 1:22 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
You're ignoring the fact that the simplest of searches (Google "inb function") will give a wealth of results showing exactly what the function does.

I agree with the "put downs" - bumping a seventeen-year old thread is not good practice. If necessary start a new thread.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [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