From 7c3029322ed14a27ae80f5a1aa65a7958dcf2e96 Mon Sep 17 00:00:00 2001 From: Rachit-Bhalani Date: Thu, 19 Mar 2026 22:59:34 +0530 Subject: [PATCH] Fix caller-saved register explanation in p18-sched.md It should have been caller of swtch instead of callee --- p18-sched.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p18-sched.md b/p18-sched.md index 84be879..ff3b3e9 100644 --- a/p18-sched.md +++ b/p18-sched.md @@ -30,7 +30,7 @@ the compiler. If we search `swtch` in `kernel.asm`, we see the following code: `eax` and `edx` registers are pushed on the stack. `eip` will be saved as the return address by the `call` instruction itself. Interestingly, `ecx` is also a -caller-saved register, but since the callee of `swtch`, i.e, `scheduler`, did +caller-saved register, but since the caller of `swtch`, i.e, `scheduler`, did not modify `ecx`, the compiler chose to not save it. Caller of `scheduler` would have already saved it. @@ -81,4 +81,4 @@ sometimes process 2 is running: 2 runble initcode 1 runble initcode 2 run initcode -``` \ No newline at end of file +```