On Monday 02 July 2018 22:50, Arlen Holder conveyed the following to
alt.os.linux...
> On 2 Jul 2018 20:10:03 GMT, Aragorn wrote:
>
>>> Why on earth isn't "legacy support" the BIOS default?
>>> (Is there something bad that happens when Legacy support is
>>> enabled?)
>>
>> Not something "bad," but something "more complicated." ;)
>
> Ah. OK. There has to be a *reason* for the non-legacy default, if I
> assume that the developers aren't idiots.
There is, see my other post. For one, updating the BIOS, which has to
be done from within DOS, and without as much as any kind of memory
extender or keyboard mapping (other than the default US keyboard map)
being loaded into memory, or you will be toasting your BIOS and
rendering your computer inoperable.
>> "USB legacy support" implies a few more tricks from the BIOS before
>> the system can boot.
>
> This makes sense, since the USB keyboard is 10 years "old", so, the
> BIOS folks have to do "something" to enable both the old and new USB
> keyboards (although the BIOS is about 10 years old also).
No ─ again, see my other post. The keyboard isn't what's "legacy". The
BIOS is the legacy component, and it runs in real mode, which is
considered legacy because it was the addressing mode of the Intel
i8086/i8088 processor family on the original IBM PC.
Ergo, enabling "legacy USB support" means that USB support most be
enabled for a legacy mode of operation, in this case being the BIOS
firmware and anything that runs in real mode, such as GRUB.
> Interesting. So Grub only has 640 KiB RAM to work with.
640 KiB of base memory, plus 384 KiB upper memory range ─ which contains
the I/O addresses of legacy hardware ─ plus another 64 KiB of HMA from
the A20 line. So it has an address range of 1088 KiB, but some of those
addresses ─ most notably inside the 384 upper memory range between 640
Kib and 1024 KiB ─ are reserved for accessing legacy IBM PC-compatible
hardware.
>> "USB legacy support" requires PS/2 emulation, and this emulation must
>> run in the higher memory address range.
>
> Oh. Oh...
>
>> Hence, with "USB legacy
>> support" enabled, the BIOS must set up protected mode first in order
>> to access the higher memory addresses above 1088 KiB � i.e. 640 KiB
>> base RAM + 384 KiB upper memory blocks (with legacy BIOS I/O
>> addresses) + 64 KiB from the A20 line � and then, with the protected
>> mode page tables still intact, drop back to 16-bit real mode in order
>> to continue booting.
>
> Ah. "protected mode".
> It's been a long time since I heard those words.
The original Intel x86 processor was the i8086, of which a slightly less
powerful variant would appear shortly after, i.e. the i8088. These
processors had only one mode of operation, in which there was no
privilege separation, no multitasking support ─ let alone multi-
threading or multi-processing ─ and no memory management unit.
In this mode, the software runs with full privileges, full access to the
hardware, and direct management of the memory. Any program running in
real mode could tell the processor "I want this memory segment and this
offset", and seize it.
When the Intel i80286 was introduced, it was still a 16-bit processor,
and it also still used 64 KiB memory segments. However, it did have
multitasking support and privilege separation, and it was capable of
addressing up to 16 MiB of RAM.
But DOS cannot run in that environment, and so the decision was made to
have the processor boot up in a mode that was fully compatible with the
i8086/i8088, and this mode was then called "real mode", because in this
mode, the software can seize "real" memory addresses by their literal
segment and offset designations. In the "native" mode of the processor,
the software cannot do that, and therefore that native mode was called
"protected mode".
The i386 and i486 spiced things up a bit more by being 32-bit in their
"protected mode" and offering flat memory addressing by way of page
tables, without using segments and offsets, and offering a maximum RAM
capacity of 4 GiB. They also offered the systems management mode for
hardware and power management, and an i8086 compatibility mode (called
V86, or "virtual 8086") that could be accessed from within 32-bit
protected mode and multitasked alongside of native protected mode
applications.
The Pentium II added PAE ("physical address extensions") ─ at least, if
the kernel of the operating system supports that ─ by adding another
page table, so that it could access 64 GiB of RAM, with pages of 3 GiB
for userspace and 1 GiB of address space for the kernel.
x86-64 (alias AMD64) extended the possibilities even further by using
64-bit memory addresses, 64-bit registers, and a sparse memory address
space for future compatibility.
There's even more to the AMD64 than that, but I'm not going to get into
that here. It's beyond the scope of this explanation. You should get
the gist by now, and if you really want to know, then Wikipedia is your
friend. ;)
> I admit I never really understood them - but I do understand your
> point - which is that there are "complications" that must 'slow things
> down' a bit, which the BIOS developer decided to skip by default.
They didn't skip it for reasons of speed, but for reasons of full
compatibility with MS-DOS.
> In terms of "helping others", since I'm all about proactive tutorials
> that *avoid* problems, what could I have done, just by looking at the
> keyboard perhaps, to know that this problem would show up when I set
> up Grub?
>
> Given this is the keyboard (Lenovo, model SK-8815 L, made in 2007):
> <
http://img4.imagetitan.com/img.php?image=18_grub10.jpg>
> <
https://support.lenovo.com/us/en/solutions/pd010250>
>
> Rather than waiting for Grub to fail, I'd rather be proactive in my
> tutorials (I always write tutorials every time I do anything), the
> obvious question becomes...
>
> Is there anything (other than Grub failing) that tells me I am using a
> "legacy USB keyboard"?
Again, you misunderstand. There is no such thing as a legacy USB
keyboard. The word "legacy" pertains to the BIOS firmware itself.
By consequence, if you have a legacy BIOS instead of UEFI firmware and
you intend to use that machine with a USB keyboard and mouse, then you
should first and foremost connect a PS/2 keyboard to that machine, enter
the BIOS setup utility and ascertain whether "legacy USB support" is
enabled or not.
PS/2 keyboards and mice run fine in "legacy mode", i.e. the default
setup of the BIOS firmware. USB keyboards and mice require "legacy USB
support" enabled or you will not have keyboard access while the
processor is in real mode. Enabling this setting does however not
disable PS/2 keyboard and mouse support.
If you are going to flash the BIOS, then you need to do this with MS-
DOS, without any memory extenders, CD extensions or TSRs loaded, and
with a PS/2 keyboard, and the "legacy USB support" in the BIOS setup
utility set to DISABLED. And the machine should be hooked up to a UPS
too, just to avoid brownouts and power failures while the flashing is in
progress.
Any deviation from the above MAY ruin your BIOS and render your computer
unbootable. And your warranty will be voided, because this is all
always specified in the motherboard manual.