From c9284cd93525436cc823258ab309c1b27eeec714 Mon Sep 17 00:00:00 2001
From: Mole Shang <135e2@135e2.dev>
Date: Sat, 10 Feb 2024 13:08:26 +0800
Subject: lab pgtbl: finish

---
 kernel/exec.c | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'kernel/exec.c')

diff --git a/kernel/exec.c b/kernel/exec.c
index e18bbb6..35b35f5 100644
--- a/kernel/exec.c
+++ b/kernel/exec.c
@@ -128,6 +128,10 @@ exec(char *path, char **argv)
   p->trapframe->sp = sp; // initial stack pointer
   proc_freepagetable(oldpagetable, oldsz);
 
+  if(p->pid == 1){
+    vmprint(p->pagetable);
+  }
+
   return argc; // this ends up in a0, the first argument to main(argc, argv)
 
  bad:
-- 
cgit v1.2.3