From 593bf4df3d8db49286c1a7ae4ef75c887b629930 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 17 May 2012 17:56:23 +0200 Subject: Devices using the VFS structure. Basic keyboard handler. --- src/kernel/mem/gdt.cpp | 3 --- src/kernel/mem/mem.cpp | 11 ----------- src/kernel/mem/paging.cpp | 20 ++++++++------------ 3 files changed, 8 insertions(+), 26 deletions(-) (limited to 'src/kernel/mem') 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 -#include 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 -#include #include "paging.h" #include @@ -88,12 +87,6 @@ void* ksbrk(size_t size) { size_t tmp = mem_placementAddr; size_t er_begin, er_end, i; - /* (DBG) 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("\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 #include -#include #include "mem.h" #include "seg.h" #include #include +#include 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; -- cgit v1.2.3