

How to load boot.elf software#
It then calculates how long the image is and programs the software file (ELF) at the address immediately following the FPGA image. It then jumps to the end of the FPGA image where it expects to see a valid NIOS software image.Ģ - The flash programmer programs the FPGA image into flash. It will read some bits within the FPGA image to determine how long it is. The difference between those is how much memory we need.1 - The bootloader will expect to see a valid FPGA image at the beginning of the flash. The required amount of memory we need to find the minimum value of p_vaddrĪnd the maximum value of p_vaddr + p_memsz among all PT_LOAD program Just easier to work with them when they are available in memory.
How to load boot.elf code#
In the code in the repository I read all the program headers in memory, it’s Repository if you want though (it’s called verify_elf64_header there).

How to load boot.elf verification#
That this verification function is complete. I will not provide the verification function here, mostly because I do not hope With that out of the picture we can read the ELF header and verify it’s content. NOTE: the function above can handle short reads, but I don’t really know if NOTE: in this article I will only work with 64-bit version of ELF files.Ĭovering both 32-bit and 64-bit will essentially double the amount of the codeįor very little benefit to the understanding. So ELFįile also contains information about what kind of platform this file is for. Like 32-bit and 64-bit x86, 32-bit and 64-bit ARM and multiple others. Used for multiple purposes: executables, shared libraries, compiler objectīesides that ELF format supports multiple different hardware/software platforms,

What kind of basic information should a header contain? Well, ELF files are

If you bothered to follow the link and actually read through the specificationĪnd specifically section Program Loading in the chapter 2. To understand how we can load correctly an ELF image in memory we’d have to It’s also often supported by other Unix-like Unlike PE32+ ELF is, at this point, basically the default file format forĮxecutables and shared libraries. You might now already that EFI binaries use PE32+ file format, ELF is justĪnother file format that tries to solve similar problem. What is ELF? ELF is a rather widely used executable (and not only) file format. Now I’m going to read an ELF file from the file system, load it in memory andĪs usual all the sources are available on 15 November 2020 Loading an ELF image from EFIĬontinuing exploring UEFI after some break.
