Polling with Interrupts?

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
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Polling with Interrupts?

Post by 01000101 »

I would like to know if there is a way to do a dedicated never-ending loop styled polling system but include the ability to still accept things like keyboard interrupts?

Example: A dedicated network box that implements polling non-stop of network packets, can it be setup to still catch the keyboard scancodes from the handler?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

yes...

Code: Select all

sti
.loop:
<do poll check>
jmp .loop

interrupt_handler:
<do_interrupt_stuff>
iret
why wouldn't that work?
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

of course... thats what interupts are for

you can poll anything you would like, as long as anything that needs to interupt it uses interupts

if you mean not using interupts at all and polling all devices, well thats a significantly more complex issue
Post Reply