From 9076aff05349093c2c6280287ee3257d9c07c014 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 26 Aug 2024 05:02:55 +0200 Subject: [IMP] Add page file inside \System\ (syspage.sys) [FIX] Fix ATA support in bootloader and kernel. [IMP] Add sector count macro in DriveManager. Signed-off-by: Amlal El Mahrouss --- dev/ZBA/Sources/HEL/AMD64/BootATA.cxx | 4 ++-- dev/ZBA/Sources/HEL/AMD64/BootMain.cxx | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'dev/ZBA/Sources') diff --git a/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx b/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx index 714e552d..0c59ef8c 100644 --- a/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx +++ b/dev/ZBA/Sources/HEL/AMD64/BootATA.cxx @@ -120,7 +120,7 @@ Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - Out8(IO + ATA_REG_SEC_COUNT0, 2); + Out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); Out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); Out8(IO + ATA_REG_LBA1, (Lba) >> 8); @@ -150,7 +150,7 @@ Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeUTF8* Buf, Out8(IO + ATA_REG_HDDEVSEL, (Command) | (((Lba) >> 24) & 0x0F)); - Out8(IO + ATA_REG_SEC_COUNT0, 2); + Out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); Out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); Out8(IO + ATA_REG_LBA1, (Lba) >> 8); diff --git a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx index cd18d34a..9cdaf603 100644 --- a/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx +++ b/dev/ZBA/Sources/HEL/AMD64/BootMain.cxx @@ -253,9 +253,6 @@ EFI_EXTERN_C EFI_API Int Main(EfiHandlePtr ImageHandle, // If we succeed in reading the blob, then execute it. // ------------------------------------------ // - handoverHdrPtr->f_HardwareTables.f_ImagePtr = readerKernel.Blob(); - handoverHdrPtr->f_HardwareTables.f_ImageSz = readerKernel.Size(); - if (readerKernel.Blob()) { loader = new Boot::BThread(readerKernel.Blob()); -- cgit v1.2.3