summaryrefslogtreecommitdiff
path: root/src/kernel/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem')
-rw-r--r--src/kernel/mem/gdt.cpp3
-rw-r--r--src/kernel/mem/mem.cpp11
-rw-r--r--src/kernel/mem/paging.cpp20
3 files changed, 8 insertions, 26 deletions
diff --git a/src/kernel/mem/gdt.cpp b/src/kernel/mem/gdt.cpp
index 49fbd82..cca1767 100644
--- a/src/kernel/mem/gdt.cpp
+++ b/src/kernel/mem/gdt.cpp
@@ -1,6 +1,5 @@
#include "gdt.h"
#include <stdlib_common.h>
-#include <core/monitor.h>
extern "C" void gdt_flush(uint32_t); //ASM (imported from idt_.asm)
extern "C" void tss_flush();
@@ -59,6 +58,4 @@ void gdt_init() {
gdt_flush((uint32_t)&gdt_ptr);
tss_flush();
-
- monitor_write("[GDT] ");
}
diff --git a/src/kernel/mem/mem.cpp b/src/kernel/mem/mem.cpp
index 5e04de3..dfdd5dd 100644
--- a/src/kernel/mem/mem.cpp
+++ b/src/kernel/mem/mem.cpp
@@ -1,6 +1,5 @@
#include "mem.h"
#include <core/sys.h>
-#include <core/monitor.h>
#include "paging.h"
#include <config.h>
@@ -88,12 +87,6 @@ void* ksbrk(size_t size) {
size_t tmp = mem_placementAddr;
size_t er_begin, er_end, i;
- /* (DBG) monitor_write("<ksbrk ");
- monitor_writeHex(size);
- monitor_write(":");
- monitor_writeHex(tmp);
- monitor_write("> "); */
-
mem_placementAddr += size;
if (_no_more_ksbrk) { // paging enabled, we must allocate these pages
@@ -125,10 +118,6 @@ void* ksbrk(size_t size) {
}
void kbrk(void* ptr) {
- monitor_write("<kbrk ");
- monitor_writeHex((uint32_t)ptr);
- monitor_write(">\n");
-
if ((size_t)ptr > (size_t)&end) {
ksbrk((size_t)ptr - (size_t)mem_placementAddr);
} else {
diff --git a/src/kernel/mem/paging.cpp b/src/kernel/mem/paging.cpp
index 206cc08..01a1780 100644
--- a/src/kernel/mem/paging.cpp
+++ b/src/kernel/mem/paging.cpp
@@ -1,11 +1,11 @@
#include "paging.h"
#include <bitset.h>
#include <stdlib_common.h>
-#include <core/monitor.h>
#include "mem.h"
#include "seg.h"
#include <core/sys.h>
#include <task/task.h>
+#include <ui/vt.h>
static bitset frames;
@@ -57,10 +57,7 @@ void paging_init(size_t totalRam) {
kernel_pagedir->tables[i] = kernel_pagedir->tables[i + FIRST_KERNEL_PAGETABLE];
}
- monitor_write("{PD: ");
- monitor_writeHex(kernel_pagedir->physicalAddr);
pagedir_switch(kernel_pagedir);
- monitor_write("} [Paging] ");
}
/* De-allocates pages at 0x00000000 where kernel code was read from with the GDT from loader_.asm. */
@@ -70,7 +67,6 @@ void paging_cleanup() {
kernel_pagedir->tablesPhysical[i] = 0;
kernel_pagedir->tables[i] = 0;
}
- monitor_write("[PD Cleanup] ");
}
/************************* PAGING EVERYDAY USE *****************************/
@@ -140,14 +136,14 @@ uint32_t paging_fault(registers *regs) {
}
if (seg == 0) {
- NL; WHERE; monitor_write("Unhandled Page Fault\t");
- monitor_write("cr2:"); monitor_writeHex(addr);
+ NL; WHERE; ke_vt->writeStr("Unhandled Page Fault\t");
+ ke_vt->writeStr("cr2:"); ke_vt->writeHex(addr);
NL; TAB;
- if (regs->err_code & 0x1) monitor_write("present"); TAB;
- if (regs->err_code & 0x2) monitor_write("write"); TAB;
- if (regs->err_code & 0x4) monitor_write("user"); TAB;
- if (regs->err_code & 0x8) monitor_write("rsvd"); TAB;
- if (regs->err_code & 0x10) monitor_write("opfetch");
+ if (regs->err_code & 0x1) ke_vt->writeStr("present"); TAB;
+ if (regs->err_code & 0x2) ke_vt->writeStr("write"); TAB;
+ if (regs->err_code & 0x4) ke_vt->writeStr("user"); TAB;
+ if (regs->err_code & 0x8) ke_vt->writeStr("rsvd"); TAB;
+ if (regs->err_code & 0x10) ke_vt->writeStr("opfetch");
return 1;
}
return 0;