summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console.c')
-rw-r--r--console.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/console.c b/console.c
index 3745009..b85a295 100644
--- a/console.c
+++ b/console.c
@@ -4,6 +4,7 @@
#include "spinlock.h"
struct spinlock console_lock;
+int use_printf_lock = 0;
/*
* copy console output to parallel port, which you can tell
@@ -29,7 +30,8 @@ cons_putc(int c)
unsigned short *crt = (unsigned short *) 0xB8000; // base of CGA memory
int ind;
- //acquire(&console_lock);
+ if(use_printf_lock)
+ acquire(&console_lock);
lpt_putc(c);
@@ -62,7 +64,8 @@ cons_putc(int c)
outb(crtport, 15);
outb(crtport + 1, ind);
- //release(&console_lock);
+ if(use_printf_lock)
+ release(&console_lock);
}
void
@@ -127,6 +130,8 @@ cprintf(char *fmt, ...)
void
panic(char *s)
{
+ use_printf_lock = 0;
+ cprintf("panic: ");
cprintf(s, 0);
cprintf("\n", 0);
while(1)