diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 23:10:36 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 23:14:16 +0100 |
| commit | 995e1580f9291c5b8e95687c59b95e561c0c4569 (patch) | |
| tree | 50616d08887f2ca193683ff188ca952a0bb0ce3e /Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | |
| parent | 43ae417266c3127bbae35527c95c26e01ed50bd9 (diff) | |
Kernel: See below.
- Fix ACPI.
- Parsing SDT correctly now.
- Fix ke_runtime_check line endings.
- Update Kernel heap magic and add padding to header.
- Document Code Manager add limit for process teams.
- Add execute_from_image for Code Manager.
- Add loop for scheduler inside RuntimeMain.
- Set SMP core to 4 for testing purposes.
- Check for ACPI 2.x+
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp')
| -rw-r--r-- | Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp index bbd3c6ea..f31e67c2 100644 --- a/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp +++ b/Private/HALKit/AMD64/HalCoreMultiProcessingAMD64.cpp @@ -43,11 +43,7 @@ STATIC voidPtr kApicMadt = nullptr; STATIC const char* kApicSignature = "APIC"; /// @brief Multiple APIC descriptor table. -struct MadtType final { - char fMag[4]; - Int32 fLength; - char fRev; - +struct MadtType final : public SDT { struct MadtAddress final { UInt32 fPhysicalAddress; UInt32 fFlags; // 1 = Dual Legacy PICs installed @@ -91,36 +87,21 @@ struct MadtLocalApicAddressOverride final { /////////////////////////////////////////////////////////////////////////////////////// -STATIC MadtType kApicMadtList[256]; - -MadtType* _hal_system_find_core(MadtType* madt) { - madt = madt + sizeof(MadtType); - - if (rt_string_cmp(madt->fMag, kApicSignature, - rt_string_len(kApicSignature)) == 0) - return madt; - - return nullptr; -} +STATIC MadtType* kApicInfoBlock = nullptr; /////////////////////////////////////////////////////////////////////////////////////// void hal_system_get_cores(voidPtr rsdPtr) { + kcout << "NewKernel.exe: Constructing ACPIFactoryInterface...\r\n"; + auto acpi = ACPIFactoryInterface(rsdPtr); kApicMadt = acpi.Find(kApicSignature).Leak().Leak(); MUST_PASS(kApicMadt); // MADT must exist. - SizeT counter = 0UL; - MadtType* offset = _hal_system_find_core((MadtType*)kApicMadt); - //! now find core addresses. - while (offset != nullptr) { - // calls rt_copy_memory in NewC++ - kApicMadtList[counter] = *offset; - offset = _hal_system_find_core(offset); + kcout << "NewKernel.exe: Successfuly fetched the MADT!\r\n"; - ++counter; - } + kApicInfoBlock = (MadtType*)kApicMadt; } } // namespace NewOS::HAL |
