From 08b8b6f41f5e3438fa241fba23f9f04f6293d8c8 Mon Sep 17 00:00:00 2001 From: Xavier Yao Date: Thu, 6 Dec 2018 20:29:00 +0800 Subject: [PATCH 1/2] print schedule info --- kern/schedule/sched.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kern/schedule/sched.c b/kern/schedule/sched.c index f66c6e1..5f39849 100644 --- a/kern/schedule/sched.c +++ b/kern/schedule/sched.c @@ -92,10 +92,11 @@ schedule(void) { } next->runs ++; if (next != current) { - //kprintf("########################\n"); - //kprintf("c %d TO %d\n", current->pid, next->pid); - //print_trapframe(next->tf); - //kprintf("@@@@@@@@@@@@@@@@@@@@@@@@\n"); + kprintf("########################\n"); + kprintf("c %d TO %d\n", current->pid, next->pid); + // !!! Comment out the next line, then it will work. + print_trapframe(next->tf); + kprintf("@@@@@@@@@@@@@@@@@@@@@@@@\n"); proc_run(next); } } From 082f87dd438b24a9e4de2a22de5a1acf5fb9ae01 Mon Sep 17 00:00:00 2001 From: Xavier Yao Date: Thu, 6 Dec 2018 20:31:49 +0800 Subject: [PATCH 2/2] another way to trigger --- kern/init/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kern/init/init.c b/kern/init/init.c index eaf41f1..a47f530 100644 --- a/kern/init/init.c +++ b/kern/init/init.c @@ -51,6 +51,9 @@ kern_init(void) { proc_init(); // init process table ide_init(); + + // schedule(); // call schedule here will trigger a bug + fs_init(); usb_sl811_init();