diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-07 08:33:01 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-01-07 08:33:01 +0100 |
| commit | 3ce4b68fc3f1ad9ead503bb3f69bff11b4a3183a (patch) | |
| tree | 9d679d2092e71a35305ae6c6c9554bfc6528b6ca | |
| parent | ecf2a09a48ef029d09075af744c04e643661ec27 (diff) | |
FIX: KAN-12 (EPM GPF)
ADD: Dylib object instead of DLL objects.
ADD: Introduce CoreGfx instead of GfxMgr.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
27 files changed, 109 insertions, 105 deletions
diff --git a/dev/Boot/BootKit/BootKit.h b/dev/Boot/BootKit/BootKit.h index 003d3d9e..db21ba30 100644 --- a/dev/Boot/BootKit/BootKit.h +++ b/dev/Boot/BootKit/BootKit.h @@ -14,7 +14,7 @@ #include <BootKit/HW/ATA.h> #include <FirmwareKit/EPM.h> #include <CompilerKit/Version.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> #include <BootKit/Rsrc/zka_disk.rsrc> #include <BootKit/Rsrc/zka_no_disk.rsrc> #include <BootKit/Rsrc/zka_has_disk.rsrc> diff --git a/dev/Boot/Mod/SysChk/Module.cc b/dev/Boot/Mod/SysChk/Module.cc index bd89982d..400198ee 100644 --- a/dev/Boot/Mod/SysChk/Module.cc +++ b/dev/Boot/Mod/SysChk/Module.cc @@ -8,8 +8,8 @@ */ #include <BootKit/BootKit.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <FirmwareKit/EFI.h> #include <FirmwareKit/EFI/API.h> #include <FirmwareKit/Handover.h> @@ -19,7 +19,7 @@ #include <NewKit/Macros.h> #include <NewKit/Ref.h> #include <BootKit/BootThread.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> EXTERN_C Int32 ModuleMain(Kernel::HEL::BootInfoHeader* handover) { diff --git a/dev/Boot/src/BootFileReader.cc b/dev/Boot/src/BootFileReader.cc index e8f8772c..c0809e77 100644 --- a/dev/Boot/src/BootFileReader.cc +++ b/dev/Boot/src/BootFileReader.cc @@ -13,7 +13,7 @@ #include <BootKit/BootKit.h> #include <FirmwareKit/Handover.h> #include <FirmwareKit/EFI/API.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/TextMgr.h> /// @file BootFileReader /// @brief Bootloader File reader. diff --git a/dev/Boot/src/BootThread.cc b/dev/Boot/src/BootThread.cc index 15773b9b..ffa43063 100644 --- a/dev/Boot/src/BootThread.cc +++ b/dev/Boot/src/BootThread.cc @@ -13,7 +13,7 @@ #include <KernelKit/PE.h> #include <KernelKit/MSDOS.h> #include <CFKit/Utils.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/TextMgr.h> /// @brief External boot services symbol. EXTERN EfiBootServices* BS; diff --git a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc index 000e5b40..81d57ea2 100644 --- a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc +++ b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc @@ -5,8 +5,8 @@ ------------------------------------------- */ #include <BootKit/BootKit.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <FirmwareKit/EFI.h> #include <FirmwareKit/EFI/API.h> #include <FirmwareKit/Handover.h> @@ -16,7 +16,7 @@ #include <NewKit/Macros.h> #include <NewKit/Ref.h> #include <BootKit/BootThread.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> // Makes the compiler shut up. #ifndef kMachineModel @@ -140,7 +140,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, fb_init(); - UI::fb_clear_video(); + FB::fb_clear_video(); FBDrawBitMapInRegion(zka_disk, ZKA_DISK_WIDTH, ZKA_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_DISK_HEIGHT) / 2); @@ -240,7 +240,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, fb_init(); - UI::fb_clear_video(); + FB::fb_clear_video(); FBDrawBitMapInRegion(zka_has_disk, ZKA_HAS_DISK_WIDTH, ZKA_HAS_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_HAS_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_HAS_DISK_HEIGHT) / 2); diff --git a/dev/Boot/src/HEL/ARM64/EFIBootStartup.cc b/dev/Boot/src/HEL/ARM64/EFIBootStartup.cc index bf940074..87b2dc34 100644 --- a/dev/Boot/src/HEL/ARM64/EFIBootStartup.cc +++ b/dev/Boot/src/HEL/ARM64/EFIBootStartup.cc @@ -5,8 +5,8 @@ ------------------------------------------- */ #include <BootKit/BootKit.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <FirmwareKit/EFI.h> #include <FirmwareKit/EFI/API.h> #include <FirmwareKit/Handover.h> @@ -16,7 +16,7 @@ #include <NewKit/Macros.h> #include <NewKit/Ref.h> #include <BootKit/BootThread.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> // Makes the compiler shut up. #ifndef kMachineModel @@ -140,7 +140,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, fb_init(); - UI::fb_clear_video(); + FB::fb_clear_video(); FBDrawBitMapInRegion(zka_disk, ZKA_DISK_WIDTH, ZKA_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_DISK_HEIGHT) / 2); diff --git a/dev/Kernel/FirmwareKit/EFI/API.h b/dev/Kernel/FirmwareKit/EFI/API.h index ee4fcebb..4cf60df4 100644 --- a/dev/Kernel/FirmwareKit/EFI/API.h +++ b/dev/Kernel/FirmwareKit/EFI/API.h @@ -21,7 +21,7 @@ class BTextWriter; #define __BOOTKIT_NO_INCLUDE__ 1 #include <BootKit/BootKit.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> #endif // ifdef __ZBAOSLDR__ inline EfiSystemTable* ST = nullptr; diff --git a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc b/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc index 408826d0..6563f23c 100644 --- a/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/dev/Kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -11,7 +11,7 @@ #include <KernelKit/Semaphore.h> #include <KernelKit/UserProcessScheduler.h> #include <KernelKit/Timer.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <NewKit/KernelPanic.h> #include <KernelKit/HardwareThreadScheduler.h> diff --git a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc index 7b3e2345..e27e2efb 100644 --- a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc @@ -11,7 +11,7 @@ #include <Mod/ACPI/ACPIFactoryInterface.h> #include <NetworkKit/IPC.h> #include <CFKit/Property.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/TextMgr.h> EXTERN_C Kernel::VoidPtr kInterruptVectorTable[]; EXTERN_C Kernel::VoidPtr mp_user_switch_proc; diff --git a/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc b/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc index 6f8b292a..18296d22 100644 --- a/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc +++ b/dev/Kernel/HALKit/AMD64/HalKernelPanic.cc @@ -11,8 +11,8 @@ #include <NewKit/KString.h> #include <FirmwareKit/Handover.h> #include <KernelKit/FileMgr.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <NewKit/Utils.h> /* Each error code is attributed with an ID, which will prompt a string onto the diff --git a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc b/dev/Kernel/HALKit/ARM64/HalKernelMain.cc index 1869d97b..1a520994 100644 --- a/dev/Kernel/HALKit/ARM64/HalKernelMain.cc +++ b/dev/Kernel/HALKit/ARM64/HalKernelMain.cc @@ -6,7 +6,7 @@ #include "HALKit/ARM64/ApplicationProcessor.h" #include <ArchKit/ArchKit.h> -#include <Mod/GfxMgr/FBMgr.h> +#include <Mod/CoreGfx/FBMgr.h> #include <FirmwareKit/Handover.h> #include <KernelKit/FileMgr.h> #include <KernelKit/Heap.h> diff --git a/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc b/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc index 4cd61aff..cca564f8 100644 --- a/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc +++ b/dev/Kernel/HALKit/ARM64/HalKernelPanic.cc @@ -11,8 +11,8 @@ #include <NewKit/KString.h> #include <FirmwareKit/Handover.h> #include <KernelKit/FileMgr.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/TextMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/TextMgr.h> #include <NewKit/Utils.h> /* Each error code is attributed with an ID, which will prompt a string onto the diff --git a/dev/Kernel/KernelKit/CodeMgr.h b/dev/Kernel/KernelKit/CodeMgr.h index d3b9f39a..12a63dc0 100644 --- a/dev/Kernel/KernelKit/CodeMgr.h +++ b/dev/Kernel/KernelKit/CodeMgr.h @@ -16,7 +16,7 @@ #include <KernelKit/PECodeMgr.h> #include <KernelKit/PEFCodeMgr.h> -#include <KernelKit/IPEFDLLObject.h> +#include <KernelKit/IPEFDylibObject.h> namespace Kernel { diff --git a/dev/Kernel/KernelKit/DriveMgr.h b/dev/Kernel/KernelKit/DriveMgr.h index e907acf8..4c879ab5 100644 --- a/dev/Kernel/KernelKit/DriveMgr.h +++ b/dev/Kernel/KernelKit/DriveMgr.h @@ -164,6 +164,11 @@ namespace Kernel /// @brief Fetches the main drive. /// @return the new drive as a trait. DriveTrait io_construct_main_drive(Void) noexcept; + + namespace Detect + { + Void io_detect_drive(DriveTrait& trait); + } } // namespace Kernel #endif /* ifndef INC_DRIVE_MANAGER_H */ diff --git a/dev/Kernel/KernelKit/IDLLObject.h b/dev/Kernel/KernelKit/IDylibObject.h index 035f0013..d4c93034 100644 --- a/dev/Kernel/KernelKit/IDLLObject.h +++ b/dev/Kernel/KernelKit/IDylibObject.h @@ -12,16 +12,16 @@ #include <NewKit/Defines.h> #include <CompilerKit/CompilerKit.h> -#define ZKA_DLL_OBJECT : public IDLLObject +#define ZKA_DLL_OBJECT : public IDylibObject namespace Kernel { /// @brief DLL class object. A handle to a shared library. - class IDLLObject + class IDylibObject { public: - explicit IDLLObject() = default; - virtual ~IDLLObject() = default; + explicit IDylibObject() = default; + virtual ~IDylibObject() = default; struct DLL_TRAITS final { @@ -34,7 +34,7 @@ namespace Kernel } }; - ZKA_COPY_DEFAULT(IDLLObject); + ZKA_COPY_DEFAULT(IDylibObject); virtual DLL_TRAITS** GetAddressOf() = 0; virtual DLL_TRAITS* Get() = 0; diff --git a/dev/Kernel/KernelKit/IPEFDLLObject.h b/dev/Kernel/KernelKit/IPEFDylibObject.h index 1781c589..c8a69690 100644 --- a/dev/Kernel/KernelKit/IPEFDLLObject.h +++ b/dev/Kernel/KernelKit/IPEFDylibObject.h @@ -14,7 +14,7 @@ #include <NewKit/Defines.h> #include <KernelKit/PEFCodeMgr.h> #include <KernelKit/UserProcessScheduler.h> -#include <KernelKit/IDLLObject.h> +#include <KernelKit/IDylibObject.h> namespace Kernel { @@ -22,14 +22,14 @@ namespace Kernel * @brief Shared Library class * Load library from this class */ - class IPEFDLLObject final ZKA_DLL_OBJECT + class IPEFDylibObject final ZKA_DLL_OBJECT { public: - explicit IPEFDLLObject() = default; - ~IPEFDLLObject() = default; + explicit IPEFDylibObject() = default; + ~IPEFDylibObject() = default; public: - ZKA_COPY_DEFAULT(IPEFDLLObject); + ZKA_COPY_DEFAULT(IPEFDylibObject); private: DLL_TRAITS* fMounted{nullptr}; @@ -97,10 +97,10 @@ namespace Kernel PEFLoader* fLoader{nullptr}; }; - typedef IPEFDLLObject* IDLL; + typedef IPEFDylibObject* IDylib; - EXTERN_C IDLL rtl_init_dylib(UserThread& header); - EXTERN_C Void rtl_fini_dylib(UserThread& header, IDLL lib, Bool* successful); + EXTERN_C IDylib rtl_init_dylib(UserThread& header); + EXTERN_C Void rtl_fini_dylib(UserThread& header, IDylib lib, Bool* successful); } // namespace Kernel #endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */ diff --git a/dev/Kernel/KernelKit/UserProcessScheduler.h b/dev/Kernel/KernelKit/UserProcessScheduler.h index a08a5dc1..8212fdc2 100644 --- a/dev/Kernel/KernelKit/UserProcessScheduler.h +++ b/dev/Kernel/KernelKit/UserProcessScheduler.h @@ -30,7 +30,7 @@ namespace Kernel { //! @note Forward class declarations. - class IDLLObject; + class IDylibObject; class UserThread; class UserProcessTeam; class UserProcessScheduler; @@ -163,7 +163,7 @@ namespace Kernel UInt8* StackReserve{nullptr}; UserProcessImage Image{}; SizeT StackSize{kSchedMaxStackSz}; - IDLLObject* DylibDelegate{nullptr}; + IDylibObject* DylibDelegate{nullptr}; SizeT MemoryCursor{0UL}; SizeT MemoryLimit{kSchedMaxMemoryLimit}; SizeT UsedMemory{0UL}; diff --git a/dev/Kernel/src/DriveMgr.cc b/dev/Kernel/src/DriveMgr.cc index 8e8d5ab2..8ac5bdff 100644 --- a/dev/Kernel/src/DriveMgr.cc +++ b/dev/Kernel/src/DriveMgr.cc @@ -154,34 +154,34 @@ namespace Kernel return trait; } - namespace Detail + namespace Detect { - Void ioi_detect_drive(DriveTrait* trait) + Void io_detect_drive(DriveTrait& trait) { - static EPM_BOOT_BLOCK block_struct; + EPM_BOOT_BLOCK block_struct; - trait->fPacket.fPacketLba = kEPMBootBlockLba; - trait->fPacket.fPacketSize = sizeof(EPM_BOOT_BLOCK); - trait->fPacket.fPacketContent = &block_struct; + trait.fPacket.fPacketLba = kEPMBootBlockLba; + trait.fPacket.fPacketSize = sizeof(EPM_BOOT_BLOCK); + trait.fPacket.fPacketContent = &block_struct; - rt_copy_memory((VoidPtr) "fs/detect-packet", trait->fPacket.fPacketMime, + rt_copy_memory((VoidPtr) "fs/detect-packet", trait.fPacket.fPacketMime, rt_string_len("fs/detect-packet")); - trait->fInit(&trait->fPacket); + trait.fInit(&trait.fPacket); - trait->fInput(&trait->fPacket); + trait.fInput(&trait.fPacket); - if (rt_string_cmp(((BOOT_BLOCK_STRUCT*)trait->fPacket.fPacketContent)->Magic, kEPMMagic, kEPMMagicLength) == 0) + if (rt_string_cmp(((BOOT_BLOCK_STRUCT*)trait.fPacket.fPacketContent)->Magic, kEPMMagic, kEPMMagicLength) == 0) { - trait->fPacket.fPacketReadOnly = NO; - trait->fKind = kMassStorageDisc | kEPMDrive; + trait.fPacket.fPacketReadOnly = NO; + trait.fKind = kMassStorageDisc | kEPMDrive; kcout << "Formatted Disk is EPM (Mass Storage)\r"; } else { - trait->fPacket.fPacketReadOnly = YES; - trait->fKind = kMassStorageDisc | kUnformattedDrive | kReadOnlyDrive; + trait.fPacket.fPacketReadOnly = YES; + trait.fKind = kMassStorageDisc | kUnformattedDrive | kReadOnlyDrive; kcout << "Scheme Found: " << block_struct.Name << endl; @@ -189,12 +189,12 @@ namespace Kernel kcout << "Disk partition is unknown (Read Only)\r"; } - rt_copy_memory((VoidPtr) "*/*", trait->fPacket.fPacketMime, + rt_copy_memory((VoidPtr) "*/*", trait.fPacket.fPacketMime, rt_string_len("*/*")); - trait->fPacket.fPacketLba = 0; - trait->fPacket.fPacketSize = 0UL; - trait->fPacket.fPacketContent = nullptr; + trait.fPacket.fPacketLba = 0; + trait.fPacket.fPacketSize = 0UL; + trait.fPacket.fPacketContent = nullptr; } } // namespace Detail @@ -202,9 +202,9 @@ namespace Kernel /// @return the new drive. (returns kEPMDrive if EPM formatted) DriveTrait io_construct_main_drive() noexcept { - DriveTrait trait{}; + DriveTrait trait; - const auto kMainDrive = "/Mount/OS:"; + constexpr auto kMainDrive = "/Mount/OS:"; rt_copy_memory((VoidPtr)kMainDrive, trait.fName, rt_string_len(kMainDrive)); @@ -216,9 +216,9 @@ namespace Kernel trait.fInit = io_drv_init; trait.fDriveKind = io_drv_kind; - kcout << "Detecting partition scheme of: " << trait.fName << ".\r"; + Detect::io_detect_drive(trait); - Detail::ioi_detect_drive(&trait); + kcout << "Detecting partition scheme of: " << trait.fName << ".\r"; return trait; } diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc index b0a7c6c6..902b57a8 100644 --- a/dev/Kernel/src/FS/NeFS.cc +++ b/dev/Kernel/src/FS/NeFS.cc @@ -1055,10 +1055,7 @@ namespace Kernel::Detail kcout << "Creating A:\r"; kDiskMountpoint.A() = io_construct_main_drive(); - kDiskMountpoint.B() = io_construct_blank_drive(); - kDiskMountpoint.C() = io_construct_blank_drive(); - kDiskMountpoint.D() = io_construct_blank_drive(); - + kcout << "Creating A: [ OK ]\r"; return true; diff --git a/dev/Kernel/src/IDLLObject.cc b/dev/Kernel/src/IDylibObject.cc index f0129eca..27e2d14f 100644 --- a/dev/Kernel/src/IDLLObject.cc +++ b/dev/Kernel/src/IDylibObject.cc @@ -7,7 +7,7 @@ * ======================================================== */ -#include <KernelKit/IDLLObject.h> +#include <KernelKit/IDylibObject.h> #include <KernelKit/DebugOutput.h> #include <KernelKit/UserProcessScheduler.h> diff --git a/dev/Kernel/src/IPEFDLLObject.cc b/dev/Kernel/src/IPEFDylibObject.cc index 1b8d2451..1e2831ef 100644 --- a/dev/Kernel/src/IPEFDLLObject.cc +++ b/dev/Kernel/src/IPEFDylibObject.cc @@ -9,7 +9,7 @@ #include <KernelKit/DebugOutput.h> #include <KernelKit/PEF.h> -#include <KernelKit/IPEFDLLObject.h> +#include <KernelKit/IPEFDylibObject.h> #include <KernelKit/UserProcessScheduler.h> #include <KernelKit/ThreadLocalStorage.h> #include <NewKit/Defines.h> @@ -31,41 +31,41 @@ using namespace Kernel; /***********************************************************************************/ -/// @file IPEFDLLObject.cc -/// @brief PEF's DLL runtime. +/// @file IPEFDylibObject.cc +/// @brief PEF's Dylib runtime. /***********************************************************************************/ /***********************************************************************************/ /** @brief Library initializer. */ /***********************************************************************************/ -EXTERN_C IDLL rtl_init_dylib(UserThread& header) +EXTERN_C IDylib rtl_init_dylib(UserThread& thread) { - IDLL dll_obj = tls_new_class<IPEFDLLObject>(); + IDylib dll_obj = tls_new_class<IPEFDylibObject>(); if (!dll_obj) { - header.Crash(); + thread.Crash(); return nullptr; } - dll_obj->Mount(tls_new_class<IPEFDLLObject::DLL_TRAITS>()); + dll_obj->Mount(new IPEFDylibObject::DLL_TRAITS()); if (!dll_obj->Get()) { tls_delete_class(dll_obj); - header.Crash(); + thread.Crash(); return nullptr; } dll_obj->Get()->ImageObject = - header.Image.fBlob; + thread.Image.fBlob; if (!dll_obj->Get()->ImageObject) { tls_delete_class(dll_obj); - header.Crash(); + thread.Crash(); return nullptr; } @@ -83,7 +83,7 @@ EXTERN_C IDLL rtl_init_dylib(UserThread& header) /** @param successful Reports if successful or not. */ /***********************************************************************************/ -EXTERN_C Void rtl_fini_dylib(UserThread& header, IDLL dll_obj, Bool* successful) +EXTERN_C Void rtl_fini_dylib(UserThread& thread, IDylib dll_obj, Bool* successful) { MUST_PASS(successful); @@ -91,7 +91,7 @@ EXTERN_C Void rtl_fini_dylib(UserThread& header, IDLL dll_obj, Bool* successful) if (dll_obj == nullptr) { *successful = false; - header.Crash(); + thread.Crash(); } delete dll_obj->Get(); diff --git a/dev/Kernel/src/UserProcessScheduler.cc b/dev/Kernel/src/UserProcessScheduler.cc index 55d3474b..6cd7fb0b 100644 --- a/dev/Kernel/src/UserProcessScheduler.cc +++ b/dev/Kernel/src/UserProcessScheduler.cc @@ -14,7 +14,7 @@ #include <KernelKit/UserProcessScheduler.h> #include <KernelKit/HardwareThreadScheduler.h> -#include <KernelKit/IPEFDLLObject.h> +#include <KernelKit/IPEFDylibObject.h> #include <ArchKit/ArchKit.h> #include <KernelKit/Heap.h> #include <NewKit/KString.h> @@ -252,7 +252,7 @@ namespace Kernel { Bool success = false; - rtl_fini_dylib(*this, reinterpret_cast<IPEFDLLObject*>(this->DylibDelegate), &success); + rtl_fini_dylib(*this, reinterpret_cast<IPEFDylibObject*>(this->DylibDelegate), &success); if (!success) { diff --git a/dev/Mod/GfxMgr/AccessibilityMgr.h b/dev/Mod/CoreGfx/AccessibilityMgr.h index 45e32529..f853afae 100644 --- a/dev/Mod/GfxMgr/AccessibilityMgr.h +++ b/dev/Mod/CoreGfx/AccessibilityMgr.h @@ -9,11 +9,11 @@ #include <NewKit/NewKit.h> #include <KernelKit/LPC.h> -#include <Mod/GfxMgr/FBMgr.h> -#include <Mod/GfxMgr/MathMgr.h> +#include <Mod/CoreGfx/FBMgr.h> +#include <Mod/CoreGfx/MathMgr.h> #include <ArchKit/ArchKit.h> -namespace UI +namespace FB { using namespace Kernel; diff --git a/dev/Mod/GfxMgr/FBMgr.h b/dev/Mod/CoreGfx/FBMgr.h index 87abfeca..fab08f60 100644 --- a/dev/Mod/GfxMgr/FBMgr.h +++ b/dev/Mod/CoreGfx/FBMgr.h @@ -130,16 +130,18 @@ #endif // __ZKA_AMD64__ #ifndef GFX_MGR_ACCESSIBILITY_H -#include <Mod/GfxMgr/AccessibilityMgr.h> +#include <Mod/CoreGfx/AccessibilityMgr.h> #endif // ifndef GFX_MGR_ACCESSIBILITY_H -namespace UI +namespace FB { + struct FB_CONTROL_BLOCK; + inline void fb_clear_video() noexcept { fb_init(); - FBDrawInRegion(fb_get_clear_clr(), UI::UIAccessibilty::Height(), UI::UIAccessibilty::Width(), + FBDrawInRegion(fb_get_clear_clr(), FB::UIAccessibilty::Height(), FB::UIAccessibilty::Width(), 0, 0); fb_clear(); diff --git a/dev/Mod/GfxMgr/MathMgr.h b/dev/Mod/CoreGfx/MathMgr.h index ea0beb4f..2e31844c 100644 --- a/dev/Mod/GfxMgr/MathMgr.h +++ b/dev/Mod/CoreGfx/MathMgr.h @@ -18,12 +18,12 @@ namespace UI #endif /// @brief Linear interpolation equation solver. - /// @param from where? - /// @param to to? - /// @param at which state we're at **to**. + /// @param from where to start + /// @param to to which value. + /// @param stat + /// @return Linear interop value. inline fb_real_t fb_math_lerp(fb_real_t to, fb_real_t from, fb_real_t stat) { - fb_real_t difference = to - from; - return from + (difference * stat); + return (from) + (to - from) * stat; } } // namespace UI
\ No newline at end of file diff --git a/dev/Mod/GfxMgr/TextMgr.h b/dev/Mod/CoreGfx/TextMgr.h index 4aa3da0c..c2f5c8a4 100644 --- a/dev/Mod/GfxMgr/TextMgr.h +++ b/dev/Mod/CoreGfx/TextMgr.h @@ -7,13 +7,13 @@ #pragma once
#include <NewKit/Defines.h>
-#include <Mod/GfxMgr/FBMgr.h>
+#include <Mod/CoreGfx/FBMgr.h>
-#define FONT_SIZE_X 8
-#define FONT_SIZE_Y 8
-#define FONT_NOF_CHARS 128
+#define kFontSizeX 8
+#define kFontSizeY 8
+#define kFontNOFChars 128
-inline const Kernel::UInt8 kFontBitmap[FONT_NOF_CHARS][FONT_SIZE_X] = {
+inline const Kernel::UInt8 kFontBitmap[kFontNOFChars][kFontSizeX] = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0000 (nul)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0001
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0002
@@ -172,7 +172,7 @@ inline Kernel::Void fb_render_string(const Kernel::Char* text, Kernel::Int32 x_d {
for (Kernel::SizeT i = 0; text[i] != 0; ++i)
{
- fb_render_string_for_bitmap(&kFontBitmap[text[i]][0], FONT_SIZE_X, FONT_SIZE_Y, x_dst, y_dst, color);
- y_dst += FONT_SIZE_Y;
+ fb_render_string_for_bitmap(&kFontBitmap[text[i]][0], kFontSizeX, kFontSizeY, x_dst, y_dst, color);
+ y_dst += kFontSizeY;
}
}
diff --git a/doc/OS-Design.drawio b/doc/OS-Design.drawio index 20efc042..130c3d3e 100644 --- a/doc/OS-Design.drawio +++ b/doc/OS-Design.drawio @@ -1,22 +1,22 @@ <mxfile host="65bd71144e"> <diagram name="Page-1" id="lDkK2i6CeL2VbSOVDvrP"> - <mxGraphModel dx="764" dy="289" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> + <mxGraphModel dx="1144" dy="743" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0"> <root> <mxCell id="0"/> <mxCell id="1" parent="0"/> - <mxCell id="ifhO3zQZNW-sXvZMTmu8-2" value="LibSCI DLL (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxCell id="ifhO3zQZNW-sXvZMTmu8-2" value="LibSCI Dylib (RING 3) (EL0)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxGeometry x="235.5" y="340" width="360" height="30" as="geometry"/> </mxCell> - <mxCell id="ifhO3zQZNW-sXvZMTmu8-3" value="DLLs, programs and services. (RING 3)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxCell id="ifhO3zQZNW-sXvZMTmu8-3" value="Dylibs and Applications. (RING 3) (EL0)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxGeometry x="235.5" y="295" width="360" height="35" as="geometry"/> </mxCell> - <mxCell id="ifhO3zQZNW-sXvZMTmu8-8" value="<h1 style="margin-top: 0px;"><span style="background-color: initial;">System</span></h1><h1 style="margin-top: 0px;"><span style="font-size: 12px; font-weight: 400;">This describes how ZKA is structued and how we're supposed to deal with (rings included.)</span></h1>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1"> - <mxGeometry x="620" y="290" width="180" height="180" as="geometry"/> + <mxCell id="ifhO3zQZNW-sXvZMTmu8-8" value="<h1 style="margin-top: 0px;"><span style="background-color: initial;">OS's Design</span></h1><h1 style="margin-top: 0px;"><span style="font-size: 12px; font-weight: 400;">This describes how ZKA is structued and how we're supposed to deal with (rings included.)</span></h1>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="620" y="310" width="180" height="180" as="geometry"/> </mxCell> - <mxCell id="ifhO3zQZNW-sXvZMTmu8-13" value="NewOS MP Kernel, DDK and it's drivers. (RING 0)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxCell id="ifhO3zQZNW-sXvZMTmu8-13" value="NewOS MP Kernel, DDK and it's drivers. (RING 0) (EL1)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxGeometry x="235.5" y="450" width="360" height="60" as="geometry"/> </mxCell> - <mxCell id="4" value="LibSCI and DDK syscalls/kerncalls (RING 0/RING 2)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> + <mxCell id="4" value="LibSCI and DDK syscalls/kerncalls (RING 0/RING 2) (EL0, EL1)" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxGeometry x="235.5" y="380" width="360" height="60" as="geometry"/> </mxCell> </root> |
