TimothyWilliams wrote:UEFI isn't yet supported,
I'm not sure what you are trying to say with this. Not supported by what? The statement makes no sense to me - it isn't a matter of 'supported' or 'not supported', for either the system firmware or the software. A system either has a
UEFI firmware, or it doesn't.
OK, time for one of my infamous long-winded expositions. I don't know how much of this you already know, but please bear with me. Oh, and if anyone spots any errors, please let me know.
The Extensible Firmware Interface specification was introduced by Intel in 1997-ish, originally as the standard for Itanic, I mean Itanium, systems (also called IA-64). By 2000 or so, several other hardware vendors got on-board with the idea, and in 2005 Intel handed control of the spec to the Unified EFI Forum, which released the first UEFI spec by the end of that year. The spec was changed to work with several different CPU and peripheral types, not just x86 and IA-64, and most ARM systems now use UEFI. All Apple x86 systems have used UEFI from the start as well. It took about five years for it to really take hold in the PC world, however.
As a rule of thumb, any x86 motherboard made before 2005 is probably going to be Legacy BIOS and always boot into real mode, though a few EFI x86 motherboards were made by Intel between 2000 and 2005. Most of the PCs between 2006 and 2010 were Legacy BIOS. They increasingly moved to UEFI starting in 2008, but they didn't really surpass Legacy until 2010. Pretty much any PC motherboard made after early 2011 will have a UEFI firmware.
Most UEFI firmware systems have the optional 'Compatibility Support Module', which allow the system to boot in 'legacy mode' emulating the Legacy BIOS, but this is something that you would need to set in to UEFI setup before installing any operating systems. After around 2016, more and more have been shipping without CSM (which means they no longer have the BIOS routines in the firmware, period, and cannot run in real mode at all), and (according to the Wikipedia page) Intel announced last year that they will be dropping CSM entirely by 2020. My understanding is that all of the other UEFI implementers are at least considering following suit.
Now, to be fair, there are still plenty of Legacy BIOS systems out there; the laptop I currently use is one, dating from 2009. But the general pattern is that in any given year, there will be more systems less than five years old in regular use than there are which are over five years old. The majority of systems you will see today will be UEFI, even if they are set up to boot in CSM mode.
Support for UEFI on the kernel level is, well, as a rule it is simply irrelevant, unless the kernel is written to be entirely dependent on a specific boot loader and set of boot-up conditions. In a UEFI system, the kernel has to provide a shim file to the UEFI loader (at some location in a UEFI-readable file system, with the extension of the form '.efi') which tells it what state the system needs to be at load time (in particular, what operating mode it expects), and what information the kernel needs from the boot loader at hand-over.
If well-designed, this shim will act as a bridge between the firmware and the kernel, and the kernel won't need to know what sort of system it is at all (for the boot process, that is). Unless the kernel uses the
runtime firmware services (whether in the legacy BIOS API or in the UEFI Runtime API), it doesn't even need to know what sort of system it is - and as a rule, OS developers have been using runtime firmware services as little as possible since the early 1990s.
My understanding is that the UEFI loader will
only boot into either 32-bit protected mode, or 64-bit long mode,
unless the entire system is set in the firmware configuration to start in CSM mode - in which case it
must start in 16-bit real mode (and use a Master Boot Record instead of a GUID Partition Table), and leave anything involving the higher modes to the boot loader on the disk. I am not entirely sure of this, however, so I would love to hear from anyone who can confirm or dispel this.
TL;DR - your statement doesn't make sense to me. What did you mean by 'not supported'?
TimothyWilliams wrote:you need mov ah, 0 (In other words, you can use mov ah, 0Eh).
What bzt is saying is that the AL and AH registers are the two lower and upper halves of the AX register, so the two 8-bit move instructions
have the exact same effect as the single 16-bit move instruction:
while being slightly more compact and faster. I honestly don't see it as being a significant optimization either way, since the difference in size and speed are negligible. However, it sounds as if you may not have realized that they are the same, so bzt's comment was probably a good point.
Note that things would be slightly different if the value of AH were something else; for example, for
the replacement would be:
or, if you prefer the postfix base form,
(Note the use of hex; this isn't strictly necessary, but it simplifies things a great deal in this case, as the two bytes are represented in two hex digits apiece. If you really want to stick to decimal, it would be
Either way, it puts the same value into the register.)