From eb5271c14e02aab956ab53f5e74290bca495e2ff Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 28 Dec 2024 05:03:47 +0100 Subject: See details of commit. IMPL: Better Bootloader architecture. FIX: Remove overcomplicated FbMgr code. IMPL: Implement the SwapMgrDisk function to dump process data to disk. FIX: Fix the format system in Boot. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/ARM64/Storage/HalFlashMemory.cc | 66 ---------------------- dev/Kernel/HALKit/ARM64/Storage/HalMFlash.cc | 67 +++++++++++++++++++++++ 2 files changed, 67 insertions(+), 66 deletions(-) delete mode 100644 dev/Kernel/HALKit/ARM64/Storage/HalFlashMemory.cc create mode 100644 dev/Kernel/HALKit/ARM64/Storage/HalMFlash.cc (limited to 'dev/Kernel/HALKit') diff --git a/dev/Kernel/HALKit/ARM64/Storage/HalFlashMemory.cc b/dev/Kernel/HALKit/ARM64/Storage/HalFlashMemory.cc deleted file mode 100644 index d5a9ecf4..00000000 --- a/dev/Kernel/HALKit/ARM64/Storage/HalFlashMemory.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* ------------------------------------------- - - Copyright (C) 2024, Theater Quality Inc, all rights reserved. - -------------------------------------------- */ - -#include -#include - -/// @file Flash.cc -/// @brief Flash memory builtin. - -#ifdef ZKA_USE_MBCI_FLASH - -#define kMaxFlash (4U) - -namespace Kernel -{ - /// /Mount/Flash/n - constexpr auto kFlashBridgeMagic = "FLSH"; - constexpr auto kFlashBridgeRevision = 1; - - STATIC const Boolean kFlashEnabled = No; - STATIC SizeT kFlashSize[kMaxFlash] = {}; - STATIC SizeT kFlashSectorSz[kMaxFlash] = {}; - - /// @brief Enable flash memory builtin. - STATIC Void drv_enable_flash(Int32 slot); - - /// @brief Disable flash memory builtin. - STATIC Void drv_disable_flash(Int32 slot); - - /// @brief get sector count. - /// @return drive sector count. - SizeT drv_get_sector_count(Int32 slot) - { - if (slot > kMaxFlash) - return 0; - - return kFlashSectorSz[slot]; - } - - /// @brief get device size. - /// @return drive size - SizeT drv_get_size(Int32 slot) - { - if (slot > kMaxFlash) - return 0; - - return kFlashSize[slot]; - } - - /// @brief Enable flash memory at slot. - STATIC Void drv_enable_flash(Int32 arg) - { - kcout << "Enabled FLSH hardware.\r"; - } - - /// @brief Disable flash memory at slot. - STATIC Void drv_disable_flash(Int32 arg) - { - kcout << "Disabled FLSH hardware.\r"; - } -} // namespace Kernel - -#endif // if ZKA_USE_MBCI_FLASH (Bridge) diff --git a/dev/Kernel/HALKit/ARM64/Storage/HalMFlash.cc b/dev/Kernel/HALKit/ARM64/Storage/HalMFlash.cc new file mode 100644 index 00000000..bc892e26 --- /dev/null +++ b/dev/Kernel/HALKit/ARM64/Storage/HalMFlash.cc @@ -0,0 +1,67 @@ +/* ------------------------------------------- + + Copyright (C) 2024, Theater Quality Inc, all rights reserved. + +------------------------------------------- */ + +#ifdef ZKA_USE_MBCI_FLASH + +#include +#include +#include + +/// @file HalMFlash.cc +/// @brief MBCI Flash builtin. + +#define kMaxFlash (4U) + +namespace Kernel +{ + /// /Mount/Flash/n + constexpr auto kFlashBridgeMagic = "FLSH"; + constexpr auto kFlashBridgeRevision = 1; + + STATIC CONST Boolean kFlashEnabled = No; + STATIC SizeT kFlashSize[kMaxFlash] = {}; + STATIC SizeT kFlashSectorSz[kMaxFlash] = {}; + + /// @brief Enable flash memory builtin. + STATIC Void drv_enable_flash(Int32 slot); + + /// @brief Disable flash memory builtin. + STATIC Void drv_disable_flash(Int32 slot); + + /// @brief get sector count. + /// @return drive sector count. + SizeT drv_get_sector_count(Int32 slot) + { + if (slot > kMaxFlash) + return 0; + + return kFlashSectorSz[slot]; + } + + /// @brief get device size. + /// @return drive size + SizeT drv_get_size(Int32 slot) + { + if (slot > kMaxFlash) + return 0; + + return kFlashSize[slot]; + } + + /// @brief Enable flash memory at slot. + STATIC Void drv_enable_flash(Int32 arg) + { + kcout << "Enabled FLSH hardware.\r"; + } + + /// @brief Disable flash memory at slot. + STATIC Void drv_disable_flash(Int32 arg) + { + kcout << "Disabled FLSH hardware.\r"; + } +} // namespace Kernel + +#endif // if ZKA_USE_MBCI_FLASH (Bridge) -- cgit v1.2.3