On Sat, Aug 22, 2015 at 5:02 PM, Marc Marí <markmb(a)redhat.com> wrote:
I'm working on basic 64 bit support for SeaBIOS.
The reason now is
because I want to test booting from an NVDIMM, which is mapped on the
region above 4G:
But this feature will also add support for future memory devices that
may be added. Below 4G region is getting too crowded. Another
possibility is to load Linux directly from 64 bits, instead of 16.
I'm now a bit lost on how to continue on this task. I'm not sure if I'm
in the right way, and I'm not sure if I'm overworking things.
You can see my little progress here:
Does anyone else want to engage in this project?
Regarding transition64, I suggest reading the Intel manuals for each
step in that function. Your comments suggest it is incomplete/not
A good way to get this working is to start with an infinite loop:
See if you can get the guest to spin in the loop (in long mode). The
QEMU gdbstub can be useful for debugging/verifying this (see the qemu
The next step is to implement the 64-bit to 16-bit mode transition.
Change the code to:
mov $1, %rax
transition64 should switch back to 16-bit mode after the 64-bit
function (entry64) returns. Again, use QEMU's gdbstub to debug this
(you may need to tell GDB which "target" you want so 16-bit/64-bit CPU
state is displayed correctly).
Once the transitions work you can simply use it for a 64-bit memcpy.
This means the only 64-bit code will copy data from NVDIMM down into
the lower 4 GB.