OSDev.org
https://forum.osdev.org/

Booting a 64-Bit Kernel from UEFI
https://forum.osdev.org/viewtopic.php?f=2&t=33439
Page 1 of 1

Author:  HackerPulp [ Sun Jan 13, 2019 4:15 pm ]
Post subject:  Booting a 64-Bit Kernel from UEFI

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!

Author:  bzt [ Tue Jan 15, 2019 6:47 am ]
Post subject:  Re: Booting a 64-Bit Kernel from UEFI

:thumbs up:

Author:  nullplan [ Tue Jan 15, 2019 1:27 pm ]
Post subject:  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:
Code:
%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:
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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/