From 2a1e69c1fe299d6e2f03cb5ebc78e27de87d0662 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 24 Feb 2024 14:31:57 +0100 Subject: HCR-11 && HCR-14: Work had been done to bring driver support to hcore's kernel. - AHCI is the de-facto kernel driver. - Drivers will be loaded as processes (except the builtin disk driver) - A GUI subsystem is in progress. Signed-off-by: Amlal El Mahrouss --- Private/Source/KernelMain.cxx | 49 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'Private/Source') diff --git a/Private/Source/KernelMain.cxx b/Private/Source/KernelMain.cxx index e1fba478..e641c7e9 100644 --- a/Private/Source/KernelMain.cxx +++ b/Private/Source/KernelMain.cxx @@ -10,7 +10,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -30,7 +32,7 @@ EXTERN_C void RuntimeMain( /// Init the HAL. MUST_PASS(HCore::ke_init_hal()); - if (!HandoverHeader->f_LiteEdition) { + if (HandoverHeader->f_Bootloader == 0xDD) { /// Mount a New partition. HCore::IFilesystemManager::Mount(new HCore::NewFilesystemManager()); @@ -42,6 +44,51 @@ EXTERN_C void RuntimeMain( HCore::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } } else { + /** + ** This draws the background. + */ + + for (HCore::SizeT i = 0ul; i < HandoverHeader->f_GOP.f_Width; ++i) { + for (HCore::SizeT u = 0ul; u < HandoverHeader->f_GOP.f_Height; ++u) { + *(((volatile HCore::UInt32*)(HandoverHeader->f_GOP.f_The + + 4 * HandoverHeader->f_GOP.f_PixelPerLine * + i + + 4 * u))) = RGB(20, 20, 20); + } + } + + /** + ** This draws the HCore resource icon.. + */ + + HCore::SizeT uA = 0; + + for (HCore::SizeT i = 10ul; i < HCORELOGO_WIDTH + 10; ++i) { + for (HCore::SizeT u = 10ul; u < HCORELOGO_HEIGHT + 10; ++u) { + if (HCoreLogo[uA] == 0) { + *(((volatile HCore::UInt32*)(HandoverHeader->f_GOP.f_The + + 4 * + HandoverHeader->f_GOP + .f_PixelPerLine * + i + + 4 * u))) |= HCoreLogo[uA]; + } else { + *(((volatile HCore::UInt32*)(HandoverHeader->f_GOP.f_The + + 4 * + HandoverHeader->f_GOP + .f_PixelPerLine * + i + + 4 * u))) = HCoreLogo[uA]; + } + + ++uA; + } + } + + /** + This mounts the NewFS drive. + */ + HCore::kcout << "HCoreKrnl: Setup is starting...\n"; HCore::kcout << "HCoreKrnl: Mounting drive A: ...\n"; } -- cgit v1.2.3