summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit
diff options
context:
space:
mode:
authorAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-04 16:29:09 +0200
committerAmlal EL Mahrouss <amlalelmahrouss@icloud.com>2024-08-04 16:29:09 +0200
commit1b92501a27f8781945bc6b19bb43e22588d4c933 (patch)
tree8e73c4045188b0620bd8612dacdbab449ae97f94 /Kernel/HALKit
parenta38083f7d528111087949a0ba8e3970f091f2fc9 (diff)
[IMP] ProgramLoader class for PE32+.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit')
-rw-r--r--Kernel/HALKit/AMD64/HalBoot.asm3
-rw-r--r--Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx4
-rw-r--r--Kernel/HALKit/AMD64/HalKernelMain.cxx73
3 files changed, 48 insertions, 32 deletions
diff --git a/Kernel/HALKit/AMD64/HalBoot.asm b/Kernel/HALKit/AMD64/HalBoot.asm
index f03982e6..6cd119ac 100644
--- a/Kernel/HALKit/AMD64/HalBoot.asm
+++ b/Kernel/HALKit/AMD64/HalBoot.asm
@@ -29,4 +29,7 @@ section .text
[global ke_startup_platform]
ke_startup_platform:
+ push rax
+ jmp hal_init_platform
+ pop rax
ret \ No newline at end of file
diff --git a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
index c9552851..dd912d2b 100644
--- a/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
+++ b/Kernel/HALKit/AMD64/HalCoreMultiProcessingAMD64.cxx
@@ -12,6 +12,10 @@
#include <KernelKit/ProcessScheduler.hxx>
#include <KernelKit/Timer.hxx>
+// Needed for SMP. //
+
+#include <KernelKit/MP.hxx>
+
#define kAPIC_ICR_Low 0x300
#define kAPIC_ICR_High 0x310
#define kAPIC_SIPI_Vector 0x00500
diff --git a/Kernel/HALKit/AMD64/HalKernelMain.cxx b/Kernel/HALKit/AMD64/HalKernelMain.cxx
index 2eae6053..0ed63569 100644
--- a/Kernel/HALKit/AMD64/HalKernelMain.cxx
+++ b/Kernel/HALKit/AMD64/HalKernelMain.cxx
@@ -19,6 +19,7 @@
#include <Modules/ACPI/ACPIFactoryInterface.hxx>
#include <NetworkKit/IPC.hxx>
#include <CFKit/Property.hxx>
+#include <Modules/CoreCG/TextRenderer.hxx>
#define mInitKernel(X) \
X; \
@@ -52,6 +53,8 @@ struct PROCESS_EXIT_INFO final
Kernel::Char fReason[cReasonLen];
};
+STATIC Kernel::UInt32 kTextOffsetY = 30;
+
namespace Kernel::HAL
{
/// @brief Gets the system cores using the MADT.
@@ -82,6 +85,11 @@ EXTERN_C void hal_init_platform(
return;
}
+ cg_write_text("NEWOSKRNL (C) ZKA TECHNOLOGIES.", kTextOffsetY, 10, RGB(0x00, 0x00, 0x00));
+ kTextOffsetY += 10;
+
+ cg_write_text("SMP OS (MAX 8 CORES).", kTextOffsetY, 10, RGB(0x00, 0x00, 0x00));
+
kKernelVirtualSize = HandoverHeader->f_VirtualSize;
kKernelVirtualStart = reinterpret_cast<Kernel::VoidPtr>(
reinterpret_cast<Kernel::UIntPtr>(HandoverHeader->f_VirtualStart) + cHeapStartOffset);
@@ -109,29 +117,30 @@ EXTERN_C void hal_init_platform(
// Register the basic SCI functions.
- constexpr auto cSerialAlertInterrupt = 0x10;
- constexpr auto cTlsInterrupt = 0x11;
- constexpr auto cTlsInstallInterrupt = 0x12;
- constexpr auto cNewInterrupt = 0x13;
- constexpr auto cDeleteInterrupt = 0x14;
- constexpr auto cExitInterrupt = 0x15;
- constexpr auto cLastExitInterrupt = 0x16;
- constexpr auto cCatalogOpen = 0x17;
- constexpr auto cForkRead = 0x18;
- constexpr auto cForkWrite = 0x19;
- constexpr auto cCatalogClose = 0x20;
- constexpr auto cCatalogRemove = 0x21;
- constexpr auto cCatalogCreate = 0x22;
- constexpr auto cRebootInterrupt = 0x23;
- constexpr auto cShutdownInterrupt = 0x24;
- constexpr auto cLPCSendMsg = 0x25;
- constexpr auto cLPCOpenMsg = 0x26;
- constexpr auto cLPCCloseMsg = 0x27;
- constexpr auto cLPCSanitizeMsg = 0x28;
-
- kSyscalls[cSerialAlertInterrupt].Leak().Leak()->fProc = [](Kernel::VoidPtr rdx) -> void {
+ constexpr auto cVGAWrite = 0x10;
+ constexpr auto cTlsInterrupt = 0x11;
+ constexpr auto cTlsInstallInterrupt = 0x12;
+ constexpr auto cNewInterrupt = 0x13;
+ constexpr auto cDeleteInterrupt = 0x14;
+ constexpr auto cExitInterrupt = 0x15;
+ constexpr auto cLastExitInterrupt = 0x16;
+ constexpr auto cCatalogOpen = 0x17;
+ constexpr auto cForkRead = 0x18;
+ constexpr auto cForkWrite = 0x19;
+ constexpr auto cCatalogClose = 0x20;
+ constexpr auto cCatalogRemove = 0x21;
+ constexpr auto cCatalogCreate = 0x22;
+ constexpr auto cRebootInterrupt = 0x23;
+ constexpr auto cShutdownInterrupt = 0x24;
+ constexpr auto cLPCSendMsg = 0x25;
+ constexpr auto cLPCOpenMsg = 0x26;
+ constexpr auto cLPCCloseMsg = 0x27;
+ constexpr auto cLPCSanitizeMsg = 0x28;
+
+ kSyscalls[cVGAWrite].Leak().Leak()->fProc = [](Kernel::VoidPtr rdx) -> void {
const char* msg = (const char*)rdx;
- Kernel::kcout << "Kernel: " << msg << "\r";
+ cg_write_text(msg, kTextOffsetY, 10, RGB(0x00, 0x00, 0x00));
+ kTextOffsetY += 10;
};
kSyscalls[cTlsInterrupt].Leak().Leak()->fProc = [](Kernel::VoidPtr rdx) -> void {
@@ -206,16 +215,16 @@ EXTERN_C void hal_init_platform(
pow.Shutdown();
};
- kSyscalls[cSerialAlertInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cTlsInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cDeleteInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cNewInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cExitInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cShutdownInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cRebootInterrupt].Leak().Leak()->fHooked = true;
- kSyscalls[cLPCSanitizeMsg].Leak().Leak()->fHooked = true;
+ kSyscalls[cVGAWrite].Leak().Leak()->fHooked = true;
+ kSyscalls[cTlsInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cTlsInstallInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cDeleteInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cNewInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cExitInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cLastExitInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cShutdownInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cRebootInterrupt].Leak().Leak()->fHooked = true;
+ kSyscalls[cLPCSanitizeMsg].Leak().Leak()->fHooked = true;
// newoskrnl version 1.00.
Kernel::StringView strVer(cMaxPropLen);