diff --git a/i386/legacy-boot/src-asm/drivers/acpi/search-rsdp.asm b/i386/legacy-boot/src-asm/drivers/acpi/search-rsdp.asm new file mode 100644 index 0000000..72c4ab4 --- /dev/null +++ b/i386/legacy-boot/src-asm/drivers/acpi/search-rsdp.asm @@ -0,0 +1,49 @@ + +MAIN_BIOS_AREA_START equ 0xe0000 + +; Arguments: +; -- None -- +acpi_search_rsdp: +.prolog: + push esi + sub esp, 8 + mov esi, esp + + mov [esi], dword 0 + mov [esi + 4], ecx + +.search_loop_header: + mov ecx, MAIN_BIOS_AREA_START + +.search_loop: + push ebp + mov ebp, esp + push ecx + push dword .signature + push dword 8 + call mem_equal + mov esp, ebp + pop ebp + + cmp ax, 0 + jne .rsdp_found + + add ecx, 16 + cmp ecx, 0x100000 + jb .search_loop + + ; If no "RSD PTR "-signature could be found + xor ecx, ecx + +.rsdp_found: + mov eax, ecx + +.epilog: + mov ecx, [esi + 4] + add esp, 8 + pop esi + + ret + +.signature: + db "RSD PTR "