From 4dc44e8fce222a21f5eb8b86ecb226855c34999b Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 31 Mar 2025 12:41:04 -0400 Subject: track upstream --- kernel/isrs.S | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'kernel/isrs.S') diff --git a/kernel/isrs.S b/kernel/isrs.S index ec539f2..f5fdbca 100644 --- a/kernel/isrs.S +++ b/kernel/isrs.S @@ -19,6 +19,8 @@ # .arch i386 #include +#include +#include /* ** Configuration options - define in Makefile @@ -100,8 +102,8 @@ isr_save: ** ** Set up parameters for the ISR call. */ - movl 52(%esp),%eax // get vector number and error code - movl 56(%esp),%ebx + movl CTX_vector(%esp),%eax // get vector number and error code + movl CTX_code(%esp),%ebx /* *********************** @@ -120,11 +122,12 @@ isr_save: // save the context pointer movl current, %edx - movl %esp, (%edx) + movl %esp, PCB_context(%edx) // also save the page directory pointer movl %cr3, %ecx - movl %ecx, 4(%edx) + addl $KERN_BASE, %ecx // convert to a virtual address + movl %ecx, PCB_pdir(%edx) // switch to the system stack // @@ -166,8 +169,9 @@ isr_restore: *********************** */ movl current, %ebx // return to the user stack - movl (%ebx), %esp // ESP --> context save area - movl 4(%ebx), %ecx // page directory pointer + movl PCB_context(%ebx), %esp // ESP --> context save area + movl PCB_pdir(%ebx), %ecx // page directory pointer + subl $KERN_BASE, %ecx // convert to a physical address movl %ecx, %cr3 // now we're operating with the user process' -- cgit v1.2.3-freya