diff options
author | dzwdz | 2021-07-22 19:45:32 +0200 |
---|---|---|
committer | dzwdz | 2021-07-22 19:45:32 +0200 |
commit | 32baea7d692191d7b6fdac5a93e95ca5e6e1f59a (patch) | |
tree | 0e43226d614a561bcd6b6751b72ef83549c9eb78 /src/kernel | |
parent | 4823f92f9d3feabdc758d8cd6eef855de90fee2a (diff) |
disable paging when handling interrupts
The kernel code assumes that paging is always disabled. I've also added
a bit of comments to the assembly / ruined the git blame.
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/arch/i386/interrupts/isr_stub.s | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/kernel/arch/i386/interrupts/isr_stub.s b/src/kernel/arch/i386/interrupts/isr_stub.s index a8a97b3..614dc7f 100644 --- a/src/kernel/arch/i386/interrupts/isr_stub.s +++ b/src/kernel/arch/i386/interrupts/isr_stub.s @@ -16,10 +16,19 @@ _isr_stage2: pop %eax add $-_isr_stubs, %eax shr $3, %eax - push %eax + // disable paging, if present + // it's done here so the stuff on the stack is in the right order + mov %cr0, %ebx + push %ebx + and $0x7FFFFFFF, %ebx + mov %ebx, %cr0 + + push %eax // push the vector nr call isr_stage3 - add $4, %esp + add $4, %esp // "pop" the vector nr + pop %eax // restore old cr0 + mov %eax, %cr0 popal iret |