From 91c637d847744ba410cbf0e20c62c485e1f6153d Mon Sep 17 00:00:00 2001
From: dzwdz
Date: Thu, 22 Jul 2021 19:53:52 +0200
Subject: don't map the VGA console buffer in user processes

---
 src/init/main.c   | 6 ------
 src/kernel/main.c | 3 ---
 2 files changed, 9 deletions(-)

(limited to 'src')

diff --git a/src/init/main.c b/src/init/main.c
index fda68b7..33a4372 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -13,12 +13,6 @@ int main() {
 	debuglog("hello from init! ",
 	  sizeof("hello from init! ") - 1);
 
-	// change the colors of VGA text
-	// doesn't require a lot of code, but still shows that it's working
-	uint8_t *vga = (void*) 0xB8000;
-	for (int i = 0; i < 80 * 25; i++)
-		vga[(i << 1) + 1] = 0x4e;
-
 	// try to mess with kernel memory
 	uint8_t *kernel = (void*) 0x100000;
 	*kernel = 0; // should segfault
diff --git a/src/kernel/main.c b/src/kernel/main.c
index 729e39d..004be15 100644
--- a/src/kernel/main.c
+++ b/src/kernel/main.c
@@ -10,9 +10,6 @@ static void run_init(struct kmain_info *info) {
 	struct process *proc = process_new();
 	void *init_base = (void*) 0x200000;
 
-	// map VGA for testing
-	pagedir_map(proc->pages, 0xB8000, 0xB8000, true, true);
-
 	// map the module as rw
 	for (uintptr_t off = 0; off < info->init.size; off += PAGE_SIZE)
 		pagedir_map(proc->pages, init_base + off, info->init.at + off,
-- 
cgit v1.2.3