Writing keyboard driver & Porting scanf

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.
Post Reply
EgeO
Posts: 9
Joined: Wed Jul 23, 2014 2:03 am

Writing keyboard driver & Porting scanf

Post by EgeO »

Hello I am trying to make a keyboard driver for my "os" to create something equivalent to scanf.But I can't even make user input a character. How can I write a keyboard driver? Thanks.(I checked others projects and tried to make their keyboard driver work on mine but its not working)
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Writing keyboard driver & Porting scanf

Post by deleted »

First: Get a working Interrupt Service Routine system going,
Second: Write an ISR handler in assembly,
Third: Write a GDT service,
Fourth: Write a VGA driver,
5th: Write a keyboard driver, that when the keyboard interrupt is fired from the proccesser, is set to get the pressed key, then print it to the screen.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Writing keyboard driver & Porting scanf

Post by Combuster »

Assuming that you have a functional print and timer interrupt already (because those are easier, and test important fundamental parts), can you get interrupts for individual keystrokes yet?

Third: Write a GDT service,
You can't even do 1 and 2 without a GDT.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
kutkloon7
Member
Member
Posts: 98
Joined: Fri Jan 04, 2013 6:56 pm

Re: Writing keyboard driver & Porting scanf

Post by kutkloon7 »

Try reading http://www.brokenthorn.com/Resources/OSDev19.html
That is, if you have all the other things that Combuster and the guy with the hard username listed (though a complete VGA driver doesn't seem necessary)
User avatar
deleted
Member
Member
Posts: 82
Joined: Mon Jul 21, 2014 7:23 pm

Re: Writing keyboard driver & Porting scanf

Post by deleted »

Hehe oops Combuster, I must have gotten them out of order :oops:
azblue
Member
Member
Posts: 147
Joined: Sat Feb 27, 2010 8:55 pm

Re: Writing keyboard driver & Porting scanf

Post by azblue »

One thing I tried first that might make things easier: For your first keyboard driver, just display the hex values of the scan codes. That's it. There's virtually no work to do; after you write it play around a bit, pressing and releasing various keys and ensuring you're getting the codes you'd expect. Obviously that's not a useful driver, but it is an easy way to get through the first baby step.
Post Reply