hello, i am writing a real mode os and my objective is to stop using bios. Currently I'm writing a ReadKey function:
Questions
-----------
1) How can I see if there are no keys pressed ??
2) How can I make a sleep procedure (maybe be with a for??)?, because when I press a key lots of chars appear on screen...
thanks
port 60
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
- matias_beretta
- Member
- Posts: 101
- Joined: Mon Feb 26, 2007 3:39 pm
so...
I heard that the keyboard interrupts is 9h so
;;;;;;;
push 0
pop es
mov word [es:36], handler
mov [es:38], cs
jmp $
handler:
in al, 96
iret
;;;;;;;
so each time i press any key, the scan code will be in AL?????
;;;;;;;
push 0
pop es
mov word [es:36], handler
mov [es:38], cs
jmp $
handler:
in al, 96
iret
;;;;;;;
so each time i press any key, the scan code will be in AL?????
MatÃas Beretta
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
- Combuster
- 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: port 60
@mikegonta:
@matias_beretta: if you would please refrain from asking the same question twice in different threads, we do not get the impression that you are elegible to an answer, which truthfully, you aren't.
Back to the original questions:
1) Keep track of all presses and releases, and you should be able to tell when there's no key left pressed.
2) use the keyboard's IRQ to tell when a key event has actually happened instead of reporting the same event over and over. If you want to build a sleep timer, consider using the PIT.
Bulls**t. You can theoretically use any style of device accesses with any operating mode.mikegonta wrote:Then stop using real mode.matias_beretta wrote:hello, i am writing a real mode os and my objective is to stop using bios.
That's advertising and not at all helpful for solving the problem.mikegonta wrote:Here is a simple example of "hooking" the keyboard int.matias_beretta wrote:How can I see if there are no keys pressed ??
(...)
the following assembled binary requires aeBIOS
@matias_beretta: if you would please refrain from asking the same question twice in different threads, we do not get the impression that you are elegible to an answer, which truthfully, you aren't.
Back to the original questions:
1) Keep track of all presses and releases, and you should be able to tell when there's no key left pressed.
2) use the keyboard's IRQ to tell when a key event has actually happened instead of reporting the same event over and over. If you want to build a sleep timer, consider using the PIT.