Questions tagged [gnu-efi]

This tag is used for questions related to use of the gnu-efi toolkit to build UEFI applications, as opposed to generic questions around UEFI.

gnu-efi is a set of libraries and scripts used to build UEFI applications in a Linux environment.

50 questions
1
vote
0 answers

Load EFI image using gnu-efi

I am writing a UEFI 'chainloader' to learn more about how it works. I am using gnu-efi, and trying to load and start an EFI image. I want my main.efi to load and run hello.efi, located in the same ESP. I just don't understand what to call and how to…
1
vote
0 answers

Simple UEFI bootloader Windows 10

I'm basically in the exact same situation as : UEFI Resolve full path I've followed his solution, but I always get EFI_NOT_FOUND error at LoadImage method. Here's my (poor quality) code ... : void BootLoaderStackoverflow(EFI_HANDLE ImageHandle)…
Thomas P.
  • 11
  • 2
0
votes
0 answers

How to I build gnu-efi, for mingw-w64

I am new to the gnu-efi development process. I am using windows 11, and GCC 13.1.0 (with POSIX threads) + LLVM/Clang/LLD/LLDB 16.0.5 + MinGW-w64 11.0.0 (UCRT) - release 5 (Latest), Win64. So far I have managed to install the zip, and install make…
0
votes
0 answers

GnuUEFI sprintf causes corrupted control flow

I'm developing an UEFI program against GnuEFI (-lefi -lgnuefi). It is first compiled/linked as a shared object, then transformed into a EFI binary by objcopy (objcopy -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc…
0
votes
0 answers

Seeing if a file exists in gnu-efi

So I'm trying to make a simple shell in UEFI and I wanted to know how you can tell if a file exists (on the EFI partion). From my testing reading a non existent file returns a string without anything before the zero but it doesn't seem to work. My…
Ccode
  • 3
  • 2
0
votes
1 answer

Strange Invalid Parameter error returned in UEFI LocateProtocol and HandleProtocol

I recently started learning UEFI application programming, and I am using GNU-EFI and QEMU as the development platform, following https://wiki.osdev.org/GNU-EFI. However, I encounter some strange issue when trying to access the Simple Text Output…
Eric Stdlib
  • 1,292
  • 1
  • 18
  • 32
0
votes
1 answer

Calling own function results in an crash

I try to write a simple start uefi program for my kernel, but I have a problem linking everything together. I want to call functions defined in my header files but this results in my uefi application to crash. (After the intended call the following…
0
votes
0 answers

How do I return a value and print it out?

Hello I am currently programming a UEFI bootloader with GNU-EFI and I am just about to program a small config system I have tested it so far and it works, but now I did not want to have everything in one file and split it into several files. Now I…
Robin
  • 1
  • 1
0
votes
0 answers

lld-link is showing error (undefined symbol : EFI_LOADED_IMAGE_PROTOCOL_GUID)

I am making UEFI Bootloader (UEFI Application), by last version of clang and linked by lld-link. i need to use EFI_LOADED_IMAGE_PROTOCOL for load file, I used EFI_LOADED_IMAGE_PROTOCOL_GUID. but lld-link is showing undefined symbol :…
A Dev.
  • 3
  • 2
0
votes
0 answers

How UEFI drivers use the content in the ACPI tables

I came across this project on gibhub https://github.com/UEFI4Phone/edk2sdm/tree/master/Sdm835/SamsungS8Pkg/AcpiTables This is my first time trying to dig into some non C written files in EDK2. Please excuse me if I did not make it clear. I realized…
0
votes
0 answers

How to modify the Handle order in the UEFI Handle Database?

In the code, the following boot service is being used to obtain an array of Handles with the array size equals HandleCount. gBS->LocateHandleBuffer ( ByProtocol, &gEfiSomeProtocolGuid, NULL, …
0
votes
1 answer

How to access efi executable present in another partition using gnu-efi?

I have to create 2 fat16 partitions in a disk and place one of the efi binary in another fat16 partition. To begin with, wrote a basic HelloWorld.efi application (second stage) and for the first stage, used below-mentioned 2 apis to execute the…
Santi
  • 67
  • 7
0
votes
1 answer

[gnu-efi]: How to call InitializeGlobalIoDevice funtion when I wanna call CMOS Read/Write?

Below is the code to initializing the IO device, and I wanna to call a function to do CMOS read/write, but I don't know the DevicePath and Protocol? Does anyone know this? thanks a lot; /* Routine Description: Check to see…
Tody Kwok
  • 185
  • 2
  • 12
0
votes
0 answers

Casting a ELF entry addr into a function in GNU EFI

How would I cast a Elf64_Ehdr.e_entry into a function? eg: void (*kernel_function)() = (void (*)())*kernel_entry_point; Current code: (header is a Elf64_Ehdr) | The version of elf.h included is identical to /usr/include/elf.h EFI_PHYSICAL_ADDRESS*…
TopHatty
  • 1
  • 1
  • 4
0
votes
0 answers

Font not recognized by custom kernel

I have made a kernel in C code, and added a custom .psf font. Unfortunately, the program doesn't seem to detect the file in the directory as valid. Here's the code that actually loads the font and prints the result: void…
alex12
  • 36
  • 4