6 ; EFI_SYSTEM_TABLE offsets
7 SIMPLE_TEXT_OUTPUT equ 64
10 ; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL function offsets
13 TEXT_CLEAR_SCREEN equ 48
15 ; EFI_BOOT_SERVICES function offsets
16 BOOT_GET_MEMORY_MAP equ 56
17 BOOT_EXIT_BOOT_SERVICES equ 232
24 mov rax, [rdx + BOOT_SERVICES]
26 sub rsp, 32 ; leave space for shadow area
27 and rsp, 0xfffffffffffffff0 ; make sure sp is 16-byte aligned
29 mov rcx, [rdx + SIMPLE_TEXT_OUTPUT]
31 call [rcx + TEXT_SET_ATTR]
34 mov rcx, [rax + SIMPLE_TEXT_OUTPUT]
35 call [rcx + TEXT_CLEAR_SCREEN]
38 mov rcx, [rax + SIMPLE_TEXT_OUTPUT]
40 call [rcx + TEXT_OUT_STRING]
44 mov rcx, [rax + SIMPLE_TEXT_OUTPUT]
46 call [rcx + TEXT_SET_ATTR]
54 ; args: RCX, RDX, R8, and R9.
59 lea rax, [mmap_descver]
63 mov rbx, [rax + BOOT_SERVICES]
64 call [rbx + BOOT_GET_MEMORY_MAP]
70 mov rbx, [rax + BOOT_SERVICES]
71 call [rbx + BOOT_EXIT_BOOT_SERVICES]
79 ; expects number in rdi
97 ; expects string in rdi
100 mov rcx, [rcx + SIMPLE_TEXT_OUTPUT]
103 call [rcx + TEXT_OUT_STRING]
108 lea rdi, [str_hello + 18]
111 hexdig dw __utf16__ "0123456789abcdef"
112 hexbuf: times 40 db 0
118 str_hello dw __utf16__(`qurashee!\r\n`),0
128 mmapbuf: times 4096 db 0