Remove interrupt_occurred
/reset_interrupt_flag
from Input
/Output
#182
Labels
🐛 bug
Something isn't working..
➕ improvement
Chores and fixes: the small things.
P-low
Low priority
T-peripheral traits
Topic: Peripheral Traits
what
As per the book, interrupts for the keyboard and display peripherals occur when the ready bit (i.e.
current_data_unread
) is high and when interrupts are enabled (interrupt_enabled
).We don't have an additional state for "interrupts are not enabled but an interrupt has occurred and is pending", i.e.: disabling interrupts clears any pending interrupts.
Similarly,
reset_interrupt_flag
is redundant:read_data
clears the ready bit and that's all we need.What we want instead is to have
read_data
be separate fromclear_data
on theInput
trait (and to have some accesses – like tui and control memory accesses to the data - not callclear_data
).misc
As a separate thing, as per the book, the keyboard simply does not accept new input when the ready bit is already high (§9.2.2.2):
This results in new key presses being discarded and the first unread key press being retained. This is in contrast to how our
InputShim
works today (it retains the last entered key press).We should:
Input
traitInputShim
impl to matchInputShim
steps
interrupt_occurred
andreset_interrupt_flag
from the I/O traitswhere
branch:
imp/io-trait-reform
core/traits/src/peripherals/input.rs
Line 24 in 5e0f0eb
core/traits/src/peripherals/output.rs
Line 19 in 5e0f0eb
open questions
The text was updated successfully, but these errors were encountered: