35 lines
498 B
Plaintext
35 lines
498 B
Plaintext
include print "../io/print.dsa"
|
|
|
|
dw idt: 0xFFFF0000
|
|
|
|
setup_idt:
|
|
push bpr
|
|
mov spr, bpr
|
|
|
|
// load the IDT into the IDR
|
|
ldw idt, idr
|
|
|
|
mov bpr, spr
|
|
pop bpr
|
|
return
|
|
|
|
setup_hard_fault_handler:
|
|
push bpr
|
|
mov spr, bpr
|
|
|
|
lwi handle_hard_fault, rg0
|
|
stw rg0, idr, 4
|
|
|
|
mov bpr, spr
|
|
pop bpr
|
|
return
|
|
|
|
dw hard_fault_err: "FATAL: Illegal Instruction or Memory Access!"
|
|
handle_hard_fault:
|
|
call print::reset
|
|
lwi hard_fault_err, rg0
|
|
push rg0
|
|
call print::print
|
|
pop zero
|
|
hlt
|