diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-22 09:47:28 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-22 09:47:28 +0100 |
| commit | 5df4daf0619b95131ea99110ee2e8913012b6134 (patch) | |
| tree | d554db8ee6b9d331d90331224d97a5c6a61cdc55 | |
| parent | bc9b63a3dbc63d818e90237beb019f584acfe133 (diff) | |
HCR-14: ATA Built-in driver.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/BootATA.cxx | 9 | ||||
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/BootMain.cxx | 3 | ||||
| -rw-r--r-- | Public/SDK/System.Core/Headers/Containers/ODF.hxx | 8 | ||||
| -rw-r--r-- | Public/SDK/System.Core/Headers/Defs.hxx | 10 |
4 files changed, 13 insertions, 17 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx index e55b2121..72340d01 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootATA.cxx @@ -154,6 +154,8 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, Out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); + boot_ata_wait_io(IO); + BTextWriter writer; writer.Write(L"NewBoot: Port: ").Write(IO).Write(L"\r\n"); @@ -162,8 +164,6 @@ Void boot_ata_read(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, WideChar chr = In16(IO + ATA_REG_DATA); Buf[IndexOff] = chr; - - boot_ata_wait_io(IO); } } @@ -180,12 +180,11 @@ Void boot_ata_write(UInt32 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, Out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); + boot_ata_wait_io(IO); + for (SizeT IndexOff = 0; IndexOff < Size; ++IndexOff) { - // Send it two Out16(IO + ATA_REG_DATA, Buf[IndexOff]); - Out16(IO + ATA_REG_DATA, '\0'); - boot_ata_wait_io(IO); } } diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx index b90d9d60..5bff5929 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx @@ -38,9 +38,6 @@ EFI_EXTERN_C EFI_API Int EfiMain(EfiHandlePtr ImageHandle, .Write(SystemTable->FirmwareVendor) .Write(L"\r\n"); - /// Init ATA driver. - BDeviceATA ataDrv; - /// Read Kernel blob. BFileReader kernelImg(L".HCORE", ImageHandle); diff --git a/Public/SDK/System.Core/Headers/Containers/ODF.hxx b/Public/SDK/System.Core/Headers/Containers/ODF.hxx index 2983dbf8..9bf61296 100644 --- a/Public/SDK/System.Core/Headers/Containers/ODF.hxx +++ b/Public/SDK/System.Core/Headers/Containers/ODF.hxx @@ -18,7 +18,7 @@ /// @brief Document file header. typedef struct ODFFileHeader { - CharacterTypeUTF16 f_Ident[kFourCCLength_ODF]; + CharacterTypeUTF8 f_Ident[kFourCCLength_ODF]; Int32Type f_DocumentKind; Int32Type f_DocumentSize; @@ -26,18 +26,18 @@ typedef struct ODFFileHeader Int64Type f_MetaForkOffset; Int64Type f_DocumentForkOffset; - CharacterTypeUTF16 f_Padding[4]; + CharacterTypeUTF8 f_Padding[4]; } PACKED ODFFileHeader; /// @brief ODF Fork header typedef struct ODFForkHeader { - CharacterTypeUTF16 f_MetadataName[255]; + CharacterTypeUTF8 f_MetadataName[255]; Int32Type f_MetadataKind; Int32Type f_MetadataSize; - CharacterTypeUTF16 f_Padding; + CharacterTypeUTF8 f_Padding; } PACKED ODFForkHeader; #endif // !__ODF__
\ No newline at end of file diff --git a/Public/SDK/System.Core/Headers/Defs.hxx b/Public/SDK/System.Core/Headers/Defs.hxx index ce4f85ca..3cbf22fd 100644 --- a/Public/SDK/System.Core/Headers/Defs.hxx +++ b/Public/SDK/System.Core/Headers/Defs.hxx @@ -46,8 +46,8 @@ typedef __UINT32_TYPE__ DWordType; typedef __UINT64_TYPE__ QWordType; typedef __SIZE_TYPE__ SizeType; -typedef char CharacterTypeUTF16; -typedef CharacterTypeUTF16* PtrCharacterType; +typedef char CharacterTypeUTF8; +typedef CharacterTypeUTF8* PtrCharacterType; typedef void* PtrVoidType; typedef void VoidType; @@ -59,7 +59,7 @@ typedef __INT64_TYPE__ Int64Type; typedef __UINT32_TYPE__ UInt32Type; typedef __INT32_TYPE__ Int32Type; -typedef CharacterTypeUTF16 BooleanType; +typedef CharacterTypeUTF8 BooleanType; #define CA_COPY_DELETE(KLASS) \ KLASS &operator=(const KLASS &) = delete; \ @@ -234,9 +234,9 @@ typedef struct GUID final { /// \brief Object handle. /// \author Amlal El Mahrouss typedef struct Object final { - CharacterTypeUTF16 ObjectName[255]; + CharacterTypeUTF8 ObjectName[255]; DWordType ObjectType; - CharacterTypeUTF16 ObjectNamespace[255]; + CharacterTypeUTF8 ObjectNamespace[255]; VoidType(*Release)(struct Object* Self); IntPtrType(*Invoke)(struct Object* Self, DWordType Sel, ...); |
