summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/HALKit/AMD64')
-rw-r--r--dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.s9
-rw-r--r--dev/kernel/HALKit/AMD64/HalKernelMain.cc16
-rw-r--r--dev/kernel/HALKit/AMD64/PCI/Iterator.cc10
-rw-r--r--dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc4
4 files changed, 23 insertions, 16 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.s b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.s
index 903038ea..7b383404 100644
--- a/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.s
+++ b/dev/kernel/HALKit/AMD64/HalApplicationProcessorStartup.s
@@ -1,3 +1,12 @@
+ /*
+ * ========================================================
+ *
+ * NeKernel
+ * Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
+ *
+ * ========================================================
+ */
+
.text
.global hal_ap_blob_start
diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
index 50d022e9..051e3cc3 100644
--- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc
+++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc
@@ -134,7 +134,13 @@ EXTERN_C Int32 hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) {
}
EXTERN_C Kernel::Void hal_real_init(Kernel::Void) {
- using namespace Kernel;
+#ifdef __FSKIT_INCLUDES_OPENHEFS__
+ OpenHeFS::fs_init_openhefs();
+#endif
+
+#ifdef __FSKIT_INCLUDES_NEFS__
+ NeFS::fs_init_nefs();
+#endif
HAL::Register64 idt_reg;
idt_reg.Base = reinterpret_cast<UIntPtr>(kInterruptVectorTable);
@@ -144,14 +150,6 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) {
HAL::mp_init_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr);
-#ifdef __FSKIT_INCLUDES_OPENHEFS__
- OpenHeFS::fs_init_openhefs();
-#endif
-
-#ifdef __FSKIT_INCLUDES_NEFS__
- NeFS::fs_init_nefs();
-#endif
-
while (YES)
;
}
diff --git a/dev/kernel/HALKit/AMD64/PCI/Iterator.cc b/dev/kernel/HALKit/AMD64/PCI/Iterator.cc
index 9d12c0d6..88bbce3f 100644
--- a/dev/kernel/HALKit/AMD64/PCI/Iterator.cc
+++ b/dev/kernel/HALKit/AMD64/PCI/Iterator.cc
@@ -7,12 +7,12 @@
#include <KernelKit/PCI/Iterator.h>
namespace Kernel::PCI {
-Iterator::Iterator(const Types::PciDeviceKind& type) {
+Iterator::Iterator(const Types::PciDeviceKind type, UInt32 bar) {
// probe devices.
- for (int bus = 0; bus < NE_BUS_COUNT; ++bus) {
- for (int device = 0; device < NE_DEVICE_COUNT; ++device) {
- for (int function = 0; function < NE_FUNCTION_COUNT; ++function) {
- Device dev(bus, device, function, 0x00);
+ for (Int32 bus = 0; bus < NE_BUS_COUNT; ++bus) {
+ for (Int32 device = 0; device < NE_DEVICE_COUNT; ++device) {
+ for (Int32 function = 0; function < NE_FUNCTION_COUNT; ++function) {
+ Device dev(bus, device, function, bar);
if (dev.Class() == type) {
fDevices[bus] = dev;
diff --git a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
index 0bd9455d..821d80bb 100644
--- a/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
+++ b/dev/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
@@ -397,7 +397,8 @@ STATIC Bool drv_init_command_structures_ahci() {
/// @param atapi reference value, tells whether we should detect ATAPI instead of SATA.
/// @return if the disk was successfully initialized or not.
STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) {
- PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController);
+ /// AMLALE: TODO: Iterator is good enough, but we need to expand it.
+ PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController, 0x00);
for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) {
kSATADev = iterator[device_index].Leak(); // Leak device.
@@ -438,7 +439,6 @@ STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) {
if (!drv_init_command_structures_ahci()) {
err_global_get() = kErrorDisk;
- return NO;
}
goto success_hba_fetch;