[coreboot] About Paging, Realmode and what is going on

ron minnich rminnich at gmail.com
Wed Aug 2 19:15:54 CEST 2017


I'll try not to mess this explanation up too much, but it's partly from the
docs and partly what we've learned over the years. I am assuming that
you've at least looked at the coreboot boot block and read some of the x86
docs, although from this note and previous notes you have written I'm still
not sure. Have you done some of your homework :-)

The architecture definition of x86 is that power on reset starts up at
0xffff0 in what looks to me like big real mode (a.k.a. "unreal mode" among
many other names). From using JTAG debuggers over the years it's been clear
to me anyway that it's not exactly classic x86 16-bit mode. Coreboot, like
most firmware, does a classic 16-bit longjmp with segment:offset to get to
the coreboot bootblock. This longjmp does flip us into classic x86 mode (as
is very apparent from JTAG debuggers). Coreboot in about 12 instructions
flips to 32-bit protected mode (no paging however). Then we go to C.

FWIW, many vendors told us at the time it was impossible to write firmware
in C, as we did in 2000, so it was nice to show it could be done.

As for paging: we've had several platforms, starting in 2000, that used
paging (which does not always imply page tables). Alpha comes to mind: we
had a basic PALCode that implemented 1:1 mapping. Most coreboot platforms
use paging.

I note that some amount of paging is now in coreboot for x86 and maybe
someone can let us know where and when it's used.

But as for real mode, no, starting from POR in protected mode has never
been an option intel was willing to support. We've asked ("we" not being
Google, but from my earlier life in HPC). There's no technical reason it
could not work (it's microcode, after all) but it would be a pretty big
change from the "party like it's 1978" model of the x86.

Note that many CPUs, such PPC starting ca. 2008, can not run with paging
off; they start up with default entries in the TLB and paging is on from
power on reset.

You can't enter long mode (x86-64) mode without enabling paging. you need
long mode if you need to operate on more than 2^36 bytes of memory. That's
coming everywhere. Hence, the future of coreboot is unambiguously one in
which paging is on and at least in my case I found it's possible to make
that happen in the boot block -- albeit a bigger boot block than we have
today.

ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot/attachments/20170802/d9c9557c/attachment.html>


More information about the coreboot mailing list