diff --git a/CMakeLists.txt b/CMakeLists.txt index ef03dcd..a2b5148 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -397,10 +397,11 @@ add_custom_command(OUTPUT lindows_efi.img count=33 #COMMAND mkfs.vfat lindows_efi.img -F 32 COMMAND ${MTools_Format_EXECUTABLE} -i lindows_efi.img + COMMAND ${MTools_Copy_EXECUTABLE} -i lindows_efi.img ${CMAKE_SOURCE_DIR}/src/startup.nsh ::/STARTUP.NSH COMMAND ${MTools_Mkdir_EXECUTABLE} -i lindows_efi.img ::/EFI COMMAND ${MTools_Mkdir_EXECUTABLE} -i lindows_efi.img ::/EFI/BOOT COMMAND ${MTools_Copy_EXECUTABLE} -i lindows_efi.img lindows_efi/grubx64.efi ::/EFI/BOOT/BOOTX64.EFI - DEPENDS src/grub/grub-early.cfg + DEPENDS src/grub/grub-early.cfg src/startup.nsh ) # make the full disk image diff --git a/lcrash/acpi/acpi.c b/lcrash/acpi/acpi.c index 1ebbad2..8a95128 100644 --- a/lcrash/acpi/acpi.c +++ b/lcrash/acpi/acpi.c @@ -71,8 +71,9 @@ void* AcpiGetTable(const char TableName[4]) { // Alright let's see here... for (int i = 0; i < AcpiXSDTLength; i++) { - + if (CompareMemory(AcpiTheXSDT->Tables[i]->Signature, TableName, 4)) return (void*)AcpiTheXSDT->Tables[i]; } + // Well we found nothing return 0; } diff --git a/lcrash/acpi/acpi.h b/lcrash/acpi/acpi.h index 9c03bb8..b182479 100644 --- a/lcrash/acpi/acpi.h +++ b/lcrash/acpi/acpi.h @@ -43,8 +43,8 @@ struct AcpiXSDT { struct AcpiSDTHeader Header; /// Pointers to other tables - [[gnu::aligned(4)]] - u64 Tables[]; + [[gnu::aligned(4), gnu::packed]] + struct AcpiSDTHeader* Tables[]; }; /** diff --git a/src/startup.nsh b/src/startup.nsh new file mode 100644 index 0000000..78d8e44 --- /dev/null +++ b/src/startup.nsh @@ -0,0 +1 @@ +FS0:\EFI\BOOT\BOOTX64.EFI