diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-10-21 18:52:06 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-10-21 18:52:06 +0200 |
| commit | 21b3da78f806d6765f9dffa6a84c21346f171cee (patch) | |
| tree | dc57df6545c1106a82b9e871e301ac5d5c1cd876 /dev/zba | |
| parent | 94a3d6b4656d4c2905da173b7ff6ecb074566ea3 (diff) | |
IMP: Implement AHCI support, can detect and read AHCI disks.
TODO: Add Write support to the AHCI driver.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/zba')
| -rw-r--r-- | dev/zba/amd64-efi.make | 8 | ||||
| -rw-r--r-- | dev/zba/src/HEL/AMD64/BootATA.cxx | 2 | ||||
| -rw-r--r-- | dev/zba/src/HEL/AMD64/BootMain.cxx | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/dev/zba/amd64-efi.make b/dev/zba/amd64-efi.make index d28c81f1..9ebc8972 100644 --- a/dev/zba/amd64-efi.make +++ b/dev/zba/amd64-efi.make @@ -30,13 +30,11 @@ IMG_2=epm-slave.img IMG_3=epm-master-2.img EMU_FLAGS=-net none -smp 4 -m 8G -M q35 \ - -bios $(BIOS) -device piix3-ide,id=ide \ - -drive id=disk,file=$(IMG),format=raw,if=none \ - -device ide-hd,drive=disk,bus=ide.0 -drive \ + -bios $(BIOS) -drive \ file=fat:rw:src/Root/,index=2,format=raw \ - -drive id=disk_2,file=$(IMG_2),if=none \ + -drive id=disk_2,file=$(IMG),if=none \ -device ahci,id=ahci \ - -device ide-hd,drive=disk_2,bus=ahci.0 -d int + -device ide-hd,drive=disk_2,bus=ahci.0 -serial stdio LD_FLAGS=-e Main --subsystem=10 diff --git a/dev/zba/src/HEL/AMD64/BootATA.cxx b/dev/zba/src/HEL/AMD64/BootATA.cxx index b975da1a..6561c150 100644 --- a/dev/zba/src/HEL/AMD64/BootATA.cxx +++ b/dev/zba/src/HEL/AMD64/BootATA.cxx @@ -83,7 +83,7 @@ ATAInit_Retry: if (statRdy & ATA_SR_ERR) { writer.Write( - L"NEWOSLDR: ATA: Select error, not an IDE based hard-drive.\r"); + L"NEWOSLDR: ATA: error, not an IDE based hard-drive.\r"); return false; } diff --git a/dev/zba/src/HEL/AMD64/BootMain.cxx b/dev/zba/src/HEL/AMD64/BootMain.cxx index 113f2d40..6010d21b 100644 --- a/dev/zba/src/HEL/AMD64/BootMain.cxx +++ b/dev/zba/src/HEL/AMD64/BootMain.cxx @@ -164,6 +164,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, // format the disk. // ---------------------------------------------------- // +#ifdef __AHCI__ if (!partition_factory.IsPartitionValid()) { Boot::BDiskFormatFactory<BootDeviceATA>::BFileDescriptor root; @@ -176,10 +177,12 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr ImageHandle, rt_reset_hardware(); } +#endif BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); struct_ptr = new EfiMemoryDescriptor[sz_desc]; + BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); auto cDefaultMemoryMap = 0; // Grab any usable entries. |
