Booting a 64-Bit Kernel from UEFI

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
HackerPulp
Posts: 3
Joined: Sat Dec 22, 2018 4:33 am

Booting a 64-Bit Kernel from UEFI

Post 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!
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: Booting a 64-Bit Kernel from UEFI

Post by bzt »

:thumbs up:
nullplan
Member
Member
Posts: 1770
Joined: Wed Aug 30, 2017 8:24 am

Re: Booting a 64-Bit Kernel from UEFI

Post 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.
Carpe diem!
Post Reply