diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-23 22:27:47 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-23 22:27:47 +0200 |
| commit | b55d3ac738b40677c579221b4f0dbf294dc3b017 (patch) | |
| tree | 2ce2089d58f1d5d1bfca642442e20c2b4ad8255c | |
| parent | 46d60a746e86270e0f2a66f724e809fca32679c0 (diff) | |
dev, kernel: necessary refactors regarding future changes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -rw-r--r-- | dev/kernel/FSKit/Ext2.h | 2 | ||||
| -rw-r--r-- | dev/kernel/FSKit/HeFS.h | 63 | ||||
| -rw-r--r-- | dev/kernel/FSKit/IndexableProperty.h | 5 | ||||
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalKernelMain.cc | 2 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/CoreProcessScheduler.h (renamed from dev/kernel/KernelKit/ProcessSchedulerCore.h) | 0 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/HardwareThreadScheduler.h | 8 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/IPEFDylibObject.h | 4 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/PE.h | 13 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/PECodeMgr.h | 55 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/PEFCodeMgr.h | 4 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/UserProcessScheduler.h | 2 | ||||
| -rw-r--r-- | dev/kernel/KernelKit/UserProcessScheduler.inl | 6 | ||||
| -rw-r--r-- | dev/kernel/src/IPEFDylibObject.cc | 10 | ||||
| -rw-r--r-- | dev/kernel/src/UserProcessScheduler.cc | 6 | ||||
| -rw-r--r-- | dev/user/Macros.h | 2 | ||||
| -rw-r--r-- | public/tools/mk.hefs/src/CommandLine.cc | 3 | ||||
| -rw-r--r-- | public/tools/mk.nefs/src/CommandLine.cc | 3 | ||||
| -rwxr-xr-x | tooling/mk_img.py | 10 |
18 files changed, 134 insertions, 64 deletions
diff --git a/dev/kernel/FSKit/Ext2.h b/dev/kernel/FSKit/Ext2.h index 856654d6..c27eb5f9 100644 --- a/dev/kernel/FSKit/Ext2.h +++ b/dev/kernel/FSKit/Ext2.h @@ -26,6 +26,7 @@ #define kExt2FSRev0 (0) #define kExt2FSRev1 (1) +/// @brief EXT2's file types. enum { kExt2FileTypeUnknown = 0, @@ -38,6 +39,7 @@ enum kExt2FileTypeSymbolicLink = 7 }; +/// @brief The super block structure, located at LBA 1024. struct PACKED EXT2_SUPER_BLOCK final { Kernel::UInt32 fInodeCount; diff --git a/dev/kernel/FSKit/HeFS.h b/dev/kernel/FSKit/HeFS.h index 60f1342a..2d4562c4 100644 --- a/dev/kernel/FSKit/HeFS.h +++ b/dev/kernel/FSKit/HeFS.h @@ -81,6 +81,13 @@ inline constexpr UInt16 kHeFSBlockCount = 0x10; inline constexpr UInt16 kHeFSInvalidVID = 0xFFFF;
+namespace Kernel
+{
+ /// @brief Access time type.
+ /// @details Used to keep track of the INode, INodeDir allocation status.
+ typedef UInt64 ATime;
+} // namespace Kernel
+
/// @brief HeFS Boot node.
/// @details Acts like a superblock, it contains the information about the filesystem.
/// @note The boot node is the first block of the filesystem.
@@ -108,12 +115,8 @@ struct PACKED HEFS_BOOT_NODE final Kernel::UInt64 fReserved4; /// @brief Reserved for future use.
};
-/// @brief Access time type.
-/// @details Used to keep track of the INode, INodeDir allocation status.
-typedef Kernel::UInt64 ATime;
-
-inline constexpr ATime kHeFSTimeInvalid = 0x0000000000000000;
-inline constexpr ATime kHeFSTimeMax = 0xFFFFFFFFFFFFFFFF;
+inline constexpr Kernel::ATime kHeFSTimeInvalid = 0x0000000000000000;
+inline constexpr Kernel::ATime kHeFSTimeMax = 0xFFFFFFFFFFFFFFFF;
/// @brief HeFS index node.
/// @details This structure is used to store the file information of a file.
@@ -127,7 +130,7 @@ struct PACKED ALIGN(8) HEFS_INDEX_NODE final Kernel::UInt32 fSize; /// @brief File size.
Kernel::UInt32 fChecksum, fRecoverChecksum, fBlockChecksum, fLinkChecksum; /// @brief Checksum of the file, recovery checksum, block checksum, link checksum.
- ATime fCreated, fAccessed, fModified, fDeleted; /// @brief File timestamps.
+ Kernel::ATime fCreated, fAccessed, fModified, fDeleted; /// @brief File timestamps.
Kernel::UInt32 fUID, fGID; /// @brief User ID and Group ID of the file.
Kernel::UInt32 fMode; /// @brief File mode. (read, write, execute, etc).
@@ -160,7 +163,7 @@ struct PACKED ALIGN(8) HEFS_INDEX_NODE_DIRECTORY final Kernel::UInt32 fSize; /// @brief Size of the directory.
Kernel::UInt32 fChecksum, fIndexNodeChecksum; /// @brief Checksum of the file, index node checksum.
- ATime fCreated, fAccessed, fModified, fDeleted; /// @brief File timestamps.
+ Kernel::ATime fCreated, fAccessed, fModified, fDeleted; /// @brief File timestamps.
Kernel::UInt32 fUID, fGID; /// @brief User ID and Group ID of the file.
Kernel::UInt32 fMode; /// @brief File mode. (read, write, execute, etc).
@@ -177,47 +180,47 @@ struct PACKED ALIGN(8) HEFS_INDEX_NODE_DIRECTORY final namespace Kernel::Detail
{
- /// @brief HeFS get year from ATime.
- /// @param raw_atime the raw ATime value.
+ /// @brief HeFS get year from Kernel::ATime.
+ /// @param raw_atime the raw Kernel::ATime value.
/// @return the year value.
- /// @note The year is stored in the upper 32 bits of the ATime value.
- inline UInt32 hefs_year_get(ATime raw_atime) noexcept
+ /// @note The year is stored in the upper 32 bits of the Kernel::ATime value.
+ inline UInt32 hefs_year_get(Kernel::ATime raw_atime) noexcept
{
return (raw_atime) >> 32;
}
- /// @brief HeFS get month from ATime.
- /// @param raw_atime the raw ATime value.
+ /// @brief HeFS get month from Kernel::ATime.
+ /// @param raw_atime the raw Kernel::ATime value.
/// @return the month value.
- /// @note The month is stored in the upper 24 bits of the ATime value.
- inline UInt32 hefs_month_get(ATime raw_atime) noexcept
+ /// @note The month is stored in the upper 24 bits of the Kernel::ATime value.
+ inline UInt32 hefs_month_get(Kernel::ATime raw_atime) noexcept
{
return (raw_atime) >> 24;
}
- /// @brief HeFS get day from ATime.
- /// @param raw_atime the raw ATime value.
+ /// @brief HeFS get day from Kernel::ATime.
+ /// @param raw_atime the raw Kernel::ATime value.
/// @return the day value.
- /// @note The day is stored in the upper 16 bits of the ATime value.
- inline UInt32 hefs_day_get(ATime raw_atime) noexcept
+ /// @note The day is stored in the upper 16 bits of the Kernel::ATime value.
+ inline UInt32 hefs_day_get(Kernel::ATime raw_atime) noexcept
{
return (raw_atime) >> 16;
}
- /// @brief HeFS get hour from ATime.
- /// @param raw_atime the raw ATime value.
+ /// @brief HeFS get hour from Kernel::ATime.
+ /// @param raw_atime the raw Kernel::ATime value.
/// @return the hour value.
- /// @note The hour is stored in the upper 8 bits of the ATime value.
- inline UInt32 hefs_hour_get(ATime raw_atime) noexcept
+ /// @note The hour is stored in the upper 8 bits of the Kernel::ATime value.
+ inline UInt32 hefs_hour_get(Kernel::ATime raw_atime) noexcept
{
return (raw_atime) >> 8;
}
- /// @brief HeFS get minute from ATime.
- /// @param raw_atime the raw ATime value.
+ /// @brief HeFS get minute from Kernel::ATime.
+ /// @param raw_atime the raw Kernel::ATime value.
/// @return the minute value.
- /// @note The minute is stored in the lower 8 bits of the ATime value.
- inline UInt32 hefs_minute_get(ATime raw_atime) noexcept
+ /// @note The minute is stored in the lower 8 bits of the Kernel::ATime value.
+ inline UInt32 hefs_minute_get(Kernel::ATime raw_atime) noexcept
{
return (raw_atime)&0xFF;
}
@@ -262,7 +265,6 @@ namespace Kernel::Detail case kHeFSFlashDrive:
return "Flash Drive";
case kHeFSUnknown:
- return "Unknown";
default:
return "Unknown";
}
@@ -314,7 +316,6 @@ namespace Kernel::Detail case kHeFSFileKindSymbolicLink:
return "Symbolic Link";
case kHeFSFileKindUnknown:
- return "Unknown";
default:
return "Unknown";
}
@@ -376,6 +377,6 @@ namespace Kernel _Output Bool FormatGPT(_Input _Output DriveTrait* drive, _Input const Lba end_lba, _Input const Int32 flags, const Char* part_name);
public:
- UInt32 mDriveIndex{MountpointInterface::kDriveIndexA}; /// @brief Drive index.
+ UInt32 mDriveIndex{MountpointInterface::kDriveIndexA}; /// @brief The drive index which this filesystem is mounted on.
};
} // namespace Kernel
\ No newline at end of file diff --git a/dev/kernel/FSKit/IndexableProperty.h b/dev/kernel/FSKit/IndexableProperty.h index 4dbeb9f4..96853fbc 100644 --- a/dev/kernel/FSKit/IndexableProperty.h +++ b/dev/kernel/FSKit/IndexableProperty.h @@ -10,8 +10,9 @@ #include <CompilerKit/CompilerKit.h> #include <KernelKit/DriveMgr.h> -#define kIndexerCatalogNameLength 256U -#define kIndexerClaimed 0xCF +#define kIndexerCatalogNameLength (256U) +#define kIndexerClaimed (0xCF) +#define kIndexerUnclaimed (0xCA) namespace Kernel { diff --git a/dev/kernel/HALKit/AMD64/HalKernelMain.cc b/dev/kernel/HALKit/AMD64/HalKernelMain.cc index 833788fe..3686a48f 100644 --- a/dev/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/kernel/HALKit/AMD64/HalKernelMain.cc @@ -25,7 +25,7 @@ STATIC Kernel::Void hal_pre_init_scheduler() noexcept { for (Kernel::SizeT i = 0U; i < Kernel::UserProcessScheduler::The().CurrentTeam().AsArray().Count(); ++i) { - Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::USER_PROCESS(); + Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::USER_PROCESS(); } } diff --git a/dev/kernel/KernelKit/ProcessSchedulerCore.h b/dev/kernel/KernelKit/CoreProcessScheduler.h index bd493140..bd493140 100644 --- a/dev/kernel/KernelKit/ProcessSchedulerCore.h +++ b/dev/kernel/KernelKit/CoreProcessScheduler.h diff --git a/dev/kernel/KernelKit/HardwareThreadScheduler.h b/dev/kernel/KernelKit/HardwareThreadScheduler.h index 9af22715..4d2ebc73 100644 --- a/dev/kernel/KernelKit/HardwareThreadScheduler.h +++ b/dev/kernel/KernelKit/HardwareThreadScheduler.h @@ -57,12 +57,12 @@ namespace Kernel operator bool(); public: - void Wake(const bool wakeup = false) noexcept; - void Busy(const bool busy = false) noexcept; + void Wake(const BOOL wakeup = false) noexcept; + void Busy(const BOOL busy = false) noexcept; public: - bool Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid); - bool IsWakeup() noexcept; + BOOL Switch(VoidPtr image, Ptr8 stack_ptr, HAL::StackFramePtr frame, const ThreadID& pid); + BOOL IsWakeup() noexcept; public: HAL::StackFramePtr StackFrame() noexcept; diff --git a/dev/kernel/KernelKit/IPEFDylibObject.h b/dev/kernel/KernelKit/IPEFDylibObject.h index 82f08932..a708fb6c 100644 --- a/dev/kernel/KernelKit/IPEFDylibObject.h +++ b/dev/kernel/KernelKit/IPEFDylibObject.h @@ -99,8 +99,8 @@ namespace Kernel typedef IPEFDylibObject* IDylibRef; - EXTERN_C IDylibRef rtl_init_dylib(USER_PROCESS& header); - EXTERN_C Void rtl_fini_dylib(USER_PROCESS& header, IDylibRef lib, Bool* successful); + EXTERN_C IDylibRef rtl_init_dylib_pef(USER_PROCESS& header); + EXTERN_C Void rtl_fini_dylib_pef(USER_PROCESS& header, IDylibRef lib, Bool* successful); } // namespace Kernel #endif /* ifndef __KERNELKIT_SHARED_OBJECT_H__ */ diff --git a/dev/kernel/KernelKit/PE.h b/dev/kernel/KernelKit/PE.h index fbf8fc20..e2184918 100644 --- a/dev/kernel/KernelKit/PE.h +++ b/dev/kernel/KernelKit/PE.h @@ -16,16 +16,13 @@ #include <NewKit/Defines.h> -#define kPeSignature 0x00004550 +#define kPeSignature (0x00004550) -#define kPeDLLBase 0x4000000 -#define kPeEXEBase 0x1000000 +#define kPeMagic32 (0x010b) +#define kPeMagic64 (0x020b) -#define kPeMagic32 0x010b -#define kPeMagic64 0x020b - -#define kPeMachineAMD64 0x8664 -#define kPeMachineARM64 0xaa64 +#define kPeMachineAMD64 (0x8664) +#define kPeMachineARM64 (0xaa64) typedef struct LDR_EXEC_HEADER final { diff --git a/dev/kernel/KernelKit/PECodeMgr.h b/dev/kernel/KernelKit/PECodeMgr.h index e666c501..23ef4ecf 100644 --- a/dev/kernel/KernelKit/PECodeMgr.h +++ b/dev/kernel/KernelKit/PECodeMgr.h @@ -22,3 +22,58 @@ #include <KernelKit/PE.h> #include <NewKit/ErrorOr.h> #include <NewKit/KString.h> +#include <KernelKit/FileMgr.h> +#include <KernelKit/LoaderInterface.h> + +#ifndef INC_PROCESS_SCHEDULER_H +#include <KernelKit/ProcessScheduler.h> +#endif + +#define kPefApplicationMime "application/vnd-portable-executable" + +namespace Kernel +{ + /// + /// \name PE32Loader + /// \brief PE32+ loader class. + /// + class PE32Loader : public LoaderInterface + { + private: + explicit PE32Loader() = delete; + + public: + explicit PE32Loader(const VoidPtr blob); + explicit PE32Loader(const Char* path); + ~PE32Loader() override; + + public: + NE_COPY_DEFAULT(PE32Loader) + + public: + const Char* Path() override; + const Char* AsString() override; + const Char* MIME() override; + + public: + ErrorOr<VoidPtr> FindStart() override; + VoidPtr FindSymbol(const Char* name, Int32 kind) override; + ErrorOr<VoidPtr> GetBlob() override; + + public: + bool IsLoaded() noexcept; + + private: +#ifdef __FSKIT_INCLUDES_NEFS__ + OwnPtr<FileStream<Char, NeFileSystemMgr>> fFile; +#elif defined(__FSKIT_INCLUDES_HEFS__) + OwnPtr<FileStream<Char, HeFileSystemMgr>> fFile; +#else + OwnPtr<FileStream<Char>> fFile; +#endif // __FSKIT_INCLUDES_NEFS__ + + Ref<KString> fPath; + VoidPtr fCachedBlob; + bool fBad; + }; +} // namespace Kernel
\ No newline at end of file diff --git a/dev/kernel/KernelKit/PEFCodeMgr.h b/dev/kernel/KernelKit/PEFCodeMgr.h index 9adab8f6..389774fd 100644 --- a/dev/kernel/KernelKit/PEFCodeMgr.h +++ b/dev/kernel/KernelKit/PEFCodeMgr.h @@ -16,7 +16,7 @@ #include <KernelKit/ProcessScheduler.h> #endif -#define kPefApplicationMime "application/vnd-amlal-executable" +#define kPefApplicationMime "application/vnd-nekernel-executable" namespace Kernel { @@ -53,6 +53,8 @@ namespace Kernel private: #ifdef __FSKIT_INCLUDES_NEFS__ OwnPtr<FileStream<Char, NeFileSystemMgr>> fFile; +#elif defined(__FSKIT_INCLUDES_HEFS__) + OwnPtr<FileStream<Char, HeFileSystemMgr>> fFile; #else OwnPtr<FileStream<Char>> fFile; #endif // __FSKIT_INCLUDES_NEFS__ diff --git a/dev/kernel/KernelKit/UserProcessScheduler.h b/dev/kernel/KernelKit/UserProcessScheduler.h index 6e1ca146..19818213 100644 --- a/dev/kernel/KernelKit/UserProcessScheduler.h +++ b/dev/kernel/KernelKit/UserProcessScheduler.h @@ -15,7 +15,7 @@ #include <KernelKit/LockDelegate.h> #include <KernelKit/User.h> #include <NewKit/MutableArray.h> -#include <KernelKit/ProcessSchedulerCore.h> +#include <KernelKit/CoreProcessScheduler.h> #define kSchedMinMicroTime (AffinityKind::kStandard) #define kSchedInvalidPID (-1) diff --git a/dev/kernel/KernelKit/UserProcessScheduler.inl b/dev/kernel/KernelKit/UserProcessScheduler.inl index a18af9c1..e31b5462 100644 --- a/dev/kernel/KernelKit/UserProcessScheduler.inl +++ b/dev/kernel/KernelKit/UserProcessScheduler.inl @@ -3,11 +3,11 @@ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. FILE: UserProcessScheduler.inl - PURPOSE: Low level/Ring-3 USER_PROCESS scheduler. + PURPOSE: Low level/Ring-3 process scheduler. ------------------------------------------- */ -/// @brief USER_PROCESS scheduler inline definitions. +/// @brief USER_PROCESS inline definitions. /// @author Amlal El Mahrouss (amlal@nekernel.org) /// @date Tue Apr 22 22:01:07 CEST 2025 @@ -57,7 +57,7 @@ namespace Kernel entry = entry->MemoryNext; } - kout << "Invalid Pointer: Trying to free a pointer which doesn't exist.\r"; + kout << "USER_PROCESS: Trying to free a pointer which doesn't exist.\r"; this->Crash(); diff --git a/dev/kernel/src/IPEFDylibObject.cc b/dev/kernel/src/IPEFDylibObject.cc index df6ec253..9b0b1ab8 100644 --- a/dev/kernel/src/IPEFDylibObject.cc +++ b/dev/kernel/src/IPEFDylibObject.cc @@ -18,13 +18,13 @@ Revision History: - 01/02/24: Reworked dll ABI, expect a rtl_init_dylib and - rtl_fini_dylib (amlel) + 01/02/24: Reworked dll ABI, expect a rtl_init_dylib_pef and + rtl_fini_dylib_pef (amlel) 15/02/24: Breaking changes, changed the name of the routines. (amlel) - 07/28/24: Replace rt_library_free with rtl_fini_dylib + 07/28/24: Replace rt_library_free with rtl_fini_dylib_pef 10/8/24: FIX: Fix log comment. @@ -41,7 +41,7 @@ using namespace Kernel; /** @brief Library initializer. */ /***********************************************************************************/ -EXTERN_C IDylibRef rtl_init_dylib(USER_PROCESS& process) +EXTERN_C IDylibRef rtl_init_dylib_pef(USER_PROCESS& process) { IDylibRef dll_obj = tls_new_class<IPEFDylibObject>(); @@ -91,7 +91,7 @@ EXTERN_C IDylibRef rtl_init_dylib(USER_PROCESS& process) /** @param successful Reports if successful or not. */ /***********************************************************************************/ -EXTERN_C Void rtl_fini_dylib(USER_PROCESS& process, IDylibRef dll_obj, BOOL* successful) +EXTERN_C Void rtl_fini_dylib_pef(USER_PROCESS& process, IDylibRef dll_obj, BOOL* successful) { MUST_PASS(successful); diff --git a/dev/kernel/src/UserProcessScheduler.cc b/dev/kernel/src/UserProcessScheduler.cc index 68629bb2..8df98f87 100644 --- a/dev/kernel/src/UserProcessScheduler.cc +++ b/dev/kernel/src/UserProcessScheduler.cc @@ -3,7 +3,7 @@ Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. FILE: UserProcessScheduler.cc - PURPOSE: Low level/Ring-3 USER_PROCESS scheduler. + PURPOSE: Low level/Ring-3 process scheduler. ------------------------------------------- */ @@ -262,7 +262,7 @@ namespace Kernel { Bool success = false; - rtl_fini_dylib(*this, reinterpret_cast<IPEFDylibObject*>(this->DylibDelegate), &success); + rtl_fini_dylib_pef(*this, reinterpret_cast<IPEFDylibObject*>(this->DylibDelegate), &success); if (!success) { @@ -357,7 +357,7 @@ namespace Kernel switch (process.Kind) { case USER_PROCESS::kExecutableDylibKind: { - process.DylibDelegate = rtl_init_dylib(process); + process.DylibDelegate = rtl_init_dylib_pef(process); MUST_PASS(process.DylibDelegate); break; } diff --git a/dev/user/Macros.h b/dev/user/Macros.h index 556833ea..a0dfcb00 100644 --- a/dev/user/Macros.h +++ b/dev/user/Macros.h @@ -123,3 +123,5 @@ IMPORT_C void _rtl_assert(Bool expr, const Char* origin); #ifndef tib_cast #define tib_cast(X) ((UInt64)gib_cast(X) * 1024) #endif + +#define SCI_UNUSED(X) ((void)X) diff --git a/public/tools/mk.hefs/src/CommandLine.cc b/public/tools/mk.hefs/src/CommandLine.cc index 23681be8..8ce77208 100644 --- a/public/tools/mk.hefs/src/CommandLine.cc +++ b/public/tools/mk.hefs/src/CommandLine.cc @@ -10,5 +10,8 @@ SInt32 main(SInt32 argc, Char* argv[]) { + SCI_UNUSED(argc); + SCI_UNUSED(argv); + return EXIT_FAILURE; } diff --git a/public/tools/mk.nefs/src/CommandLine.cc b/public/tools/mk.nefs/src/CommandLine.cc index 23681be8..8ce77208 100644 --- a/public/tools/mk.nefs/src/CommandLine.cc +++ b/public/tools/mk.nefs/src/CommandLine.cc @@ -10,5 +10,8 @@ SInt32 main(SInt32 argc, Char* argv[]) { + SCI_UNUSED(argc); + SCI_UNUSED(argv); + return EXIT_FAILURE; } diff --git a/tooling/mk_img.py b/tooling/mk_img.py index b4fdfa1e..4a663bc0 100755 --- a/tooling/mk_img.py +++ b/tooling/mk_img.py @@ -17,11 +17,15 @@ def copy_to_fat(image_path, source_dir): try: files_to_copy = glob.glob(os.path.join(source_dir, "*")) - # Now build the command + + if not files_to_copy: + print(f"Warning: No files found in {source_dir}. Nothing to copy.") + return + command = ["mcopy", "-spm", "-i", image_path] + files_to_copy + ["::"] subprocess.run(command, check=True) - print(f"Successfully copied contents of '{source_dir}' into '{image_path}'") + print(f"Info: Successfully copied contents of '{source_dir}' into '{image_path}'") except FileNotFoundError: print("Error: mcopy is not installed. Please install mtools.") sys.exit(1) @@ -29,7 +33,7 @@ def copy_to_fat(image_path, source_dir): print(f"Error: mcopy failed with error code {e.returncode}.") sys.exit(1) except Exception as e: - print(f"mcopy failed: {e}") + print(f"Error: mcopy: {e}") sys.exit(1) if __name__ == "__main__": |
