diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-28 07:14:22 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-12-28 07:14:22 +0100 |
| commit | c973c9de6ff9b52675d7144fc5d5a3b42ccf1c36 (patch) | |
| tree | 7048b312593d3c6d5fc1f8801f604d0fd994603a | |
| parent | bc305c8805547a19292dc709ae8c494b42606ffb (diff) | |
FIX: Fix FBMgr and other fixes.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
| -rw-r--r-- | dev/Boot/BootKit/BootKit.h | 40 | ||||
| -rw-r--r-- | dev/Boot/src/HEL/AMD64/BootMain.cc | 6 | ||||
| -rw-r--r-- | dev/Mod/GfxMgr/FBMgr.h | 52 |
3 files changed, 49 insertions, 49 deletions
diff --git a/dev/Boot/BootKit/BootKit.h b/dev/Boot/BootKit/BootKit.h index e0e9f5c3..33400d02 100644 --- a/dev/Boot/BootKit/BootKit.h +++ b/dev/Boot/BootKit/BootKit.h @@ -213,13 +213,13 @@ namespace Boot ZKA_COPY_DELETE(BDiskFormatFactory); - /// @brief Format disk using partition name and fileBlobs. - /// @param Partition partName the target partition name. - /// @param fileBlobs blobs array. - /// @param blobCount blobs array count. + /// @brief Format disk using partition name and blob_list. + /// @param Partition part_name the target partition name. + /// @param blob_list blobs array. + /// @param blob_cnt blobs array count. /// @retval True disk has been formatted. /// @retval False failed to format. - Boolean Format(const Char* partName, BFileDescriptor* fileBlobs, SizeT blobCount); + Boolean Format(const Char* part_name, BFileDescriptor* blob_list, SizeT blob_cnt); /// @brief check if partition is good. Bool IsPartitionValid() noexcept @@ -261,12 +261,12 @@ namespace Boot private: /// @brief Write all of the requested catalogs into the filesystem. - /// @param fileBlobs the blobs. - /// @param blobCount the number of blobs to write. + /// @param blob_list the blobs. + /// @param blob_cnt the number of blobs to write. /// @param partBlock the NeFS partition block. - Boolean WriteRootCatalog(BFileDescriptor* fileBlobs, SizeT blobCount, NFS_ROOT_PARTITION_BLOCK& partBlock) + Boolean WriteRootCatalog(BFileDescriptor* blob_list, SizeT blob_cnt, NFS_ROOT_PARTITION_BLOCK& partBlock) { - BFileDescriptor* blob = fileBlobs; + BFileDescriptor* blob = blob_list; Lba startLba = partBlock.StartCatalog; BTextWriter writer; @@ -307,11 +307,11 @@ namespace Boot /// @retval True disk has been formatted. /// @retval False failed to format. template <typename BootDev> - inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* partName, - BDiskFormatFactory::BFileDescriptor* fileBlobs, - SizeT blobCount) + inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* part_name, + BDiskFormatFactory::BFileDescriptor* blob_list, + SizeT blob_cnt) { - if (!fileBlobs || !blobCount) + if (!blob_list || !blob_cnt) return false; /// sanity check /// @note A catalog roughly equal to a sector. @@ -324,18 +324,18 @@ namespace Boot { fb_init(); - FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_HEIGHT, ZKA_NO_DISK_WIDTH, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); - EFI::ThrowError(L"Drive-Too-Tiny", L"Can't format a New Filesystem partition here."); + FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_WIDTH, ZKA_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); + EFI::ThrowError(L"Drive-Too-Tiny", L"Can't format a NeFS partition here."); return false; } NFS_ROOT_PARTITION_BLOCK partBlock{0}; CopyMem(partBlock.Ident, kNeFSIdent, kNeFSIdentLen - 1); - CopyMem(partBlock.PartitionName, partName, StrLen(partName)); + CopyMem(partBlock.PartitionName, part_name, StrLen(part_name)); partBlock.Version = kNeFSVersionInteger; - partBlock.CatalogCount = blobCount; + partBlock.CatalogCount = blob_cnt; partBlock.Kind = kNeFSHardDrive; partBlock.SectorSize = sizeof(NFS_ROOT_PARTITION_BLOCK); partBlock.FreeCatalog = fDiskDev.GetSectorsCount() / sizeof(NFS_CATALOG_STRUCT); @@ -372,17 +372,17 @@ namespace Boot fDiskDev.Write((Char*)&epm_boot, sizeof(BOOT_BLOCK_STRUCT)); /// if we can write a root catalog, then write the partition block. - if (this->WriteRootCatalog(fileBlobs, blobCount, partBlock)) + if (this->WriteRootCatalog(blob_list, blob_cnt, partBlock)) { BTextWriter writer; - writer.Write(L"BootZ: Drive Formatted Successfully.\r"); + writer.Write(L"BootZ: Drive has been formatted Successfully.\r"); return true; } else { fb_init(); - FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_HEIGHT, ZKA_NO_DISK_WIDTH, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); + FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_WIDTH, ZKA_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); EFI::ThrowError(L"Filesystem-Failure-Part", L"Filesystem couldn't be partitioned, this drive cannot be formatted as an explicit partition map."); } diff --git a/dev/Boot/src/HEL/AMD64/BootMain.cc b/dev/Boot/src/HEL/AMD64/BootMain.cc index ec9e25c2..ed607d4b 100644 --- a/dev/Boot/src/HEL/AMD64/BootMain.cc +++ b/dev/Boot/src/HEL/AMD64/BootMain.cc @@ -145,7 +145,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, UI::ui_draw_background(); - FBDrawBitMapInRegion(zka_disk, ZKA_DISK_HEIGHT, ZKA_DISK_WIDTH, (kHandoverHeader->f_GOP.f_Width - ZKA_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_DISK_HEIGHT) / 2); + 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); fb_clear(); @@ -235,7 +235,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, UI::ui_draw_background(); - FBDrawBitMapInRegion(zka_has_disk, ZKA_HAS_DISK_HEIGHT, ZKA_HAS_DISK_WIDTH, (kHandoverHeader->f_GOP.f_Width - ZKA_HAS_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_HAS_DISK_HEIGHT) / 2); + 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); fb_clear(); } @@ -281,7 +281,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, else { fb_init(); - FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_HEIGHT, ZKA_NO_DISK_WIDTH, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); + FBDrawBitMapInRegion(zka_no_disk, ZKA_NO_DISK_WIDTH, ZKA_NO_DISK_HEIGHT, (kHandoverHeader->f_GOP.f_Width - ZKA_NO_DISK_WIDTH) / 2, (kHandoverHeader->f_GOP.f_Height - ZKA_NO_DISK_HEIGHT) / 2); EFI::Stop(); } diff --git a/dev/Mod/GfxMgr/FBMgr.h b/dev/Mod/GfxMgr/FBMgr.h index 862a6f02..c3ccc064 100644 --- a/dev/Mod/GfxMgr/FBMgr.h +++ b/dev/Mod/GfxMgr/FBMgr.h @@ -16,55 +16,55 @@ #define fb_clear() kCGCursor = 0 -/// @brief Performs OR drawing on the framebuffer. -#define FBDrawBitMapInRegionA(_BitMp, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT i = _BaseX; i < (_Height + _BaseX); ++i) \ +/// @brief Performs Alpha drawing on the framebuffer. +#define FBDrawBitMapInRegionA(reg_ptr, height, width, base_x, base_y) \ + for (Kernel::SizeT i = base_x; i < (width + base_x); ++i) \ { \ - for (Kernel::SizeT u = _BaseY; u < (_Width + _BaseY); ++u) \ + for (Kernel::SizeT u = base_y; u < (height + base_y); ++u) \ { \ *(((Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) |= (_BitMp)[kCGCursor]; \ + 4 * u))) |= (reg_ptr)[kCGCursor]; \ \ ++kCGCursor; \ } \ } -/// @brief Draws a resource. -#define FBDrawBitMapInRegion(_BitMp, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT i = _BaseX; i < (_Height + _BaseX); ++i) \ +/// @brief Performs drawing on the framebuffer. +#define FBDrawBitMapInRegion(reg_ptr, height, width, base_x, base_y) \ + for (Kernel::SizeT i = base_x; i < (width + base_x); ++i) \ { \ - for (Kernel::SizeT u = _BaseY; u < (_Width + _BaseY); ++u) \ + for (Kernel::SizeT u = base_y; u < (height + base_y); ++u) \ { \ *(((Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) = (_BitMp)[kCGCursor]; \ + 4 * u))) = (reg_ptr)[kCGCursor]; \ \ ++kCGCursor; \ } \ } -#define FBDrawBitMapInRegionToRgn(_Rgn, _BitMp, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT i = _BaseX; i < (_Height + _BaseX); ++i) \ +#define FBDrawBitMapInRegionToRgn(_Rgn, reg_ptr, height, width, base_x, base_y) \ + for (Kernel::SizeT i = base_x; i < (width + base_x); ++i) \ { \ - for (Kernel::SizeT u = _BaseY; u < (_Width + _BaseY); ++u) \ + for (Kernel::SizeT u = base_y; u < (height + base_y); ++u) \ { \ *(((Kernel::UInt32*)(_Rgn + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ i + \ - 4 * u))) = (_BitMp)[kCGCursor]; \ + 4 * u))) = (reg_ptr)[kCGCursor]; \ \ ++kCGCursor; \ } \ } /// @brief Cleans a resource. -#define CGClearRegion(_Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT i = _BaseX; i < _Height + _BaseX; ++i) \ +#define CGClearRegion(height, width, base_x, base_y) \ + for (Kernel::SizeT i = base_x; i < (width + base_x); ++i) \ { \ - for (Kernel::SizeT u = _BaseY; u < _Width + _BaseY; ++u) \ + for (Kernel::SizeT u = base_y; u < (height + base_y); ++u) \ { \ *(((volatile Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ @@ -74,10 +74,10 @@ } /// @brief Draws inside a zone. -#define FBDrawInRegion(_Clr, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT x_base = _BaseX; x_base < (_Width + _BaseX); ++x_base) \ +#define FBDrawInRegion(_Clr, height, width, base_x, base_y) \ + for (Kernel::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ { \ - for (Kernel::SizeT y_base = _BaseY; y_base < (_Height + _BaseY); ++y_base) \ + for (Kernel::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ { \ *(((volatile Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ @@ -87,10 +87,10 @@ } /// @brief Draws inside a zone. -#define FBDrawInRegionToRgn(_Rgn, _Clr, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT x_base = _BaseX; x_base < (_Width + _BaseX); ++x_base) \ +#define FBDrawInRegionToRgn(_Rgn, _Clr, height, width, base_x, base_y) \ + for (Kernel::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ { \ - for (Kernel::SizeT y_base = _BaseY; y_base < (_Height + _BaseY); ++y_base) \ + for (Kernel::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ { \ *(((volatile Kernel::UInt32*)(_Rgn + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ @@ -100,10 +100,10 @@ } \ } -#define FBDrawInRegionA(_Clr, _Height, _Width, _BaseX, _BaseY) \ - for (Kernel::SizeT x_base = _BaseX; x_base < (_Width + _BaseX); ++x_base) \ +#define FBDrawInRegionA(_Clr, height, width, base_x, base_y) \ + for (Kernel::SizeT x_base = base_x; x_base < (width + base_x); ++x_base) \ { \ - for (Kernel::SizeT y_base = _BaseY; y_base < (_Height + _BaseY); ++y_base) \ + for (Kernel::SizeT y_base = base_y; y_base < (height + base_y); ++y_base) \ { \ *(((volatile Kernel::UInt32*)(kHandoverHeader->f_GOP.f_The + \ 4 * kHandoverHeader->f_GOP.f_PixelPerLine * \ |
