Reply 20 of 25, by vladstamate
- Rank
- Oldbie
wrote:Is there a way to prevent hardware interrupts from happening (such as preventing the CPU from responding to interrupts generated by key presses on the keyboard)? And instead put the CPU in charge of explicitly polling the keyboard (via the use of IN and OUT instructions) at points in the program where keyboard input is needed? That way I could use the IN and OUT instructions in my software directly (not depending on the underlying DOS OS do to it), and therefore I can avoid the use of INT calls, as well as avoid hardware interrupts being fired by the connected keyboard (and other input devices). Therefore I can prevent interrupts from happening that could kick the program's execution out of of its valid 32bit segment (which would otherwise crash the system). Is it possible to do this, completely disable the use of all interrupts, and instead depend on the use of IN and OUT, directly from the program itself?
Key presses generate another IRQ, so CLI would take care of that too. I would not worry about NMI as those only happen when something really bad happens. And I already gave you a bit of code to disable them as well anyway.
YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/