Octocontrabass wrote:
rdos wrote:
If that wasn't enough, I cannot tell UEFI to place my OS image at a fixed physical address, and so I need to guess were it is safe to place it. With BIOS, I can load it anywhere I want.
Why do you want to place your OS image at a fixed physical address? (Plus, BIOS and UEFI both provide a memory map that tells you exactly where you can place things.)
Because it is convenient. With BIOS, it pretty safe to place an OS image just above the HMA area (0x110000). The BIOS memory map primarily is useful so the OS knows where there is working physical RAM. With older 386 hardware, I don't think you can rely on the BIOS memory map function to even exist.
The UEFI memory map, OTOH, is cluttered with UEFIs own memory usage that is not standardized. It's possible that UEFI could place itself or some data just above HMA (although, I've not yet seen any implementation that does so).
Of course, the primary reason I want to place my OS image at a fixed address is because it must be below 4G. A 64-bit EFI might place it above 4G. I also have reserved a physical address range a bit higher (0x120000) that is aimed to be used to switch between long mode and protected mode. I need this since that process requires turning off paging.
Actually, the boot process itself requires the loader to be placed at a fixed address too, for exactly the same reason. To get back to protected mode, there is a need to define a new GDT, turn off long mode (which ends up in non-paged mode) and init protected mode. This process is much easier to do when the image is loaded at a fixed address.
Octocontrabass wrote:
rdos wrote:
often you will find Windows still boots even when you have replaced the proposed 64-bit loader bootx64.efi.
That's because bootx64.efi is the
fallback bootloader, used only when there are no other bootloaders installed. You're supposed to install your own bootloader within your own subdirectory and create a boot variable that refers to it.
Unfortunately, some broken UEFI implementations will always launch the Windows boot manager if it's present, ignoring boot variables and the fallback bootloader. In these cases, you'll have to either move it elsewhere (and update the Windows boot variable to point to the new location) or replace it with your own bootloader.
How to change boot variables is undocumented and not supported by the UEFI interactive interface.
Anyway, a safe way to remove Windows appears to be to repartition the disc, as this appears to make UEFI so confused so it uses bootx64.efi to boot regardless of the hidden settings Windows once created.
Uh... Its not undocumented at all. Have you actually read the UEFI specification? Last time I checked, the UEFI specification not only contained very in-depth discussion of the UEFI variable subsystem, including the ones that were standardized (yes, standardized, what a concept!), as well as functions for not only getting and setting variable values but also querying info about them and authenticating them.
Edit: also, UEFI does not require that the system be in 64-bit mode when UEFI sets up its environment. You should carefully re-read section 2.3 of the UEFI specification.