neon wrote:
I would expect 1MB physical to always be available. I cannot imagine a scenario where that wouldnt be
Why would it always be available? The "standard" PC memory map is only needed for BIOS compatibility, there's nothing about UEFI that requires available memory at 1MB.
neon wrote:
introduce a region based zone allocator and map the file into an available zone.
You can use the allocator provided by UEFI boot services. Your allocations will even appear in the firmware's memory map.
The only limitation is that you can't define your own memory types, you have to use the defaults.neon wrote:
So I suppose we can introduce logic like "if the kernel requested image base is not available, allocate it to an available zone and attempt to perform a relocation if possible. Fatal error if image format not understood."
I would recommend using paging to map the kernel directly to its desired virtual address.