summaryrefslogtreecommitdiffhomepage
path: root/public/frameworks/DiskImage.fwrk/headers/DiskImage.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-20 20:30:18 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-20 20:30:18 +0100
commit1c43fb19cab6eb1121a6d41f4bbe180229a3ae9e (patch)
treeb69b6317a2e1ebeba7958024f9718e7ae705cee0 /public/frameworks/DiskImage.fwrk/headers/DiskImage.h
parent1d07547776d6890c4b4115ddc265b35e68f87936 (diff)
Refactored BootKit and DiskImage framework, minor kernel fixes
- Refactored BootKit classes: - Renamed `BTextWriter` → `BootTextWriter` - Renamed `BFileReader` → `BootFileReader` - Improved consistency across `BootKit.h`, `BootThread.cc`, and related files. - Updated NetBoot module: - Standardized text writer usage. - Improved error handling for missing patches and EEPROM flash. - DiskImage framework improvements: - Introduced `DI_DISK_IMAGE` struct. - Added new `DIFormatDisk()` and `DIFormatNeFS()` functions. - Improved error handling and structure alignment. - Kernel enhancements: - Updated PE loader structures for better readability. - Renamed PE header fields for consistency. - Improved SwapDisk API structure (`SwapDiskHdr` → `SWAP_DISK_HEADER`). Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'public/frameworks/DiskImage.fwrk/headers/DiskImage.h')
-rw-r--r--public/frameworks/DiskImage.fwrk/headers/DiskImage.h41
1 files changed, 28 insertions, 13 deletions
diff --git a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h
index ae94f154..011d5008 100644
--- a/public/frameworks/DiskImage.fwrk/headers/DiskImage.h
+++ b/public/frameworks/DiskImage.fwrk/headers/DiskImage.h
@@ -3,7 +3,7 @@
Copyright (C) 2025, Amlal EL Mahrouss, all rights reserved.
FILE: DiskImage.h
- PURPOSE: Disk Imaging.
+ PURPOSE: Disk Imaging framework.
------------------------------------------- */
@@ -14,15 +14,30 @@
#include <uuid/uuid.h>
#include <LibSCI/SCI.h>
-/// @brief EPM format disk to **out_name**
-/// @param disk_name The partition name
-/// @param sector_sz The sector size
-/// @param block_cnt The block count
-/// @param disk_sz The disk size (in bytes)
-/// @param out_name the output filesystem path.
-/// @return Status code regarding completion.
-SInt32 DIFormatDiskToFile(const char* disk_name = "Disk",
- int sector_sz = 512,
- const int block_cnt = 1,
- size_t disk_sz = gib_cast(4),
- const char* out_name = "disk.eimg") noexcept; \ No newline at end of file
+#define kDISectorSz (512)
+#define kDIMinDiskSz gib_cast(1)
+#define kDIDefaultOutputName "disk.eimg"
+
+#define kDISuccessStatus 0
+#define kDIFailureStatus 1
+
+struct DI_DISK;
+
+struct DI_DISK_IMAGE
+{
+ char disk_name[512] = "Disk Image";
+ int sector_sz = kDISectorSz;
+ const int block_cnt = 0;
+ size_t disk_sz = kDIMinDiskSz;
+ char out_name[256] = kDIDefaultOutputName;
+};
+
+/// @brief EPM format disk
+/// @param img disk image structure.
+/// @return Status code upon completion.
+SInt32 DIFormatDisk(struct DI_DISK_IMAGE& img) noexcept;
+
+/// @brief NeFS format over EPM.
+/// @param img disk image structure.
+/// @return Status code upon completion.
+SInt32 DIFormatNeFS(struct DI_DISK_IMAGE& img) noexcept;