diff options
| author | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-28 10:56:01 +0100 |
|---|---|---|
| committer | Amlal <amlal.elmahrouss@icloud.com> | 2025-01-28 10:56:01 +0100 |
| commit | 0601399a597280f849ce6c07f73f8124eea35c8d (patch) | |
| tree | cc8d9b781f9fa2615a42c3ad22df47415856161d /dev/Boot | |
| parent | 97d9cac7420ee032e8a2c4ae5e55963003516116 (diff) | |
ADD: Improvements on the AHCI driver.
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Boot')
| -rw-r--r-- | dev/Boot/amd64-desktop.make | 2 | ||||
| -rw-r--r-- | dev/Boot/src/HEL/AMD64/EFIBootStartup.cc | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/dev/Boot/amd64-desktop.make b/dev/Boot/amd64-desktop.make index 14ed07cd..c13a718f 100644 --- a/dev/Boot/amd64-desktop.make +++ b/dev/Boot/amd64-desktop.make @@ -95,7 +95,7 @@ run-efi-amd64-ata: # img_2 is the rescue disk. img is the bootable disk, as provided by the Zeta specs. .PHONY: epm-img epm-img: - qemu-img create -f raw $(IMG) 4G + qemu-img create -f qcow2 $(IMG) 4G .PHONY: efi efi: diff --git a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc index a1861178..3243e482 100644 --- a/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc +++ b/dev/Boot/src/HEL/AMD64/EFIBootStartup.cc @@ -74,6 +74,9 @@ STATIC Bool boot_init_fb() noexcept EXTERN EfiBootServices* BS; +EfiGUID kEfiGlobalNamespaceVarGUID = { + 0x8BE4DF61, 0x93CA, 0x11D2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C}}; + /// @brief Main EFI entrypoint. /// @param image_handle Handle of this image. /// @param sys_table The system table of it. @@ -222,6 +225,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, syschk_thread->SetName("BootZ: System Recovery Check"); } +#if 0 Boot::BDiskFormatFactory<BootDeviceATA> partition_factory; if (syschk_thread->Start(handover_hdr, NO) != kEfiOk) @@ -248,6 +252,7 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, fb_clear(); } } +#endif // ------------------------------------------ // // null these fields, to avoid being reused later. @@ -270,8 +275,16 @@ EFI_EXTERN_C EFI_API Int32 Main(EfiHandlePtr image_handle, // Assign to global 'kHandoverHeader'. - const auto kernel_path = L"neoskrnl.exe"; - const auto kernel_path_sz = 15; + WideChar kernel_path[255] = {0}; + UInt32 kernel_path_sz = 255; + + if (ST->RuntimeServices->GetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, nullptr, &kernel_path_sz, kernel_path) != kEfiOk) + { + CopyMem(kernel_path, L"neoskrnl.exe", 15); + + UInt32 attr = 0x00000001 | 0x00000002 | 0x00000004; + ST->RuntimeServices->SetVariable(L"/props/boot_path", kEfiGlobalNamespaceVarGUID, &attr, &kernel_path_sz, kernel_path); + } Boot::BFileReader reader_kernel(kernel_path, image_handle); |
