我正在 NASM 程序集中编写一个简单的 UEFI 应用程序,并且我正在尝试为一个自由运行的计时器创建一个事件,但是CreateEvent总是返回调用,EFI_INVALID_PARAMETER我不知道为什么。
section .text
_start:
mov [ptrSystemTable], rdx
...
mov rcx, EVT_TIMER
mov rdx, TPL_APPLICATION
mov r8, 0
mov r9, 0
lea rbx, [ptrTimerEvent]
push rbx
mov rax, [ptrSystemTable]
mov rax, [rax + EFI_SYSTEM_TABLE.BootServices]
call [rax + EFI_BOOT_SERVICES.CreateEvent]
cmp rax, EFI_SUCCESS
jne errorCode
...
Run Code Online (Sandbox Code Playgroud)
section .data
ptrSystemTable dq 0
ptrTimerEvent dq 0
Run Code Online (Sandbox Code Playgroud)
; Include file with a bunch of definitions and structures
EVT_TIMER equ 0x80000000
TPL_APPLICATION equ 4
%macro POINTER 0
RESQ 1 …Run Code Online (Sandbox Code Playgroud)