summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalKernelMain.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-15 13:56:17 +0200
commit6a30f42d5dcd0f944262147b2806db6c14fe7ffc (patch)
tree86d86a66df2941e49d1d332aaa1671c11db594e5 /dev/kernel/HALKit/AMD64/HalKernelMain.cc
parentf8aaa274535b6541f376090958eedbbba3ba00ba (diff)
feat(kernel): Finalizing the first version of the user scheduler.
other: - Removed DmaPool into its own Kit. - ApplicationProcessor unit has been cleaned up. - Rename functions of MemoryMgr. - Use KIB instead of MIBs of stack. - Cleanup parts of the scheduler, and hw scheduler. - Use UD handler for INT 6. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalKernelMain.cc')
-rw-r--r--dev/kernel/HALKit/AMD64/HalKernelMain.cc23
1 files changed, 19 insertions, 4 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
index 2d213a9b..b0ac076d 100644
--- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc
+++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
@@ -27,6 +27,8 @@ EXTERN_C Int32 hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) {
return kEfiFail;
}
+ Kernel::HAL::rt_sti();
+
kHandoverHeader = handover_hdr;
FB::fb_clear_video();
@@ -54,7 +56,7 @@ EXTERN_C Int32 hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) {
STATIC CONST auto kGDTEntriesCount = 6;
- /* GDT, mostly descriptors for user and kernel segments. */
+ /* The GDT, mostly descriptors for user and kernel segments. */
STATIC Kernel::HAL::Detail::NE_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = {
{.fLimitLow = 0,
.fBaseLow = 0,
@@ -101,6 +103,13 @@ EXTERN_C Int32 hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) {
return kEfiFail;
}
+EXTERN_C Kernel::Void rtl_ne_task(Kernel::Void) {
+ kout << "Hello, world!\r";
+ dbg_break_point();
+}
+
+EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp);
+
EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept {
#ifdef __FSKIT_INCLUDES_HEFS__
if (!Kernel::HeFS::fs_init_hefs()) {
@@ -108,18 +117,24 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept {
Kernel::NeFS::fs_init_nefs();
}
#elif defined(__FSKIT_INCLUDES_NEFS__)
- Kernel::NeFS::fs_init_nefs();
+ if (!Kernel::NeFS::fs_init_nefs()) {
+ kout << "NeFS cannot be formated on the disk. Aborting\r";
+ dbg_break_point();
+ }
#endif
+ Kernel::rtl_create_user_process(rtl_ne_task, "NeTask");
+
Kernel::HAL::mp_init_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr);
Kernel::HAL::Register64 idt_reg;
- idt_reg.Base = (Kernel::UIntPtr) kInterruptVectorTable;
+ idt_reg.Base = reinterpret_cast<Kernel::UIntPtr>(kInterruptVectorTable);
Kernel::HAL::IDTLoader idt_loader;
idt_loader.Load(idt_reg);
- dbg_break_point();
+ while (YES)
+ ;
}
#endif // ifndef __NE_MODULAR_KERNEL_COMPONENTS__