Author Topic: How do I write an EFI application in NASM?  (Read 581 times)

Offline ben321

  • Full Member
  • **
  • Posts: 133
How do I write an EFI application in NASM?
« on: January 15, 2022, 12:55:47 PM »
I'm aware of the fact when I boot a computer to EFI console that that is actually running in 32bit mode like Windows OS, and in fact the type of program I can execute from the console are 32bit PE EXE files (not DOS 16bit MZ EXE files). This means I should be able to write a program in notepad and assemble in NASM and then use a linker to create a PE EXE file, and expect a computer booted in an EFI console to be able to run that EXE.

But I have one question. What functions (even basic text-printing functions) do I have access to? I know it can't be ANY functions that depend on Windows DLLs. They MUST be functions builtin to the EFI boot environment itself. I assume that I would call the functions with INT (interrupt x86 instruction), and I assume they are standardized (much like BIOS interrupts on older PCs). If anybody here knows, please tell me how to call EFI functions.