diff options
author | Brett Weiland <brett_weiland@bpcspace.com> | 2021-08-24 14:09:29 -0500 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcspace.com> | 2021-08-24 14:09:29 -0500 |
commit | 9b22a6965579ea1867aea291d910c96f386b518b (patch) | |
tree | d06dbb9c4708f1cc713bcb115b32ff9bce4cf9b9 /src/kernel/isv_asm.asm | |
parent | bad4b0e9bdfee336bfc1c23761408279eaec1558 (diff) |
major backup 8.24.21
Diffstat (limited to 'src/kernel/isv_asm.asm')
-rw-r--r-- | src/kernel/isv_asm.asm | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/kernel/isv_asm.asm b/src/kernel/isv_asm.asm new file mode 100644 index 0000000..b770aaa --- /dev/null +++ b/src/kernel/isv_asm.asm @@ -0,0 +1,65 @@ +global timer_init_pit +global kernel_block +global fatal_hwexception +global fatal_hwexception_errcode +global lapic_timer_racefixer + +extern clear_int +extern panic +extern calibrate_lapic_waiting + +;I need to get my timing right and consistently boot smp, +;_then_ I'll work on cleaning this up. + +timer_init_pit: +cli +mov ecx, DWORD [rbx + 0x390] +mov DWORD [rbx + 0x380], 0 +in al, 0x61 +and al, 0xfe +out 0x61, al +mov DWORD [rbx + 0xb0], 0 +iretq + + +kernel_block: +call clear_int +iretq + + +fatal_hwexception: +push qword rdi +push qword rsi +push qword rdx +push qword rcx +push qword rbx +push qword rax +mov rdi, 0 +mov rdx, rsp +mov rsi, rdx +add rsi, 48 +call panic + +; rdi: reason +; rsi: frame +; rdx: regs + +; 0xffff80000010af70 +fatal_hwexception_errcode: +push qword rdi +push qword rsi +push qword rdx +push qword rcx +push qword rbx +push qword rax +mov rdi, 1 +mov rdx, rsp +mov rsi, rdx +add rsi, 48 +call panic + +lapic_timer_racefixer: ;in case the lapic makes it to zero, impliment me +inc rbx +call clear_int +mov QWORD [rsp], calibrate_lapic_waiting +iretq |