diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-21 13:39:23 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-21 13:39:55 +0100 |
| commit | 051e2cfb8df4f2fc1ef711ca7351e7018b4c6e1c (patch) | |
| tree | bd220c371991418bdb8c0a7de2fc9547c3009708 | |
| parent | 333fed96b7ccd3ee4f5f097445408dde34d330db (diff) | |
unstable: secret: Start work on AHCI driver, getting it to initialize
first.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
| -rw-r--r-- | MailMap | 2 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/HalACPIFactoryInterface.cxx | 8 | ||||
| -rw-r--r-- | Private/HALKit/AMD64/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/ARM64/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/RISCV/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/X86S/ACPI/.gitkeep | 0 | ||||
| -rw-r--r-- | Private/HALKit/X86S/Storage/.gitkeep | 0 | ||||
| -rw-r--r-- | Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s | 4 | ||||
| -rw-r--r-- | Public/Kits/System.Core/Defs.hxx | 10 | ||||
| -rw-r--r-- | Public/Kits/System.Core/Heap.hxx | 2 | ||||
| -rw-r--r-- | Public/Kits/System.Core/InitRuntime.cxx | 6 |
11 files changed, 20 insertions, 12 deletions
@@ -1 +1 @@ -amlel - Microkernel and Bootloader - amlalelmahrouss@icloud.com, +33 6 58 57 30 14 +Amlal El Mahrouss - Microkernel and Bootloader - amlalelmahrouss@icloud.com, +33 6 58 57 30 14 diff --git a/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx b/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx index f3e120b6..204274b9 100644 --- a/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx +++ b/Private/HALKit/AMD64/HalACPIFactoryInterface.cxx @@ -16,8 +16,8 @@ ACPIFactoryInterface::ACPIFactoryInterface(voidPtr rsdPtr) : m_Rsdp(rsdPtr), m_E MUST_PASS(_rsdPtr->Revision >= 2); } -void ACPIFactoryInterface::Shutdown() {} -void ACPIFactoryInterface::Reboot() {} +Void ACPIFactoryInterface::Shutdown() {} +Void ACPIFactoryInterface::Reboot() {} /// @brief Finds a descriptor table inside ACPI XSDT. ErrorOr<voidPtr> ACPIFactoryInterface::Find(const char *signature) { @@ -32,10 +32,12 @@ ErrorOr<voidPtr> ACPIFactoryInterface::Find(const char *signature) { auto xsdt = rsdPtr->XsdtAddress; SizeT num = (rsdPtr->Length + sizeof(SDT)) / 8; + constexpr short ACPI_SIGNATURE_LENGTH = 4; + for (Size index = 0; index < num; ++index) { SDT *sdt = reinterpret_cast<SDT *>(xsdt + sizeof(SDT) + index * 8); - if (!Checksum(sdt->Signature, 4)) ke_stop(RUNTIME_CHECK_ACPI); + if (!Checksum(sdt->Signature, ACPI_SIGNATURE_LENGTH)) ke_stop(RUNTIME_CHECK_ACPI); if (StringBuilder::Equals(const_cast<const char *>(sdt->Signature), signature)) diff --git a/Private/HALKit/AMD64/Storage/.gitkeep b/Private/HALKit/AMD64/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/AMD64/Storage/.gitkeep diff --git a/Private/HALKit/ARM64/Storage/.gitkeep b/Private/HALKit/ARM64/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/ARM64/Storage/.gitkeep diff --git a/Private/HALKit/RISCV/Storage/.gitkeep b/Private/HALKit/RISCV/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/RISCV/Storage/.gitkeep diff --git a/Private/HALKit/X86S/ACPI/.gitkeep b/Private/HALKit/X86S/ACPI/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/X86S/ACPI/.gitkeep diff --git a/Private/HALKit/X86S/Storage/.gitkeep b/Private/HALKit/X86S/Storage/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/Private/HALKit/X86S/Storage/.gitkeep diff --git a/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s b/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s index 71984042..a61d6d1f 100644 --- a/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s +++ b/Public/Kits/System.Core/AMD64/HCoreAssemblyRoutines.s @@ -4,12 +4,12 @@ .section .text -.globl HcGetProcessObject +.globl HcGetInstanceObject .globl __assert_chk_fail /* @brief Process object getter */ /* @throws: ApptError: appartement error. */ -HcGetProcessObject: +HcGetInstanceObject: mov $0x10, %rcx /* sysGetProcessObject */ int $0x21 diff --git a/Public/Kits/System.Core/Defs.hxx b/Public/Kits/System.Core/Defs.hxx index e99abcc4..6d0fb99a 100644 --- a/Public/Kits/System.Core/Defs.hxx +++ b/Public/Kits/System.Core/Defs.hxx @@ -66,10 +66,10 @@ typedef CHAR BOOL; #define TRUE 1 #define FALSE 0 -#define PTR * +#define CA_PTR * -#define FAR __far -#define NEAR __near +#define CA_FAR __far +#define CA_NEAR __near #define CA_UNREFERENCED_PARAMETER(e) ((VOID)e) @@ -89,6 +89,10 @@ typedef CHAR BOOL; # define _M_64000 5 #endif +#ifdef __riscv__ +# define _M_RISCV 6 +#endif + #define CA_STATIC static #define CA_INLINE inline #define CA_CONST const diff --git a/Public/Kits/System.Core/Heap.hxx b/Public/Kits/System.Core/Heap.hxx index 6bad93e0..ff0fc75a 100644 --- a/Public/Kits/System.Core/Heap.hxx +++ b/Public/Kits/System.Core/Heap.hxx @@ -16,7 +16,7 @@ CA_EXTERN_C PVOID HcAllocateProcessHeap(ObjectPtr refObj, QWORD sz, CA_EXTERN_C BOOL HcProcessHeapExists(ObjectPtr refObj, PVOID ptr); CA_EXTERN_C QWORD HcProcessHeapSize(ObjectPtr refObj, PVOID ptr); CA_EXTERN_C VOID HcFreeProcessHeap(ObjectPtr refObj, PVOID ptr); -CA_EXTERN_C ObjectPtr HcGetProcessObject(void); +CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); enum HcAllocationKind { kStandardAllocation = 0xC, diff --git a/Public/Kits/System.Core/InitRuntime.cxx b/Public/Kits/System.Core/InitRuntime.cxx index 01eb2c1f..8d5596ca 100644 --- a/Public/Kits/System.Core/InitRuntime.cxx +++ b/Public/Kits/System.Core/InitRuntime.cxx @@ -4,9 +4,11 @@ #include <System.Core/Heap.hxx> -/// @brief Inits the C runtime +/// @brief Inits the process runtime /// @return if it was succesful or not. DWORD HcInitRuntime(VOID) { - kInstanceObject = HcGetProcessObject(); + kInstanceObject = HcGetInstanceObject(); + CA_MUST_PASS(kInstanceObject); + return 0; }
\ No newline at end of file |
