Nightloader/i386/legacy-boot/src-asm/drivers/acpi/search-rsdp.asm

50 lines
1.1 KiB
NASM

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 "