From 824b8e9ddf1e05e734d6131b299207f6b8b63ec4 Mon Sep 17 00:00:00 2001 From: churl Date: Tue, 10 May 2022 00:21:00 +0200 Subject: [PATCH] use tree allocator --- c_os/kernel/Globals.cc | 3 ++- c_os/kernel/Globals.h | 4 +++- c_os/main.cc | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/c_os/kernel/Globals.cc b/c_os/kernel/Globals.cc index 659e0bc..4315324 100755 --- a/c_os/kernel/Globals.cc +++ b/c_os/kernel/Globals.cc @@ -16,4 +16,5 @@ CGA_Stream kout; // Ausgabe-Strom fuer Kernel Keyboard kb; // Tastatur unsigned int total_mem; // RAM total // BumpAllocator allocator; -LinkedListAllocator allocator; +// LinkedListAllocator allocator; +TreeAllocator allocator; diff --git a/c_os/kernel/Globals.h b/c_os/kernel/Globals.h index b7737d9..fa5bd5d 100755 --- a/c_os/kernel/Globals.h +++ b/c_os/kernel/Globals.h @@ -15,6 +15,7 @@ #include "devices/PCSPK.h" #include "kernel/allocator/BumpAllocator.h" #include "kernel/allocator/LinkedListAllocator.h" +#include "kernel/allocator/TreeAllocator.h" #include "kernel/CPU.h" extern CPU cpu; // CPU-spezifische Funktionen @@ -23,6 +24,7 @@ extern CGA_Stream kout; // Ausgabe-Strom fuer Kernel extern Keyboard kb; // Tastatur extern unsigned int total_mem; // RAM total // extern BumpAllocator allocator; -extern LinkedListAllocator allocator; +// extern LinkedListAllocator allocator; +extern TreeAllocator allocator; #endif diff --git a/c_os/main.cc b/c_os/main.cc index 90a1b80..49c784d 100755 --- a/c_os/main.cc +++ b/c_os/main.cc @@ -24,10 +24,12 @@ void scroll_mode() { switch ((char)key) { case 'k': - kout.show(kout.COLUMNS - 1, 0, (char)(48 + kout.scroll_page_backward())); + kout.scroll_page_backward(); + kout.show(kout.COLUMNS - 1, 0, (char)(48 + kout.current_page)); break; case 'j': - kout.show(kout.COLUMNS - 1, 0, (char)(48 + kout.scroll_page_forward())); + kout.scroll_page_forward(); + kout.show(kout.COLUMNS - 1, 0, (char)(48 + kout.current_page)); break; } }