Well, many thanks.
I didn't expect it to work that way. Would be interesting to know what Windows 7 needs BIOS calls for.
Any idea of traditional IBM-PC-Bios-calls are still available in UEFI-Firmware?
On 31.07.2017 11:43, Patrick Georgi via coreboot wrote:
2017-07-31 10:52 GMT+02:00 Philipp Stanner stanner@posteo.de:
- cb switches the CPU immediately to Protected Mode, yet Payloads like seaBIOS work in Real Mode. Does coreboot switch the CPU always back to RM before jumping to the payload?
No, payloads are started in pmode.
- When CB switches to PM - who generates and administrates the Page Tables and where?
We use flat mode: 4gb segments starting at 0, for code and data. Virtual address == logical address == physical address
- Gustavo Duarte writes that GRUB switches from protected mode to real mode and vice versa all the time to address >1MiB of RAM and also use the BIOS-calls. If this is true using GRUB as payload would not work, as GRUB needs to call the non-existent BIOS, right?
It uses BIOS calls, except when built for coreboot.
- Once CB is in PM it can't access physical addresses anymore? It doesn't need to, too?
We use flat mode, see above.
- PM means RAM-access is only possible through virtual addresses which are translated by the MMU using the Page Tables. This question is similar to [2.]: If coreboot generates the Page Tables and the payload would start in PM as well (is this even possible? At least the Linux-Kernel has entry points for RM and PM) this would mean the payload needs to use the Page Tables generated by CB. That wouldn't be a problem as they're linked in the register CR3 anyways?
As stated above, payloads start in pmode. As stated above, we use a flat representation which comes with no surprises. The payload can then reconfigure the system to setup its own configuration.
Why does every modern CPU still start in RM? I do get the compatibility problem, but on the other hand: Do you need it for anything beside booting MS-DOS on your Ryzen? Is it really impossible for AMD and Intel to create a new CPU-generation with the x86-instruction set without RM, 16-bit-registers and 20-bit-mode registers like CS, SS etc. No modern OS uses bios calls. No CPU is ever switched to RM again after booting up. They should get rid of this old stuff.
"Every modern x86 CPU". In the end, that's something to ask the CPU vendors (but don't expect any answers). Some guesses:
- Windows 7 uses BIOS calls (although they stopped switching back to
real mode for that, they use x86 16bit emulation. still, BIOS services need to be there) 2. CPUs might not be switched back to real mode today, but from 32bit modes it's a pretty short route to vm86 modes, which are effectively identical to real mode and still in use. 3. Why change a working system and risk compatibility issues? x86's biggest selling point is compatibility, and if you forfeit that, users may move off your architecture entirely.
Regards, Patrick
On 31.07.2017 13:48, Philipp Stanner wrote:
Well, many thanks.
I didn't expect it to work that way. Would be interesting to know what Windows 7 needs BIOS calls for.
It seems to be their policy to have a boot loader (and probably kernel) that can't work on its own. So Windows (including current versions) al- ways need either BIOS calls or UEFI services. No idea about the kernel's requirements, but the bootloader part could probably be fixed easily by implementing Multiboot ;)
Any idea of traditional IBM-PC-Bios-calls are still available in UEFI-Firmware?
No idea, all of them? usually through a CSM (Compatibility Support Module). It's kind of the SeaBIOS of UEFI.
Nico
2017-07-31 14:46 GMT+02:00 Nico Huber nico.huber@secunet.com:
No idea about the kernel's requirements
Windows 7's kernel uses int10 calls for checking out various graphics properties, even when booting with UEFI (and therefore GOP drivers better put some int10 handler in the right place if they want to continue to support Win7).
No idea, all of them? usually through a CSM (Compatibility Support Module). It's kind of the SeaBIOS of UEFI.
SeaBIOS can be compiled as CSM, too (though commercial UEFIs probably don't ship with SeaBIOS for licensing reasons)
Patrick