Skip to main content

add_to_buffer

Function add_to_buffer 

Source
pub fn add_to_buffer(ch: u8)
Expand description

Add a character to the keyboard buffer (called from IRQ context).

Ctrl+C (0x03) is also pushed to the buffer but additionally sets the global crate::shell::SHELL_INTERRUPTED flag so that long-running commands can detect cancellation.

Must NOT call serial_force_println! or any lock that could contend with the interrupted task (e.g. FORCE_LOCK). Redox/Maestro/Asterinas keep IRQ handlers minimal; printing here can deadlock if the preempted task was holding FORCE_LOCK.