diff --git a/kernel/intr/intr0.S b/kernel/intr/intr0.S index 9370e05..72f42cc 100644 --- a/kernel/intr/intr0.S +++ b/kernel/intr/intr0.S @@ -66,7 +66,9 @@ _push_regs cld movq %rsp, %rdi + sub $0x8, %rsp call intr_handleintr + add $0x8, %rsp _pop_regs add $0x10, %rsp iretq diff --git a/kernel/proc/switch.S b/kernel/proc/switch.S index d877ce1..4ed3afb 100644 --- a/kernel/proc/switch.S +++ b/kernel/proc/switch.S @@ -2,10 +2,7 @@ .global proc_switch proc_switch: - testq %rsi, %rsi - je 1f movq %rsi, %cr3 -1: mov %rdi, %rsp _pop_regs add $0x10, %rsp diff --git a/ulib/_start.S b/ulib/_start.S index 2a214d8..8a368b7 100644 --- a/ulib/_start.S +++ b/ulib/_start.S @@ -4,4 +4,9 @@ .global _start _start: + xor %rbp, %rbp + mov %rsp, %rbp + and $-0x10, %rsp + sub $0x8, %rsp + call _premain