Makefile + fixed GetMemMap + updated readme

This commit is contained in:
Jezura777 2025-04-01 13:03:46 +02:00
parent 925aa01c9b
commit 9c3495c98a
5 changed files with 367 additions and 5 deletions

View file

@ -60,7 +60,21 @@ main:
mov rdx, BootMsg
call print
;.GetGOP:
; mov rcx, EFI_GRAPHICS_OUTPUT_UUID
; mov rdx, 3
; mov r8, Video
;
; mov rax, [BootSrvc]
; call_safe [rax + EFI_BOOT_SERVICES_TABLE.LocateProtocol]
;
; cmp rax, EFI_SUCCES
; jne .error
;
; mov rax, [Video]
; mov rbx, [rax + EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE.MaxMode]
; jmp .
; TODO: Get and store framebuffer
; Getting the memory map is kind of harder (not in this case), normally
@ -76,6 +90,8 @@ main:
; *MemMapDescSize,
; *MemMapDescVer)
.GetMemMap:
mov rax, [BootSrvc]
lea rcx, [MemMapSize]
mov rdx, [MemMapBuff]
lea r8, [MemMapKey]
@ -85,7 +101,7 @@ main:
lea r10, [MemMapDescVer]
mov [rsp+32], r10
call [BootSrvc + EFI_BOOT_SERVICES_TABLE.GetMemoryMap]
call [rax + EFI_BOOT_SERVICES_TABLE.GetMemoryMap]
; if it returns buffer too small run the function again as it filled out
; the needed buffer length
@ -106,7 +122,8 @@ main:
mov rcx, [ImgHdl]
mov rdx, [MemMapKey]
call_safe [BootSrvc + EFI_BOOT_SERVICES_TABLE.ExitBootServices]
mov rax, [BootSrvc]
call_safe [rax + EFI_BOOT_SERVICES_TABLE.ExitBootServices]
cmp rax, EFI_SUCCESS
jne .error
@ -138,6 +155,7 @@ ImgHdl dq ?
SysTbl dq ?
BootSrvc dq ?
Output dq ?
Video dq ?
MemMapSize dq 32768
MemMapKey dq ?