diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-20 20:30:18 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-20 20:30:18 +0100 |
| commit | 1c43fb19cab6eb1121a6d41f4bbe180229a3ae9e (patch) | |
| tree | b69b6317a2e1ebeba7958024f9718e7ae705cee0 /dev/Kernel/KernelKit | |
| parent | 1d07547776d6890c4b4115ddc265b35e68f87936 (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 'dev/Kernel/KernelKit')
| -rw-r--r-- | dev/Kernel/KernelKit/PE.h | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/dev/Kernel/KernelKit/PE.h b/dev/Kernel/KernelKit/PE.h index a4ae5c4a..dbcf2ded 100644 --- a/dev/Kernel/KernelKit/PE.h +++ b/dev/Kernel/KernelKit/PE.h @@ -29,62 +29,62 @@ typedef struct LDR_EXEC_HEADER final { - NeOS::UInt32 mSignature; - NeOS::UInt16 mMachine; - NeOS::UInt16 mNumberOfSections; - NeOS::UInt32 mTimeDateStamp; - NeOS::UInt32 mPointerToSymbolTable; - NeOS::UInt32 mNumberOfSymbols; - NeOS::UInt16 mSizeOfOptionalHeader; - NeOS::UInt16 mCharacteristics; + NeOS::UInt32 Signature; + NeOS::UInt16 Machine; + NeOS::UInt16 NumberOfSections; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt32 PointerToSymbolTable; + NeOS::UInt32 NumberOfSymbols; + NeOS::UInt16 SizeOfOptionalHeader; + NeOS::UInt16 Characteristics; } LDR_EXEC_HEADER, *LDR_EXEC_HEADER_PTR; typedef struct LDR_OPTIONAL_HEADER final { - NeOS::UInt16 mMagic; // 0x010b - PE32, 0x020b - PE32+ (64 bit) - NeOS::UInt8 mMajorLinkerVersion; - NeOS::UInt8 mMinorLinkerVersion; - NeOS::UInt32 mSizeOfCode; - NeOS::UInt32 mSizeOfInitializedData; - NeOS::UInt32 mSizeOfUninitializedData; - NeOS::UInt32 mAddressOfEntryPoint; - NeOS::UInt32 mBaseOfCode; - NeOS::UInt32 mBaseOfData; - NeOS::UInt32 mImageBase; - NeOS::UInt32 mSectionAlignment; - NeOS::UInt32 mFileAlignment; - NeOS::UInt16 mMajorOperatingSystemVersion; - NeOS::UInt16 mMinorOperatingSystemVersion; - NeOS::UInt16 mMajorImageVersion; - NeOS::UInt16 mMinorImageVersion; - NeOS::UInt16 mMajorSubsystemVersion; - NeOS::UInt16 mMinorSubsystemVersion; - NeOS::UInt32 mWin32VersionValue; - NeOS::UInt32 mSizeOfImage; - NeOS::UInt32 mSizeOfHeaders; - NeOS::UInt32 mCheckSum; - NeOS::UInt16 mSubsystem; - NeOS::UInt16 mDllCharacteristics; - NeOS::UInt32 mSizeOfStackReserve; - NeOS::UInt32 mSizeOfStackCommit; - NeOS::UInt32 mSizeOfHeapReserve; - NeOS::UInt32 mSizeOfHeapCommit; - NeOS::UInt32 mLoaderFlags; - NeOS::UInt32 mNumberOfRvaAndSizes; + NeOS::UInt16 Magic; // 0x010b - PE32, 0x020b - PE32+ (64 bit) + NeOS::UInt8 MajorLinkerVersion; + NeOS::UInt8 MinorLinkerVersion; + NeOS::UInt32 SizeOfCode; + NeOS::UInt32 SizeOfInitializedData; + NeOS::UInt32 SizeOfUninitializedData; + NeOS::UInt32 AddressOfEntryPoint; + NeOS::UInt32 BaseOfCode; + NeOS::UInt32 BaseOfData; + NeOS::UInt32 ImageBase; + NeOS::UInt32 SectionAlignment; + NeOS::UInt32 FileAlignment; + NeOS::UInt16 MajorOperatingSystemVersion; + NeOS::UInt16 MinorOperatingSystemVersion; + NeOS::UInt16 MajorImageVersion; + NeOS::UInt16 MinorImageVersion; + NeOS::UInt16 MajorSubsystemVersion; + NeOS::UInt16 MinorSubsystemVersion; + NeOS::UInt32 Win32VersionValue; + NeOS::UInt32 SizeOfImage; + NeOS::UInt32 SizeOfHeaders; + NeOS::UInt32 CheckSum; + NeOS::UInt16 Subsystem; + NeOS::UInt16 DllCharacteristics; + NeOS::UInt32 SizeOfStackReserve; + NeOS::UInt32 SizeOfStackCommit; + NeOS::UInt32 SizeOfHeapReserve; + NeOS::UInt32 SizeOfHeapCommit; + NeOS::UInt32 LoaderFlags; + NeOS::UInt32 NumberOfRvaAndSizes; } LDR_OPTIONAL_HEADER, *LDR_OPTIONAL_HEADER_PTR; typedef struct LDR_SECTION_HEADER final { - NeOS::Char mName[8]; - NeOS::UInt32 mVirtualSize; - NeOS::UInt32 mVirtualAddress; - NeOS::UInt32 mSizeOfRawData; - NeOS::UInt32 mPointerToRawData; - NeOS::UInt32 mPointerToRelocations; - NeOS::UInt32 mPointerToLineNumbers; - NeOS::UInt16 mNumberOfRelocations; - NeOS::UInt16 mNumberOfLinenumbers; - NeOS::UInt32 mCharacteristics; + NeOS::Char Name[8]; + NeOS::UInt32 VirtualSize; + NeOS::UInt32 VirtualAddress; + NeOS::UInt32 SizeOfRawData; + NeOS::UInt32 PointerToRawData; + NeOS::UInt32 PointerToRelocations; + NeOS::UInt32 PointerToLineNumbers; + NeOS::UInt16 NumberOfRelocations; + NeOS::UInt16 NumberOfLinenumbers; + NeOS::UInt32 Characteristics; } LDR_SECTION_HEADER, *LDR_SECTION_HEADER_PTR; enum kExecDataDirParams @@ -97,29 +97,29 @@ enum kExecDataDirParams typedef struct LDR_EXPORT_DIRECTORY { - NeOS::UInt32 mCharacteristics; - NeOS::UInt32 mTimeDateStamp; - NeOS::UInt16 mMajorVersion; - NeOS::UInt16 mMinorVersion; - NeOS::UInt32 mName; - NeOS::UInt32 mBase; - NeOS::UInt32 mNumberOfFunctions; - NeOS::UInt32 mNumberOfNames; - NeOS::UInt32 mAddressOfFunctions; // export table rva - NeOS::UInt32 mAddressOfNames; - NeOS::UInt32 mAddressOfNameOrdinal; // ordinal table rva + NeOS::UInt32 Characteristics; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt16 MajorVersion; + NeOS::UInt16 MinorVersion; + NeOS::UInt32 Name; + NeOS::UInt32 Base; + NeOS::UInt32 NumberOfFunctions; + NeOS::UInt32 NumberOfNames; + NeOS::UInt32 AddressOfFunctions; // export table rva + NeOS::UInt32 AddressOfNames; + NeOS::UInt32 AddressOfNameOrdinal; // ordinal table rva } LDR_EXPORT_DIRECTORY, *LDR_EXPORT_DIRECTORY_PTR; typedef struct LDR_IMPORT_DIRECTORY { union { - NeOS::UInt32 mCharacteristics; - NeOS::UInt32 mOriginalFirstThunk; + NeOS::UInt32 Characteristics; + NeOS::UInt32 OriginalFirstThunk; }; - NeOS::UInt32 mTimeDateStamp; - NeOS::UInt32 mForwarderChain; - NeOS::UInt32 mNameRva; - NeOS::UInt32 mThunkTableRva; + NeOS::UInt32 TimeDateStamp; + NeOS::UInt32 ForwarderChain; + NeOS::UInt32 NameRva; + NeOS::UInt32 ThunkTableRva; } LDR_IMPORT_DIRECTORY, *LDR_IMPORT_DIRECTORY_PTR; typedef struct LDR_DATA_DIRECTORY @@ -130,8 +130,8 @@ typedef struct LDR_DATA_DIRECTORY typedef struct LDR_IMAGE_HEADER { - LDR_EXEC_HEADER mHeader; - LDR_OPTIONAL_HEADER mOptHdr; + LDR_EXEC_HEADER Header; + LDR_OPTIONAL_HEADER OptHdr; } LDR_IMAGE_HEADER, *LDR_IMAGE_HEADER_PTR; enum |
