Hi,
rdos wrote:Brendan wrote:Wrong. They rely on firmware to setup the chipset (memory controller, PCI bridges, etc) in a compatible way;
"In a compatible way". I have no idea what you are talking about. VBE typically uses PCI, and have no business messing with memory controller or PCI bridge. It might change base-addresses of memory / IO regions in a way that causes conflict, and thus the PCI device might have to check for memory range conflicts for devices (which it currently doesn't rather relies on BIOS doing sane settings). Other than that, I don't think this will be a problem.
To make it work:
- Inside the CPU there's special support to handle the caching of obsolete/legacy areas (the "fixed range MTRRs")
- Inside the memory controller there's special support to determine if reads and writes to the obsolete/legacy areas get forwarded to RAM or to PCI
- In all PCI bridges (including the host controller) there's special support to forward accesses to the obsolete/legacy VGA IO port range and forward accesses to the obsolete/legacy VGA IO "display memory window". Note: see the "VGA Enable" bit (bit 3 of the bridge control register) in your favourite copy of the PCI-to-PCI Bridge Architecture Specification
- In all video cards there's special support to handle the legacy VGA IO and memory accesses
Of course when there are multiple video devices, only one video device can receive the obsolete/legacy VGA accesses at a time. For this reason, all PCI video devices are fully functional without any of the obsolete/legacy VGA stuff listed above (otherwise you'd only ever be able to use one video card in a system).
Note: Technically, "all PCI video devices" isn't 100% correct - I think there were a few dodgy PCI video cards release when PCI was first introduced (that were mostly designed for ISA and slapped onto a PCI interface) which didn't comply with PCI specifications properly and couldn't be used for systems with multiple video cards.
Note: In theory, VBE can exist without any of the obsolete/legacy VGA hardware stuff. In practice, VBE has to run in real mode and therefore can't access anything outside the first 1 MiB of the physical address space; so using normal memory mapped IO (that can't be accessed in real mode) isn't practical. The obsolete/legacy VGA IO ports and "display memory window" are the only practical way for VBE to access the video card's registers; so in practice VBE requires the obsolete/legacy VGA hardware stuff.
For a real OS (e.g. Windows, Linux, etc), all the native video device drivers wouldn't use any of the obsolete/legacy VGA stuff, so that the same device driver works regardless of whether the video device is the "first" device in the system, or the second (or third or..). Otherwise you'd need 2 different drivers for each video card (which would be an annoying pain in the neck for everyone).
UEFI supports multiple video devices in the same system (this is one of the largest reasons why GOP is superior to VBE). Just like native video drivers in a real OS, the "UEFI video drivers" shouldn't rely on any of the obsolete/legacy VGA stuff because the drivers won't work in systems with multiple video cards if they do. This is why video card manufacturers need to provide "UEFI ROM images" (in addition to, in instead of, the obsolete "VBE ROM images").
Note: PCI devices have supported "multiple different ROM images" for an extremely long time, as PCI is intended for many different architectures and isn't intended for 80x86 alone.
Now; for what I call a "pure UEFI system", the CPU doesn't need the obsolete/legacy stuff, the memory controller doesn't need the obsolete/legacy stuff, the PCI controller and PCI bridges don't need the obsolete/legacy stuff, the video devices don't need the obsolete/legacy stuff, and the video device's ROM don't need the obsolete/legacy "VBE ROM images". All of it can be removed to save costs. For an example, the physical memory map can be a clean slab of RAM from 0x00000000 all the way up to the PCI hole, with none of the legacy puss infecting the first 1 MiB of the physical address space at all.
Of course nothing changes overnight. What we will see (especially for 80x86 desktop/server) is a gradual evolution from "BIOS only" to "UEFI + BIOS + hardware support for obsolete/legacy stuff" to "UEFI only + hardware support for obsolete/legacy stuff" and finally "pure UEFI". This slow evolution towards pure UEFI might take as long as 10 years (but to be honest, as soon as nobody cares about Windows XP we could see a fast land-slide to "pure UEFI", because all other OSs that people care about already support pure UEFI). However; this "slow evolution towards pure UEFI" doesn't apply to small/embedded 80x86 systems (e.g. designed for things like tablets and smartphones, where the OS is typically considered a built-in part of the end product); and for these systems there's no reason not to skip straight to "pure UEFI" and rip out all of the unnecessary legacy stuff now. The same applies to Apple's systems (Apple are already about 5 years ahead of "white box 80x86" on the path towards pure UEFI).
If you were designing a new OS today; it'd be extremely foolish to expect VBE (or any of the obsolete/legacy support the hardware needs to provide to make VBE work) to exist 10 years from now - it would be a massive mistake. If you designed an OS 20 years ago, then you couldn't have foreseen the death of the BIOS/VBE, so relying on the existence of VBE would've been perfectly understandable back then (but the clock is ticking and you'd want to start changing the OS to suit "pure UEFI" now so that your OS doesn't end up on the "unusable/obsolete" list itself).
rdos wrote:Brendan wrote:Sure; if you want to be completely retarded then you could do a large amount of extra work to create code that tricks the "GOP firmware" into thinking that you are the firmware and re-initialise the GOP interface.
I don't think I need this anymore. Reinitializing VBE would be much easier to do.
Why don't you ask Alan Turing to write the code for you? I hear he's not working on anything else at the moment...
Cheers,
Brendan