OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:35 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Booting a 64-Bit Kernel from UEFI
PostPosted: Sun Jan 13, 2019 4:15 pm 
Offline

Joined: Sat Dec 22, 2018 4:33 am
Posts: 3
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!


Top
 Profile  
 
 Post subject: Re: Booting a 64-Bit Kernel from UEFI
PostPosted: Tue Jan 15, 2019 6:47 am 
Offline
Member
Member
User avatar

Joined: Thu Oct 13, 2016 4:55 pm
Posts: 1584
:thumbs up:


Top
 Profile  
 
 Post subject: Re: Booting a 64-Bit Kernel from UEFI
PostPosted: Tue Jan 15, 2019 1:27 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
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.

_________________
Carpe diem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group