[SECTION .text] [EXTERN handle_keyboard] [GLOBAL handle_keyboard_asm] ; entry point for an interrupt to trigger a kernelpanic ; align 16 handle_keyboard_asm: ; The interrupt may be triggered asynchronously, therefore the whole context ; has to be saved and restored, or the interrupted code might not be able to ; continue. The C++ compiler will only generates code to preserve ; non-scratch registers in the high-level interrupt handler -- the scratch ; registers have to be saved (and restored later) manually! ; TODO: Implement the context save and restore for the keyboard interrupt ; ; push rax; push rdi; push rsi; push rdx; push rcx; push r8; push r9; push r10; push r11; call handle_keyboard; pop r11; pop r10; pop r9; pop r8; pop rcx; pop rdx; pop rsi; pop rdi; pop rax; add rsp, 4; iret ;