I have Part 2 of the series up showing how to boot a 64-bit kernel from UEFI now.
We automate the build process, add more extensive support of the UEFI specification and eventually exit UEFI and load a kernel that can write pixels to a frame buffer.
Any feedback is appreciated, thanks!
Booting a 64-Bit Kernel from UEFI
Re: Booting a 64-Bit Kernel from UEFI
:thumbs up:
Re: Booting a 64-Bit Kernel from UEFI
Question 1: Why asm? For a BIOS bootloader it makes sense, as the bootsector is no environment where any programming language I know can run in (too many constraints), but UEFI was purpose-made so C or even C++ could be used. So why not use that?
Question 2:
I am reasonably certain this will not work. You first need the alignment, then the label, and then the reserve. For instance:
I have not tried it, but I think, ConsoleInHandle will have an offset of 12 bytes after the header, not 16 like it should. In general, just add the padding where necessary. It is rarely necessary. This way, you could also add any possible end padding.
Question 2:
Code: Select all
%macro UINT32 0
RESD 1
alignb 4
%endmacro
Code: Select all
struc EFI_SYSTEM_TABLE
.Hdr RESB EFI_TABLE_HEADER_size
.FirmwareVendor POINTER
.FirmwareRevision UINT32
.ConsoleInHandle EFI_HANDLE
Carpe diem!