From 9aa0337dc1452a911ac52698c833246a618fc9f3 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Fri, 29 Jul 2011 07:31:27 -0400 Subject: Map kernel high Very important to give qemu memory through PHYSTOP :( --- console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'console.c') 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) -- cgit v1.2.3