]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Add sentinel ebp values
authorRohan Bafna <rbafna3@gatech.edu>
Sun, 12 Jan 2025 21:54:42 +0000 (16:54 -0500)
committerRohan Bafna <rbafna3@gatech.edu>
Sun, 12 Jan 2025 21:54:42 +0000 (16:54 -0500)
kernel/src/asm/entry.S
kernel/src/asm/entryother.S
kernel/src/asm/trapasm.S
kernel/src/proc.c

index b3f1afc085b717a37d2869e8d82418314951ba1a..eceb260d81579380bed60c1d0657963130d41c85 100644 (file)
@@ -55,6 +55,9 @@ entry:
   orl     $(CR0_PG|CR0_WP), %eax
   movl    %eax, %cr0
 
+  # LAB 1: Set sentinel value of %ebp
+  movl    $0xF00, %ebp
+
   # Set up the stack pointer.
   movl $(stack + KSTACKSIZE), %esp
 
index 757e7f93ac9e37bbc168fed512bc9069bfb8ce3a..0d36df6a33199c8703e00fb4fd16db88ad2c6500 100644 (file)
@@ -67,6 +67,9 @@ start32:
   orl     $(CR0_PE|CR0_PG|CR0_WP), %eax
   movl    %eax, %cr0
 
+  # LAB 1: Set sentinel value of %ebp
+  movl    $0xF00, %ebp
+
   # Switch to the stack allocated by startothers()
   movl    (start-4), %esp
   # Call mpenter()
index da8aefc92ffebf64d354eb460efd44e3ce3bb59f..c0d061afbdaff7fc9bfcff08ff30d58d464f3c0d 100644 (file)
@@ -15,6 +15,9 @@ alltraps:
   movw %ax, %ds
   movw %ax, %es
 
+  # LAB 1: Set sentinel value of %ebp
+  movl $0xF00, %ebp
+
   # Call trap(tf), where tf=%esp
   pushl %esp
   call trap
index c140f40d1f88a042d8243359613d9d37123d3f11..64d3fdf3ccaa82523c10408285989705b9378c91 100644 (file)
@@ -113,6 +113,8 @@ found:
   p->context = (struct context*)sp;
   memset(p->context, 0, sizeof *p->context);
   p->context->eip = (uint)forkret;
+  // LAB 1: Set sentinel value of %ebp
+  p->context->ebp = 0xF00;
 
   return p;
 }