From 0ced0771226f8e0ed89a5b0d8a1b3acf0e10ea3e Mon Sep 17 00:00:00 2001 From: ChUrl Date: Sun, 24 Jul 2022 21:49:04 +0200 Subject: [PATCH] move logger --- c_os/devices/CGA.cc | 2 +- c_os/devices/VESA.h | 2 +- c_os/devices/fonts/Fonts.h | 14 ++++++++------ c_os/kernel/Paging.cc | 2 +- c_os/kernel/allocator/BumpAllocator.h | 2 +- c_os/kernel/allocator/LinkedListAllocator.cc | 2 +- c_os/kernel/allocator/LinkedListAllocator.h | 2 +- c_os/kernel/allocator/TreeAllocator.h | 2 +- c_os/kernel/interrupts/IntDispatcher.h | 2 +- c_os/kernel/threads/Scheduler.h | 2 +- c_os/kernel/threads/Thread.h | 2 +- c_os/user/event/KeyEventManager.h | 2 +- c_os/user/lib/String.cc | 3 +-- c_os/user/lib/{ => mem}/Memory.cc | 2 +- c_os/user/lib/{ => mem}/Memory.h | 0 c_os/user/lib/{ => utility}/Logger.cc | 2 +- c_os/user/lib/{ => utility}/Logger.h | 0 17 files changed, 22 insertions(+), 21 deletions(-) rename c_os/user/lib/{ => mem}/Memory.cc (86%) rename c_os/user/lib/{ => mem}/Memory.h (100%) rename c_os/user/lib/{ => utility}/Logger.cc (99%) rename c_os/user/lib/{ => utility}/Logger.h (100%) diff --git a/c_os/devices/CGA.cc b/c_os/devices/CGA.cc index 61c8c84..b3d3985 100755 --- a/c_os/devices/CGA.cc +++ b/c_os/devices/CGA.cc @@ -12,7 +12,7 @@ * Aenderungen von Michael Schoettner, HHU, 21.8.2016 * *****************************************************************************/ #include "devices/CGA.h" -#include "user/lib/Memory.h" +#include "user/lib/mem/Memory.h" const IOport CGA::index_port(0x3d4); const IOport CGA::data_port(0x3d5); diff --git a/c_os/devices/VESA.h b/c_os/devices/VESA.h index 82decd7..e0bbebf 100644 --- a/c_os/devices/VESA.h +++ b/c_os/devices/VESA.h @@ -12,7 +12,7 @@ #define VESA_include__ #include "devices/LFBgraphics.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" // Ausgewaehlte Grafikmodi mit Mode-Nummer constexpr const unsigned int MODE_640_480_16BITS = 0x111; diff --git a/c_os/devices/fonts/Fonts.h b/c_os/devices/fonts/Fonts.h index 64c187b..ee1b8eb 100644 --- a/c_os/devices/fonts/Fonts.h +++ b/c_os/devices/fonts/Fonts.h @@ -11,6 +11,8 @@ #ifndef FONTS_H__ #define FONTS_H__ +#include "user/lib/Array.h" + class Font { public: virtual ~Font() = default; @@ -48,12 +50,12 @@ extern const unsigned char fontdata_pearl_8x8[]; extern const unsigned char fontdata_sun_12x22[]; extern const unsigned char fontdata_sun_8x16[]; -typedef FontInstance<8, 16, fontdata_8x16> Font_8x16; -typedef FontInstance<8, 8, fontdata_8x8> Font_8x8; -typedef FontInstance<8, 8, acorndata_8x8> Font_acorn_8x8; -typedef FontInstance<8, 8, fontdata_pearl_8x8> Font_pearl_8x8; -typedef FontInstance<12, 22, fontdata_sun_12x22> Font_sun_12x22; -typedef FontInstance<8, 16, fontdata_sun_8x16> Font_sun_8x16; +using Font_8x16 = FontInstance<8, 16, fontdata_8x16>; +using Font_8x8 = FontInstance<8, 8, fontdata_8x8>; +using Font_acorn_8x8 = FontInstance<8, 8, acorndata_8x8>; +using Font_pearl_8x8 = FontInstance<8, 8, fontdata_pearl_8x8>; +using Font_sun_12x22 = FontInstance<12, 22, fontdata_sun_12x22>; +using Font_sun_8x16 = FontInstance<8, 16, fontdata_sun_8x16>; extern const Font_8x16 std_font_8x16; extern const Font_8x8 std_font_8x8; diff --git a/c_os/kernel/Paging.cc b/c_os/kernel/Paging.cc index 215b21e..fdbd319 100644 --- a/c_os/kernel/Paging.cc +++ b/c_os/kernel/Paging.cc @@ -50,7 +50,7 @@ *****************************************************************************/ #include "kernel/Paging.h" #include "kernel/Globals.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" // Bits fuer Eintraege in der Page-Table constexpr const unsigned int PAGE_PRESENT = 0x001; diff --git a/c_os/kernel/allocator/BumpAllocator.h b/c_os/kernel/allocator/BumpAllocator.h index 28aea7a..317d5c6 100755 --- a/c_os/kernel/allocator/BumpAllocator.h +++ b/c_os/kernel/allocator/BumpAllocator.h @@ -13,7 +13,7 @@ #define BumpAllocator_include__ #include "kernel/Allocator.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" class BumpAllocator : Allocator { private: diff --git a/c_os/kernel/allocator/LinkedListAllocator.cc b/c_os/kernel/allocator/LinkedListAllocator.cc index db60bf7..56cdd3b 100755 --- a/c_os/kernel/allocator/LinkedListAllocator.cc +++ b/c_os/kernel/allocator/LinkedListAllocator.cc @@ -11,7 +11,7 @@ #include "kernel/allocator/LinkedListAllocator.h" #include "kernel/Globals.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" // I don't order the list by size so that the block order corresponds to the location in memory // Then I can easily merge adjacent free blocks by finding the previous block without looking at diff --git a/c_os/kernel/allocator/LinkedListAllocator.h b/c_os/kernel/allocator/LinkedListAllocator.h index d5a7b68..e97de0b 100755 --- a/c_os/kernel/allocator/LinkedListAllocator.h +++ b/c_os/kernel/allocator/LinkedListAllocator.h @@ -14,7 +14,7 @@ #include "kernel/Allocator.h" #include "lib/SpinLock.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" // Format eines freien Blocks, 4 + 4 + 4 Byte typedef struct free_block { diff --git a/c_os/kernel/allocator/TreeAllocator.h b/c_os/kernel/allocator/TreeAllocator.h index e04e393..186686a 100755 --- a/c_os/kernel/allocator/TreeAllocator.h +++ b/c_os/kernel/allocator/TreeAllocator.h @@ -2,7 +2,7 @@ #define TreeAllocator_include__ #include "kernel/Allocator.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" // I can't imagine that this is fast with all the tree logic? diff --git a/c_os/kernel/interrupts/IntDispatcher.h b/c_os/kernel/interrupts/IntDispatcher.h index a3ee707..491c222 100755 --- a/c_os/kernel/interrupts/IntDispatcher.h +++ b/c_os/kernel/interrupts/IntDispatcher.h @@ -14,8 +14,8 @@ #define IntDispatcher_include__ #include "kernel/interrupts/ISR.h" -#include "user/lib/Logger.h" #include "user/lib/Array.h" +#include "user/lib/utility/Logger.h" class IntDispatcher { private: diff --git a/c_os/kernel/threads/Scheduler.h b/c_os/kernel/threads/Scheduler.h index aac9be7..6f9fd46 100644 --- a/c_os/kernel/threads/Scheduler.h +++ b/c_os/kernel/threads/Scheduler.h @@ -13,8 +13,8 @@ #define Scheduler_include__ #include "kernel/threads/Thread.h" -#include "user/lib/Logger.h" #include "user/lib/mem/UniquePointer.h" +#include "user/lib/utility/Logger.h" #include "user/lib/Vector.h" class Scheduler { diff --git a/c_os/kernel/threads/Thread.h b/c_os/kernel/threads/Thread.h index 0dea417..cc63a33 100644 --- a/c_os/kernel/threads/Thread.h +++ b/c_os/kernel/threads/Thread.h @@ -28,7 +28,7 @@ #ifndef Thread_include__ #define Thread_include__ -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" class Thread { private: diff --git a/c_os/user/event/KeyEventManager.h b/c_os/user/event/KeyEventManager.h index f9811ac..b69acee 100644 --- a/c_os/user/event/KeyEventManager.h +++ b/c_os/user/event/KeyEventManager.h @@ -2,7 +2,7 @@ #define KeyEventManager_Include_H_ #include "user/event/KeyEventListener.h" -#include "user/lib/Logger.h" +#include "user/lib/utility/Logger.h" #include "user/lib/Vector.h" // NOTE: Could do this more generally but we only have key events diff --git a/c_os/user/lib/String.cc b/c_os/user/lib/String.cc index 69bd10b..25dee1a 100644 --- a/c_os/user/lib/String.cc +++ b/c_os/user/lib/String.cc @@ -1,6 +1,5 @@ #include "user/lib/String.h" -#include "user/lib/Math.h" -#include "user/lib/Memory.h" +#include "user/lib/mem/Memory.h" unsigned int bse::strlen(const char* str) { const char* current = str; diff --git a/c_os/user/lib/Memory.cc b/c_os/user/lib/mem/Memory.cc similarity index 86% rename from c_os/user/lib/Memory.cc rename to c_os/user/lib/mem/Memory.cc index 7ec01b2..9abdb4d 100755 --- a/c_os/user/lib/Memory.cc +++ b/c_os/user/lib/mem/Memory.cc @@ -1,4 +1,4 @@ -#include "user/lib/Memory.h" +#include "Memory.h" void bse::memset(char* destination, const char value, const unsigned int bytes) { for (unsigned int byte = 0; byte < bytes; ++byte) { diff --git a/c_os/user/lib/Memory.h b/c_os/user/lib/mem/Memory.h similarity index 100% rename from c_os/user/lib/Memory.h rename to c_os/user/lib/mem/Memory.h diff --git a/c_os/user/lib/Logger.cc b/c_os/user/lib/utility/Logger.cc similarity index 99% rename from c_os/user/lib/Logger.cc rename to c_os/user/lib/utility/Logger.cc index 2d1482e..04fffdb 100644 --- a/c_os/user/lib/Logger.cc +++ b/c_os/user/lib/utility/Logger.cc @@ -1,4 +1,4 @@ -#include "user/lib/Logger.h" +#include "Logger.h" #include "kernel/Globals.h" bool Logger::kout_enabled = true; diff --git a/c_os/user/lib/Logger.h b/c_os/user/lib/utility/Logger.h similarity index 100% rename from c_os/user/lib/Logger.h rename to c_os/user/lib/utility/Logger.h