Page 1 of 1
Booting UEFI firmware (OVMF) in Bochs
Posted: Sun Jan 13, 2019 11:34 pm
by kzinti
I've been trying to get Bochs to boot using a UEFI firmware (OVMF) with no success. All I get is a black screen (no crash) and no useful information in the logs. The internets are also very unhelpful here.
Any pointers as to whether or not this is possible and how to do it? I am not married to OVMF and would happily switch to another firmware that works with Bochs.
Note: the same disk image works fine under QEMU and real hardware (2 different PCs).
Note 2: not loading my disk image produces the same result. Bochs appears to be running firmware code and never displaying anything.
Code: Select all
# Bochs configuration file
# Firmware
romimage: file="./third_party/tianocore/ovmf-x64-r15214.fd"
ata0-master: type=disk, path="./build/x86_64/rainbow-uefi.img", mode=flat
boot: disk
mouse: enabled=1
megs: 2048
# Display
display_library: sdl, options="gui_debug"
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Sun Jan 13, 2019 11:59 pm
by klange
kzinti wrote:I've been trying to get Bochs to boot using a UEFI firmware (OVMF) with no success.
There's no hidden trick you're missing. OVMF does not work in Bochs, end of story. It is written only to run in QEMU.
EFI support in Bochs remains an unanswered feature request to this day.
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Mon Jan 14, 2019 12:28 am
by stlw
It is actually even worse than you think.
Bochs has only two active developers which do not and absolute lack of interest from the community - looks like everybody prefer to contribute QEMU.
We have no clue what even required to be done to support OVMF in Bochs
Would be glad if somebody would join and explain.
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Mon Jan 14, 2019 9:07 am
by kzinti
OK thanks, I'll just have to add a BIOS bootloader and image then.
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Mon Jan 14, 2019 12:12 pm
by BenLunt
stlw wrote:It is actually even worse than you think.
Bochs has only two active developers which do not and absolute lack of interest from the community - looks like everybody prefer to contribute QEMU.
We have no clue what even required to be done to support OVMF in Bochs
Would be glad if somebody would join and explain.
There is quite a bit of work that would need to be done to Bochs to get it to work with both a Legacy BIOS and an UEFI firmware. Bochs was written for the Legacy type and had no idea there would be a new type of BIOS in later years.
Currently, the Bochs code initializes parts of the virtual machine before the BIOS is called and also relies upon certain aspects of a Legacy BIOS. To get it to work with UEFI, a number of changes would have to be done to both the main core of Bochs as well as the Legacy BIOS code to allow both types. This is a challenge that I don't think many wish the start, though I have looked into it myself and gave up after hours (and hours) of work.
It is and will be a massive re-write unfortunately.
However, I am not an active member of the Bochs team, so don't take my word for it. I have contributed to a lot of the code, including some BIOS modifications, but Stanislav and Volker are the ones to ask. I think Stanislav even roams these forums once in a while.
Ben
-
http://www.fysnet.net/osdesign_book_series.htm
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Mon Jan 14, 2019 12:48 pm
by Octocontrabass
To make OVMF work in Bochs, you need to configure at least 64MB of RAM and the PCI (not ISA) Cirrus SVGA adapter.
Also, make sure you didn't build OVMF with SMM support. Bochs doesn't emulate the correct chipset for that feature.
Bochs still makes some legacy hardware assumptions, so you might notice some things that don't work quite right, but it's good enough to at least boot an operating system (I tested with a Linux installer).
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Tue Jan 15, 2019 12:58 am
by stlw
Octocontrabass wrote:To make OVMF work in Bochs, you need to configure at least 64MB of RAM and the PCI (not ISA) Cirrus SVGA adapter.
Also, make sure you didn't build OVMF with SMM support. Bochs doesn't emulate the correct chipset for that feature.
Bochs still makes some legacy hardware assumptions, so you might notice some things that don't work quite right, but it's good enough to at least boot an operating system (I tested with a Linux installer).
Can you post some detailed instructions and OVMF image you have got ?
I am willing to try fixing the SMM at least, I only need to know what to do ...
P.S>
Ben, I am here
Stanislav
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Tue Jan 15, 2019 3:03 am
by Octocontrabass
stlw wrote:Can you post some detailed instructions and OVMF image you have got ?
I downloaded a prebuilt OVMF from
here. I've attached the bochsrc I use to boot it.
stlw wrote:I am willing to try fixing the SMM at least, I only need to know what to do ...
I suggest you first move port 0xe9 to port 0x402 so OVMF can tell you what it's doing when things stop working. After that, it's just the simple matter of implementing an entirely new chipset.
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Wed Jan 16, 2019 10:05 am
by stlw
Octocontrabass wrote:
I suggest you first move port 0xe9 to port 0x402 so OVMF can tell you what it's doing when things stop working. After that, it's just the simple matter of implementing an entirely new chipset.
Which one ? - this is the question !
Re: Booting UEFI firmware (OVMF) in Bochs
Posted: Wed Jan 16, 2019 11:16 am
by Octocontrabass