diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-12 03:16:15 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-12 03:20:24 +0200 |
| commit | b323d403149db3d720a63af1087d44718821bd67 (patch) | |
| tree | c15fdaf7053f40d8d6b89bc554e85998162391c7 | |
| parent | 6d31d6e0959f224630317d247f489d18e65aa5bc (diff) | |
Kernel improvements, and Paging API changes.
ZKA:
- Updated and fixed 4KB pages on ARM64.
- Fixed 4KB pages on AMD64.
- Refactor BMP allocator.
ZBA:
- Refactor Handover protocol.
DDK:
- Refactor and breaking API changes.
HPFS:
- Update code according to DDK.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
25 files changed, 147 insertions, 164 deletions
@@ -24,4 +24,4 @@ cd boot-krnl-dll make -f amd64-efi.make all ``` -##### Copyright ZKA Technologies. All rights reserved. +###### Copyright ZKA Technologies. All rights reserved. diff --git a/compile_flags.txt b/compile_flags.txt index 5500b753..6ff52e28 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -4,3 +4,4 @@ -Idev/ZBA/BootKit -std=c++20 -D__ZKA_AMD64__ +-D__NEWOSKRNL__ diff --git a/dev/DDK/KernelCall.c b/dev/DDK/KernelCall.c index 16c36f43..49bf57b5 100644 --- a/dev/DDK/KernelCall.c +++ b/dev/DDK/KernelCall.c @@ -10,7 +10,7 @@ #include <stdarg.h> /// @brief this is an internal call, do not use it. -DK_EXTERN __attribute__((naked)) void* __KernelCallDispatch(const char* name, int32_t cnt, void* data, size_t sz); +DK_EXTERN ATTRIBUTE(naked) void* __KernelCallDispatch(const char* name, int32_t cnt, void* data, size_t sz); /// @brief Interupt Kernel /// @param KernelRpcName RPC name @@ -19,12 +19,12 @@ DK_EXTERN __attribute__((naked)) void* __KernelCallDispatch(const char* name, in /// @param sz The size of the whole data pointer. /// @retval void* Kernel call was successful. /// @retval nil Kernel call failed, call KernelLastError(void) -DK_EXTERN void* KernelCall(const char* KernelRpcName, int32_t cnt, void* data, size_t sz) +DK_EXTERN void* KernelCall(const char* name, int32_t cnt, void* data, size_t sz) { - if (!KernelRpcName || cnt == 0) + if (!name || *name == 0 || cnt == 0) return nil; - return __KernelCallDispatch(KernelRpcName, cnt, data, sz); + return __KernelCallDispatch(name, cnt, data, sz); } /// @brief Add system call. @@ -37,19 +37,24 @@ DK_EXTERN void KernelAddSyscall(const int slot, void (*slotFn)(void* a0)) /// @brief Get a Kernel property. /// @param slot property id (always 0) -/// @param name the prperty's name. -/// @return property's object. -DK_EXTERN void* KernelGetProperty(const int slot, const char* name) +/// @param name the object's name. +/// @return Object manifest. +DK_EXTERN struct DDK_OBJECT_MANIFEST* KernelGetObject(const int slot, const char* name) { - return KernelCall("RtlGetProperty", slot, (void*)name, 1); + struct DDK_OBJECT_MANIFEST* manifest = (struct DDK_OBJECT_MANIFEST*)KernelCall("RtlGetObject", slot, (void*)name, 1); + + if (!manifest) + return nil; + + return manifest; } /// @brief Set a Kernel property. /// @param slot property id (always 0) -/// @param name the property's name. -/// @param ddk_pr pointer to a property's DDK_PROPERTY_RECORD. +/// @param name the object's name. +/// @param ddk_pr pointer to a object's DDK_OBJECT_MANIFEST. /// @return property's object. -DK_EXTERN void* KernelSetProperty(const int slot, const struct DDK_PROPERTY_RECORD* ddk_pr) +DK_EXTERN void* KernelSetObject(const int slot, const struct DDK_OBJECT_MANIFEST* ddk_pr) { - return KernelCall("RtlSetProperty", slot, (void*)ddk_pr, 1); + return KernelCall("RtlSetObject", slot, (void*)ddk_pr, 1); } diff --git a/dev/DDK/KernelStd.h b/dev/DDK/KernelStd.h index ab0c6eb8..da15f269 100644 --- a/dev/DDK/KernelStd.h +++ b/dev/DDK/KernelStd.h @@ -2,7 +2,8 @@ Copyright ZKA Technologies. - Purpose: DDK DLL Base Header. + FILE: KernelStd.h + PURPOSE: DDK Driver model base header. ------------------------------------------- */ @@ -21,18 +22,20 @@ #define DK_FINAL #endif // defined(__cplusplus) +#define ATTRIBUTE(X) __attribute__((X)) + #ifndef __NEWOSKRNL__ -#error !!! including header in user mode !!! +#error !!! including header in low exception/ring-3 mode !!! #endif // __NEWOSKRNL__ struct DDK_STATUS_STRUCT; -struct DDK_PROPERTY_RECORD; +struct DDK_OBJECT_MANIFEST; -struct DDK_PROPERTY_RECORD DK_FINAL +struct DDK_OBJECT_MANIFEST DK_FINAL { char* p_name; + int32_t p_kind; void* p_object; - void* p_xpcom_object; }; /// \brief DDK status structure (__at_enable, __at_disable...) @@ -50,12 +53,12 @@ struct DDK_STATUS_STRUCT DK_FINAL /// @param dat data ptr /// @param sz sz of whole data ptr. /// @return result of call -DK_EXTERN void* KernelCall(const char* KernelRpcName, int32_t cnt, void* dat, size_t sz); +DK_EXTERN void* KernelCall(const char* name, int32_t cnt, void* dat, size_t sz); /// @brief add system call. /// @param slot system call slot /// @param slotFn, syscall slot. -DK_EXTERN void KernelAddSyscall(const int slot, void (*slotFn)(void* a0)); +DK_EXTERN void KernelAddSyscall(const int32_t slot, void (*slotFn)(void* a0)); /// @brief allocate heap ptr. /// @param sz size of ptr. @@ -70,14 +73,14 @@ DK_EXTERN void KernelFree(void*); /// @param slot property id (always 0) /// @param name the property's name. /// @return property's object. -DK_EXTERN void* KernelGetProperty(const int slot, const char* name); +DK_EXTERN struct DDK_OBJECT_MANIFEST* KernelGetObject(const int slot, const char* name); /// @brief Set a Kernel property. /// @param slot property id (always 0) /// @param name the property's name. -/// @param ddk_pr pointer to a property's DDK_PROPERTY_RECORD. +/// @param ddk_pr pointer to a property's DDK_OBJECT_MANIFEST. /// @return property's object. -DK_EXTERN void* KernelSetProperty(const int slot, const struct DDK_PROPERTY_RECORD* ddk_pr); +DK_EXTERN void* KernelSetObject(const int32_t slot, const struct DDK_OBJECT_MANIFEST* ddk_pr); /// @brief The highest API version of the DDK. DK_EXTERN int32_t c_api_version_highest; diff --git a/dev/DLL/Security/.keep b/dev/DLL/Security/.keep deleted file mode 100644 index e69de29b..00000000 --- a/dev/DLL/Security/.keep +++ /dev/null diff --git a/dev/DLL/Security/build.json b/dev/DLL/Security/build.json deleted file mode 100644 index 5877cdf6..00000000 --- a/dev/DLL/Security/build.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compiler_path": "x86_64-w64-mingw32-g++", - "compiler_std": "c++20", - "headers_path": ["../"], - "sources_path": ["Sources/*.cxx"], - "output_name": "sec.dll", - "compiler_flags": [ - "-ffreestanding", - "-shared", - "-fno-rtti", - "-fno-exceptions", - "-Wl,--subsystem=17" - ], - "cpp_macros": [ - "__SEC_IMPL__", - "cSECVersion=0x0100", - "cSECVersionHighest=0x0100", - "cSECVersionLowest=0x0100" - ] -} diff --git a/dev/HPFS/EPM/EBS.i b/dev/HPFS/EPM/EBS.i index 4fc529da..c137b6f4 100644 --- a/dev/HPFS/EPM/EBS.i +++ b/dev/HPFS/EPM/EBS.i @@ -10,7 +10,7 @@ HPFS_EBS_HEADER: db " HPFS" ;; MAGIC NUMBER OF FILESYSTEM dw 8 ;; MAGIC NUMBER LENGTH. dq 0 ;; RESERVED 4 - dw 1 ;; VERSION + dw 0x0100 ;; VERSION dw 0 ;; PARTITION TYPE dq 0 ;; RESERVED 3 dw 0 ;; DISK TYPE (INVALID = 0, CDROM = 1, SSD = 2, USB = 3) diff --git a/dev/HPFS/ReadMe.md b/dev/HPFS/ReadMe.md new file mode 100644 index 00000000..999b0d30 --- /dev/null +++ b/dev/HPFS/ReadMe.md @@ -0,0 +1,9 @@ +# High Performance File System + +Filesystem driver for the HPFS specification. + +## Installation + +- Use BTB to build filesystem and partition blobs. + +###### Copyright ZKA Technologies. All rights reserved. diff --git a/dev/HPFS/ReadMe.txt b/dev/HPFS/ReadMe.txt deleted file mode 100644 index 04b0e9f0..00000000 --- a/dev/HPFS/ReadMe.txt +++ /dev/null @@ -1 +0,0 @@ -This is the HPFS filesystem driver for ZKA.
\ No newline at end of file diff --git a/dev/HPFS/Sources/IFSMain.cxx b/dev/HPFS/Sources/hpfs_main.cxx index c2ae5b0a..52ac32ab 100644 --- a/dev/HPFS/Sources/IFSMain.cxx +++ b/dev/HPFS/Sources/hpfs_main.cxx @@ -7,14 +7,14 @@ ------------------------------------------- */ -#include <HPFS/Defines.hxx> +#include <HPFS/hpfs_specs.hxx> #include <DDK/KernelStd.h> /** @brief HPFS IFS main. */ HPFS_INT32 ModuleMain(HPFS_VOID) { - auto ifs_handle = KernelGetProperty(0, "\\.\\IFSObject"); - // TODO: Register IFS... + auto ifs_handle = KernelGetObject(0, "IFS_OBJECT"); + // TODO: Register this IFS with necessary I/O functions... return 0; } diff --git a/dev/HPFS/Defines.hxx b/dev/HPFS/hpfs_specs.hxx index 8d0536a0..8d0536a0 100644 --- a/dev/HPFS/Defines.hxx +++ b/dev/HPFS/hpfs_specs.hxx diff --git a/dev/INST/ReadMe.md b/dev/INST/ReadMe.md new file mode 100644 index 00000000..a1e39edc --- /dev/null +++ b/dev/INST/ReadMe.md @@ -0,0 +1,5 @@ +# ReadMe: INST
+
+This file installs ZKA OS into an HDD.
+</br>
+It can do both EPM and GPT partitions.
diff --git a/dev/INST/ReadMe.txt b/dev/INST/ReadMe.txt deleted file mode 100644 index e7b71b4a..00000000 --- a/dev/INST/ReadMe.txt +++ /dev/null @@ -1,4 +0,0 @@ -ReadMe: INST
-
-This file installs ZKA OS into an HDD.
-It can do both EPM and GPT partitions.
\ No newline at end of file diff --git a/dev/INST/X64/InstallAPI.asm b/dev/INST/X64/InstallerRoutines.asm index 61c712d0..61c712d0 100644 --- a/dev/INST/X64/InstallAPI.asm +++ b/dev/INST/X64/InstallerRoutines.asm diff --git a/dev/SCI/sci_base.hxx b/dev/SCI/sci_base.hxx index 7f7565de..9b2998ca 100644 --- a/dev/SCI/sci_base.hxx +++ b/dev/SCI/sci_base.hxx @@ -227,7 +227,7 @@ IMPORT_C UInt0 ThrExitJoinThread(UInt0); IMPORT_C UInt0 ThrExitDetachThread(UInt0);
// ------------------------------------------------------------------------
-// Disk Management API.
+// Drive Management API.
// ------------------------------------------------------------------------
#endif // ifndef __SCI_BASE_HXX__
diff --git a/dev/ZBA/BootKit/BootKit.hxx b/dev/ZBA/BootKit/BootKit.hxx index 0ddd6d30..590e50f4 100644 --- a/dev/ZBA/BootKit/BootKit.hxx +++ b/dev/ZBA/BootKit/BootKit.hxx @@ -185,7 +185,7 @@ static inline const UInt32 kRgbWhite = 0x00FFFFFF; #define kBKBootFileMime "boot-x/file" #define kBKBootDirMime "boot-x/dir" -/// @brief BootKit Disk Formatter. +/// @brief BootKit Drive Formatter. template <typename BootDev> class BDiskFormatFactory final { @@ -236,7 +236,7 @@ public: return false; } - writer.Write(L"NEWOSLDR: Disk is ").Write(GIB(this->fDiskDev.GetDiskSize())).Write(L" GB.\r"); + writer.Write(L"NEWOSLDR: Drive is ").Write(GIB(this->fDiskDev.GetDiskSize())).Write(L" GB.\r"); if (blockPart->DiskSize != this->fDiskDev.GetDiskSize() || blockPart->DiskSize < 1 || @@ -322,7 +322,7 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* partName, if (GIB(fDiskDev.GetDiskSize()) < cMinimumDiskSize) { - EFI::ThrowError(L"Disk-Too-Tiny", L"Can't format a New Filesystem partition here."); + EFI::ThrowError(L"Drive-Too-Tiny", L"Can't format a New Filesystem partition here."); return false; } @@ -372,7 +372,7 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* partName, if (this->WriteRootCatalog(fileBlobs, blobCount, partBlock)) { BTextWriter writer; - writer.Write(L"NEWOSLDR: Disk formatted.\r"); + writer.Write(L"NEWOSLDR: Drive formatted.\r"); return true; } diff --git a/dev/ZKA/FirmwareKit/Handover.hxx b/dev/ZKA/FirmwareKit/Handover.hxx index 8e021754..41c038ae 100644 --- a/dev/ZKA/FirmwareKit/Handover.hxx +++ b/dev/ZKA/FirmwareKit/Handover.hxx @@ -19,14 +19,16 @@ #include <NewKit/Defines.hxx> -/* Handover macros. */ - #define kHandoverMagic 0xBADCC #define kHandoverVersion 0x0117 -/* Initial bitmap size. */ -#define kHandoverBitMapStart 0x100000000 -#define kHandoverBitMapSz gib_cast(4) +/* Initial bitmap pointer location and size. */ +#define kHandoverBitMapStart (0x100000000) +#define kHandoverBitMapSz (gib_cast(4)) + +/* Executable base */ +#define kHandoverExecBase (0x4000000) + #define kHandoverStructSz sizeof(HEL::HANDOVER_INFO_HEADER) namespace Kernel::HEL diff --git a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx index 1d7d37c0..4549021f 100644 --- a/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx +++ b/dev/ZKA/HALKit/AMD64/HalBMPMgr.cxx @@ -17,6 +17,10 @@ #include <NewKit/Defines.hxx> #include <NewKit/KernelCheck.hxx> +#define cBitMapMagIdx 0 +#define cBitMapSizeIdx 1 +#define cBitMapUsedIdx 2 + namespace Kernel { namespace HAL @@ -32,21 +36,14 @@ namespace Kernel UIntPtr* ptr_bit_set = reinterpret_cast<UIntPtr*>(page_ptr); - if (!ptr_bit_set[0] || - ptr_bit_set[0] != cBitMpMagic) + if (!ptr_bit_set[cBitMapMagIdx] || + ptr_bit_set[cBitMapMagIdx] != cBitMpMagic) return No; - kcout << "BMPMgr: Freed Range!\r"; - kcout << "Magic Number: " << hex_number(ptr_bit_set[0]) << endl; - kcout << "Size of pointer (B): " << number(ptr_bit_set[1]) << endl; - kcout << "Size of pointer (KIB): " << number(KIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (MIB): " << number(MIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (GIB): " << number(GIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (TIB): " << number(TIB(ptr_bit_set[1])) << endl; - kcout << "Address Of Header: " << hex_number((UIntPtr)ptr_bit_set) << endl; + ptr_bit_set[cBitMapMagIdx] = cBitMpMagic; + ptr_bit_set[cBitMapUsedIdx] = No; - ptr_bit_set[0] = cBitMpMagic; - ptr_bit_set[2] = No; + this->PrintStatus(ptr_bit_set); mm_map_page(ptr_bit_set, ~eFlagsPresent); mm_map_page(ptr_bit_set, ~eFlagsRw); @@ -65,23 +62,16 @@ namespace Kernel { UIntPtr* ptr_bit_set = reinterpret_cast<UIntPtr*>(base_ptr); - if (ptr_bit_set[0] == cBitMpMagic) + if (ptr_bit_set[cBitMapMagIdx] == cBitMpMagic) { - if (ptr_bit_set[1] != 0 && - ptr_bit_set[1] <= size && - ptr_bit_set[2] == No) + if (ptr_bit_set[cBitMapSizeIdx] != 0 && + ptr_bit_set[cBitMapSizeIdx] <= size && + ptr_bit_set[cBitMapUsedIdx] == No) { - ptr_bit_set[1] = size; - ptr_bit_set[2] = Yes; - - kcout << "BMPMgr: Allocated Range!\r"; - kcout << "Magic Number: " << hex_number(ptr_bit_set[0]) << endl; - kcout << "Size of pointer (B): " << number(ptr_bit_set[1]) << endl; - kcout << "Size of pointer (KIB): " << number(KIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (MIB): " << number(MIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (GIB): " << number(GIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (TIB): " << number(TIB(ptr_bit_set[1])) << endl; - kcout << "Address Of BMP: " << hex_number((UIntPtr)ptr_bit_set) << endl; + ptr_bit_set[cBitMapSizeIdx] = size; + ptr_bit_set[cBitMapUsedIdx] = Yes; + + this->PrintStatus(ptr_bit_set); return (VoidPtr)ptr_bit_set; } @@ -90,18 +80,12 @@ namespace Kernel { UIntPtr* ptr_bit_set = reinterpret_cast<UIntPtr*>(base_ptr); - ptr_bit_set[0] = cBitMpMagic; - ptr_bit_set[1] = size; - ptr_bit_set[2] = Yes; + ptr_bit_set[cBitMapMagIdx] = cBitMpMagic; + + ptr_bit_set[cBitMapSizeIdx] = size; + ptr_bit_set[cBitMapUsedIdx] = Yes; - kcout << "BMPMgr: Allocated Range!\r"; - kcout << "Magic Number: " << hex_number(ptr_bit_set[0]) << endl; - kcout << "Size of pointer (B): " << number(ptr_bit_set[1]) << endl; - kcout << "Size of pointer (KIB): " << number(KIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (MIB): " << number(MIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (GIB): " << number(GIB(ptr_bit_set[1])) << endl; - kcout << "Size of pointer (TIB): " << number(TIB(ptr_bit_set[1])) << endl; - kcout << "Address Of BMP: " << hex_number((UIntPtr)ptr_bit_set) << endl; + this->PrintStatus(ptr_bit_set); return (VoidPtr)ptr_bit_set; } @@ -114,6 +98,19 @@ namespace Kernel return nullptr; } + + /// @brief Print Bitmap status + Void PrintStatus(UIntPtr* ptr_bit_set) + { + kcout << "Magic Number: " << hex_number(ptr_bit_set[cBitMapMagIdx]) << endl; + kcout << "Allocated: " << (ptr_bit_set[cBitMapUsedIdx] ? "Yes" : "No") << endl; + kcout << "Size of pointer (B): " << number(ptr_bit_set[cBitMapSizeIdx]) << endl; + kcout << "Size of pointer (KIB): " << number(KIB(ptr_bit_set[cBitMapSizeIdx])) << endl; + kcout << "Size of pointer (MIB): " << number(MIB(ptr_bit_set[cBitMapSizeIdx])) << endl; + kcout << "Size of pointer (GIB): " << number(GIB(ptr_bit_set[cBitMapSizeIdx])) << endl; + kcout << "Size of pointer (TIB): " << number(TIB(ptr_bit_set[cBitMapSizeIdx])) << endl; + kcout << "Address Of BMP: " << hex_number((UIntPtr)ptr_bit_set) << endl; + } }; } // namespace Detail diff --git a/dev/ZKA/HALKit/AMD64/HalCommAPI.cxx b/dev/ZKA/HALKit/AMD64/HalCommAPI.cxx index 087090b0..b78fd1f0 100644 --- a/dev/ZKA/HALKit/AMD64/HalCommAPI.cxx +++ b/dev/ZKA/HALKit/AMD64/HalCommAPI.cxx @@ -12,9 +12,11 @@ /** * @file HalCommAPI.cxx - * @brief CPU Processor common API. + * @brief CPU Common API. */ +#define PhysShift36(ADDR) ((UInt64)ADDR >> 12) + namespace Kernel::HAL { /// @brief Maps or allocates a page from virt_addr. diff --git a/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx b/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx index df3986a1..b7dfee8a 100644 --- a/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx +++ b/dev/ZKA/HALKit/AMD64/HalKernelMain.cxx @@ -69,8 +69,8 @@ EXTERN_C void hal_init_platform( gdtBase.Limit = (sizeof(Kernel::HAL::Detail::ZKA_GDT_ENTRY) * cEntriesCount) - 1; //! GDT will load hal_read_init after it successfully loads the segments. - CONST Kernel::HAL::GDTLoader cGDT; - cGDT.Load(gdtBase); + Kernel::HAL::GDTLoader gdtLoader; + gdtLoader.Load(gdtBase); Kernel::ke_stop(RUNTIME_CHECK_BOOTSTRAP); } @@ -80,8 +80,8 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) noexcept Kernel::HAL::Register64 idtBase; idtBase.Base = (Kernel::UIntPtr)kInterruptVectorTable; - CONST Kernel::HAL::IDTLoader cIDT; - cIDT.Load(idtBase); + Kernel::HAL::IDTLoader idtLoader; + idtLoader.Load(idtBase); if (kHandoverHeader->f_HardwareTables.f_MultiProcessingEnabled) Kernel::HAL::mp_get_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); diff --git a/dev/ZKA/HALKit/AMD64/Paging.hxx b/dev/ZKA/HALKit/AMD64/Paging.hxx index a4744631..f127d0e4 100644 --- a/dev/ZKA/HALKit/AMD64/Paging.hxx +++ b/dev/ZKA/HALKit/AMD64/Paging.hxx @@ -41,39 +41,23 @@ EXTERN_C Kernel::VoidPtr hal_read_cr3(); // @brief Page table. namespace Kernel::HAL { - struct PACKED ZKA_PTE_GENERIC - { - Bool Present : 1; - Bool Wr : 1; - Bool User : 1; - Bool Wt : 1; - Int32 Dirty : 1; - Int32 MemoryType : 1; - Int32 Global : 1; - Int32 Resvered_0 : 3; - UInt64 PhysicalAddress : 36; - Int32 Reserved_1 : 10; - Bool ProtectionKey : 5; - Bool ExecDisable : 1; - }; - /// @brief Final page entry (Not PML, PDPT) struct PACKED ZKA_PTE final { - Bool Present : 1; - Bool Wr : 1; - Bool User : 1; - Bool Wt : 1; - Bool Cache : 1; - Bool Accessed : 1; - Int32 Dirty : 1; - Int32 MemoryType : 1; - Int32 Global : 1; - Int32 Resvered_0 : 3; + UInt64 Present : 1; + UInt64 Wr : 1; + UInt64 User : 1; + UInt64 Wt : 1; + UInt64 Cache : 1; + UInt64 Accessed : 1; + UInt64 Dirty : 1; + UInt64 MemoryType : 1; + UInt64 Global : 1; + UInt64 Resvered1 : 3; UInt64 PhysicalAddress : 36; - Int32 Reserved_1 : 10; - Bool ProtectionKey : 5; - Bool ExecDisable : 1; + UInt64 Reserved2 : 10; + UInt64 ProtectionKey : 5; + UInt64 ExecDisable : 1; }; namespace Detail @@ -104,11 +88,6 @@ namespace Kernel::HAL ZKA_PTE* ALIGN(kPageAlign) fEntries[kPageMax]; }; - struct ZKA_PDE_GENERIC final - { - ZKA_PTE_GENERIC* ALIGN(kPageAlign) fEntries[kPageMax]; - }; - auto mm_alloc_bitmap(Boolean rw, Boolean user, SizeT size) -> VoidPtr; auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; } // namespace Kernel::HAL diff --git a/dev/ZKA/HALKit/ARM64/Paging.hxx b/dev/ZKA/HALKit/ARM64/Paging.hxx index 6cfeacf3..7fe020ef 100644 --- a/dev/ZKA/HALKit/ARM64/Paging.hxx +++ b/dev/ZKA/HALKit/ARM64/Paging.hxx @@ -58,14 +58,25 @@ namespace Kernel::HAL { - struct PACKED LongDescLevel3 final + struct PACKED PTE_4KB final { - Boolean Present : 1; - Boolean Rw : 1; - UInt16 Lpat : 9; - UInt32 Address : 27; - UInt32 Sbzp : 12; - UInt32 UPat : 11; + UInt64 Valid : 1; + UInt64 Table : 1; + UInt64 AttrIndex : 3; + UInt64 NS : 1; + UInt64 AP : 2; + UInt64 SH : 2; + UInt64 AF : 1; + UInt64 NG : 1; + UInt64 Reserved1 : 1; + UInt64 Contiguous : 1; + UInt64 Dirty : 1; + UInt64 Reserved : 2; + UInt64 PhysicalAddress : 36; + UInt64 Reserved3 : 4; + UInt64 PXN : 1; + UInt64 XN : 1; + UInt64 Reserved4 : 9; }; namespace Detail @@ -91,18 +102,19 @@ namespace Kernel::HAL } } // namespace Detail - struct PageDirectory64 final + struct PDE_4KB final { - LongDescLevel3 ALIGN(kPageAlign) Pte[kPageMax]; + PTE_4KB ALIGN(kPageAlign) fEntries[kPageMax]; }; - VoidPtr mm_alloc_bitmap(Boolean rw, Boolean user, SizeT size); + auto mm_alloc_bitmap(Boolean rw, Boolean user, SizeT size) -> VoidPtr; + auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; } // namespace Kernel::HAL namespace Kernel { - typedef HAL::LongDescLevel3 PTE; - typedef HAL::PageDirectory64 PDE; + typedef HAL::PTE_4KB PTE; + typedef HAL::PDE_4KB PDE; } // namespace Kernel EXTERN_C void hal_flush_tlb(); diff --git a/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx b/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx index cfb80c0f..1dc52b72 100644 --- a/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx +++ b/dev/ZKA/Sources/Storage/AHCIDeviceInterface.cxx @@ -9,9 +9,9 @@ using namespace Kernel; /// @brief Class constructor -/// @param Out Disk output -/// @param In Disk input -/// @param Cleanup Disk cleanup. +/// @param Out Drive output +/// @param In Drive input +/// @param Cleanup Drive cleanup. AHCIDeviceInterface::AHCIDeviceInterface(void (*Out)(MountpointInterface* outpacket), void (*In)(MountpointInterface* inpacket), void (*Cleanup)(void)) diff --git a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx index 97d2e2e4..78abada0 100644 --- a/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx +++ b/dev/ZKA/Sources/Storage/ATADeviceInterface.cxx @@ -9,9 +9,9 @@ using namespace Kernel; /// @brief Class constructor -/// @param Out Disk output -/// @param In Disk input -/// @param Cleanup Disk cleanup. +/// @param Out Drive output +/// @param In Drive input +/// @param Cleanup Drive cleanup. ATADeviceInterface::ATADeviceInterface( void (*Out)(MountpointInterface* outpacket), void (*In)(MountpointInterface* inpacket), diff --git a/doc/SCHEDULER_INFO.md b/doc/SCHEDULER_INFO.md deleted file mode 100644 index 1efbc329..00000000 --- a/doc/SCHEDULER_INFO.md +++ /dev/null @@ -1,7 +0,0 @@ -# List of ZKA schedulers.
-
-- User Process Scheduler.
-- Hardware Thread Scheduler.
-
-These schedulers are reserved only for the user code.
-Drivers and Kernel are running on the boot core.
|
