HomeFreeBSD

Fix a number of problems preventing proper handover to the kernel.
rS247214Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Fix a number of problems preventing proper handover to the kernel.

There were two issues at play here. Firstly, there was nothing preventing
UEFI from placing the loader code above 1GB in RAM. This meant that when
we switched in the page tables the kernel expects to be running on, we are
suddenly unmapped and things no longer work. We solve this by making our
trampoline code not dependent on being at any given position and simply
copying it to a "safe" location before calling it.

Secondly, UEFI could allocate our stack wherever it wants. As it happened on
my PC, that was right where I was copying the kernel to. This did not cause
happiness. The solution to this was to also switch to a temporary stack in a
safe location before performing the final copy of the loaded kernel.

Details

Provenance
bennoAuthored on
Parents
rS247213: Add missing pointer sign.
Branches
Unknown
Tags
Unknown

Event Timeline