summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-25 17:08:55 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-25 17:08:55 +0100
commitece3e47e28cfbcdc82bdd1c0aabbcda9a735851a (patch)
treeba9ccf33bcf2ac4cec2f2aa67afa107f2b2019ec /src
parent5bea01d881c3335ed6901f17ba9b8fff860ef356 (diff)
[FEAT] Kernel/Boot: BootZ Handover protocol update, add core detection routine in AMD64 HAL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/boot/amd64-desktop.make4
-rw-r--r--src/boot/src/HEL/AMD64/BootEFI.cpp2
-rw-r--r--src/boot/src/HEL/ARM64/BootEFI.cpp2
-rw-r--r--src/kernel/FirmwareKit/Handover.h5
-rw-r--r--src/kernel/HALKit/AMD64/HalKernelMain.cpp8
5 files changed, 14 insertions, 7 deletions
diff --git a/src/boot/amd64-desktop.make b/src/boot/amd64-desktop.make
index 0854db60..9379dc60 100644
--- a/src/boot/amd64-desktop.make
+++ b/src/boot/amd64-desktop.make
@@ -49,12 +49,12 @@ DEBUG_MACRO = -D__DEBUG__
endif
ifeq ($(KVM_SUPPORT),)
-EMU_FLAGS=-M q35 -smp 4 -m 8G \
+EMU_FLAGS=-M q35 -smp 8 -m 8G \
-bios $(BIOS) -cdrom $(BOOT) -boot d
endif
ifneq ($(KVM_SUPPORT),)
-EMU_FLAGS=-M q35 -smp 4 -m 8G \
+EMU_FLAGS=-M q35 -smp 8 -m 8G \
-bios $(BIOS) -M q35 -cdrom $(BOOT) -boot d -accel kvm
endif
diff --git a/src/boot/src/HEL/AMD64/BootEFI.cpp b/src/boot/src/HEL/AMD64/BootEFI.cpp
index 4d004e54..51cdf8e9 100644
--- a/src/boot/src/HEL/AMD64/BootEFI.cpp
+++ b/src/boot/src/HEL/AMD64/BootEFI.cpp
@@ -120,8 +120,10 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa
if (mp) {
mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled);
+ kHandoverHeader->f_NumberOfProcessors = cnt_enabled;;
handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1;
} else {
+ handover_hdr->f_NumberOfProcessors = 1;
handover_hdr->f_HardwareTables.f_MultiProcessingEnabled = NO;
}
diff --git a/src/boot/src/HEL/ARM64/BootEFI.cpp b/src/boot/src/HEL/ARM64/BootEFI.cpp
index 936f5dfb..a92b9a62 100644
--- a/src/boot/src/HEL/ARM64/BootEFI.cpp
+++ b/src/boot/src/HEL/ARM64/BootEFI.cpp
@@ -94,8 +94,10 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa
if (mp) {
mp->GetNumberOfProcessors(mp, &cnt_disabled, &cnt_enabled);
+ kHandoverHeader->f_NumberOfProcessors = cnt_enabled;
kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled = cnt_enabled > 1;
} else {
+ kHandoverHeader->f_NumberOfProcessors = 1;
kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled = NO;
}
diff --git a/src/kernel/FirmwareKit/Handover.h b/src/kernel/FirmwareKit/Handover.h
index 8515cfa6..f3382f75 100644
--- a/src/kernel/FirmwareKit/Handover.h
+++ b/src/kernel/FirmwareKit/Handover.h
@@ -10,7 +10,7 @@
#include <NeKit/Config.h>
#define kHandoverMagic (0xBADCC)
-#define kHandoverVersion (0x0117)
+#define kHandoverVersion (0x0118)
/* Initial bitmap pointer location and size. */
#define kHandoverStructSz sizeof(HEL::BootInfoHeader)
@@ -79,7 +79,8 @@ struct BootInfoHeader final {
UInt32 f_PixelPerLine;
} f_GOP;
- UInt64 f_FirmwareSpecific[8];
+ UInt64 f_NumberOfProcessors;
+ UInt64 f_FirmwareSpecific[7];
};
enum {
diff --git a/src/kernel/HALKit/AMD64/HalKernelMain.cpp b/src/kernel/HALKit/AMD64/HalKernelMain.cpp
index 4c527572..97102865 100644
--- a/src/kernel/HALKit/AMD64/HalKernelMain.cpp
+++ b/src/kernel/HALKit/AMD64/HalKernelMain.cpp
@@ -157,9 +157,11 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) {
NeFileSystemMgr::Mount(new NeFileSystemMgr());
#endif
- cg_init();
- FBDrawBitMapInRegion(kBootLogo, BOOT_LOGO_WIDTH, BOOT_LOGO_HEIGHT, 10, 10);
- cg_clear();
+ for (SizeT idxCore{0}; idxCore < kHandoverHeader->f_NumberOfProcessors; ++idxCore) {
+ cg_init();
+ FBDrawBitMapInRegion(kBootLogo, BOOT_LOGO_WIDTH, BOOT_LOGO_HEIGHT, 10, 12 + BOOT_LOGO_WIDTH * idxCore);
+ cg_clear();
+ }
UserProcessScheduler::The().SwitchTeam(kRTUserTeam);