Page 1 of 1
Writing keyboard driver & Porting scanf
Posted: Thu Aug 07, 2014 2:16 pm
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)
Re: Writing keyboard driver & Porting scanf
Posted: Thu Aug 07, 2014 2:47 pm
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.
Re: Writing keyboard driver & Porting scanf
Posted: Fri Aug 08, 2014 12:42 am
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.
Re: Writing keyboard driver & Porting scanf
Posted: Fri Aug 08, 2014 5:33 am
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)
Re: Writing keyboard driver & Porting scanf
Posted: Fri Aug 08, 2014 7:56 am
by deleted
Hehe oops Combuster, I must have gotten them out of order
Re: Writing keyboard driver & Porting scanf
Posted: Thu Aug 21, 2014 11:14 pm
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.