Page 1 of 1
Booting a 64-Bit Kernel from UEFI
Posted: Sun Jan 13, 2019 4:15 pm
by HackerPulp
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!
Re: Booting a 64-Bit Kernel from UEFI
Posted: Tue Jan 15, 2019 6:47 am
by bzt
:thumbs up:
Re: Booting a 64-Bit Kernel from UEFI
Posted: Tue Jan 15, 2019 1:27 pm
by nullplan
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:
Code: Select all
%macro UINT32 0
RESD 1
alignb 4
%endmacro
I am reasonably certain this will not work. You first need the alignment, then the label, and then the reserve. For instance:
Code: Select all
struc EFI_SYSTEM_TABLE
.Hdr RESB EFI_TABLE_HEADER_size
.FirmwareVendor POINTER
.FirmwareRevision UINT32
.ConsoleInHandle EFI_HANDLE
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.