summaryrefslogtreecommitdiff
path: root/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'console.c')
-rw-r--r--console.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/console.c b/console.c
index 27649e6..394176b 100644
--- a/console.c
+++ b/console.c
@@ -9,6 +9,7 @@
#include "spinlock.h"
#include "fs.h"
#include "file.h"
+#include "memlayout.h"
#include "mmu.h"
#include "proc.h"
#include "x86.h"
@@ -60,6 +61,9 @@ cprintf(char *fmt, ...)
if(locking)
acquire(&cons.lock);
+ if (fmt == 0)
+ panic("null fmt");
+
argp = (uint*)(void*)(&fmt + 1);
state = 0;
for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
@@ -121,7 +125,7 @@ panic(char *s)
//PAGEBREAK: 50
#define BACKSPACE 0x100
#define CRTPORT 0x3d4
-static ushort *crt = (ushort*)0xb8000; // CGA memory
+static ushort *crt = (ushort*)P2V(0xb8000); // CGA memory
static void
cgaputc(int c)