From 5be0039ce9e22f140a29e167526c64c723c5be3c Mon Sep 17 00:00:00 2001 From: rtm Date: Thu, 10 Aug 2006 22:08:14 +0000 Subject: interrupts could be recursive since lapic_eoi() called before rti so fast interrupts overflow the kernel stack fix: cli() before lapic_eoi() --- main.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index b558e41..a7209b6 100644 --- a/main.c +++ b/main.c @@ -15,8 +15,6 @@ extern uchar _binary_user1_start[], _binary_user1_size[]; extern uchar _binary_usertests_start[], _binary_usertests_size[]; extern uchar _binary_userfs_start[], _binary_userfs_size[]; -extern int use_console_lock; - // CPU 0 starts running C code here. // This is called main0 not main so that it can have // a void return type. Gcc can't handle functions named @@ -27,28 +25,36 @@ main0(void) int i; struct proc *p; + lcr4(0); // xxx copy of cpu # + // clear BSS memset(edata, 0, end - edata); // Make sure interrupts stay disabled on all processors // until each signals it is ready, by pretending to hold // an extra lock. - for(i=0; i