Color support

This commit is contained in:
Alex
2022-10-11 00:46:51 +03:00
parent f7e316bdcb
commit 9c00c5ec4b
5 changed files with 43 additions and 4 deletions

View File

@ -4,9 +4,12 @@
#include <memory.hpp>
#include <string.h>
#include <printf.h>
#include <lock.hpp>
#include <time.hpp>
#include <debug.h>
NEWLOCK(KernelLock);
BootInfo *bInfo = nullptr;
Video::Display *Display = nullptr;
SymbolResolver::Symbols *KernelSymbolTable = nullptr;
@ -23,8 +26,9 @@ extern "C" int vprintf_(const char *format, va_list arg);
void KPrint(const char *format, ...)
{
SMARTLOCK(KernelLock);
Time tm = ReadClock();
printf_("[%02ld:%02ld:%02ld] ", tm.Hour, tm.Minute, tm.Second);
printf_("\eCCCCCC[\e00AEFF%02ld:%02ld:%02ld\eCCCCCC] ", tm.Hour, tm.Minute, tm.Second);
va_list args;
va_start(args, format);
vprintf_(format, args);
@ -48,7 +52,7 @@ EXTERNC void Entry(BootInfo *Info)
memcpy(bInfo, Info, sizeof(BootInfo));
debug("BootInfo structure is at %p", bInfo);
Display = new Video::Display(bInfo->Framebuffer[0]);
printf_("%s - %s(%s)\n", KERNEL_NAME, KERNEL_VERSION, GIT_COMMIT_SHORT);
printf_("\eFFFFFF%s - %s [\e058C19%s\eFFFFFF]\n", KERNEL_NAME, KERNEL_VERSION, GIT_COMMIT_SHORT);
/**************************************************************************************/
KPrint("Initializing GDT and IDT");
Interrupts::Initialize();