[coreboot] [Bochs-developers] Has anyone used a real BIOS image?
sduplichan at yahoo.com
Tue Apr 7 05:55:09 CEST 2009
I found a bochs project that boots a real AMI BIOS. The bios is for Matrix, a Foxconn dual socket Opteron server. The bochs code and bios code is from mid 2004. The archive includes everything except the ami bios source code: http://notabs.org/bochs/. Here are some limitations. I always used Windows x64 and Microsoft Visual Studio to build and execute. The project files are for Visual Studio 2005. The executable is for Win x64. I did build a Win32 executable and it seems to work OK. Run the matrix-ami batch file in the bochs directory to boot. If the first boot attempt hangs, try again. It never takes more than two attempts. The hang is because of a cmos problem, but I forget if it is a bochs problem or bios problem. The AMD-8111 cmos is kept in cmos.bin. Once the bios splash screen is displayed, it will show, "timer error, press f1 to resume" (http://notabs.org/bochs/matrix-01.png). The cause is imperfect 8254 emulation. Just press f1. After that it
will boot to DOS from a hard drive image. This bochs makes an I/O log file (io.log). DOS boot results in about 200,000 entries. Some are nicely formatted. Also included is a full screen bios source level debugger. Without bios source code, the debugger is still quite useful. To invoke the debugger, press <Ctrl>C in the bochs console and type debug (http://notabs.org/bochs/matrix-02.png). The debugger window will open. The error message about no *.map means source code debugging will not be available (http://notabs.org/bochs/matrix-03.png). Press f2 (twice because of a bug) to switch to disassembly view (http://notabs.org/bochs/matrix-04.png). Press f2 to toggle breakpoints (http://notabs.org/bochs/matrix-05.png). Press g (go). Execution will stop when a breakpoint is hit (http://notabs.org/bochs/matrix-06png). Press f4 for a command line debugger. The ? help screen doesn't seem to be working. It should read:
db <address> <count> display bytes <address>
dw <address> <count> display words <address>
dd <address> <count> display dwords <address>
dq <address> <count> display qwords <address>
u16, u32, u64 <count> unassemble
eax=<value> change eax value, same for other registers
esc toggles command/navigate mode
cls clear screen
Here is an example http://notabs.org/bochs/matrix-07png.
Press <Alt>X to exit the debugger and return to the normal bochs console mode.
These code modifications were made in haste for temporary use. Lack of comments and other coding shortcuts will limit the usefulness of this code for others.
--- On Sun, 4/5/09, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:
> From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
> Subject: Re: [Bochs-developers] Has anyone used a real BIOS image?
> To: "Mark Marshall" <mark.marshall60 at ntlworld.com>
> Cc: bochs-developers at lists.sourceforge.net, "Coreboot" <coreboot at coreboot.org>
> Date: Sunday, April 5, 2009, 6:12 PM
> Hi Mark,
> you have some coreboot questions in the mail below. I'm
> quoting it in
> full and adding the coreboot mailing list to CC.
> On 06.04.2009 00:15, Mark Marshall wrote:
> > For various reasons (mainly out of curiosity) I've
> been spending a while
> > to see if I can get Bochs to boot (and maybe then run)
> with a real
> > (unaltered) BIOS. Has anyone done this in the past?
> What BIOS did they
> > use? How much did they need to tweak things to get it
> to work? (I need
> > PCI for this to be interesting to me).
> > I've been playing around trying to get an ASUS P2B
> to boot. I've got as
> > far as it getting the graphics up and running (by
> mapping in the VGA
> > cards BIOS) but it seems to hang while it's
> running some sort of test on
> > the PIT. The POST code has counted up from 0x05 to
> 0x14 but then hangs.
> > (The Award docs I've found on the net all say
> that 0x14 means it's
> > doing something with the PIT).
> Are you trying to get an Asus P2B (hardware) to work or do
> you want to
> execute the P2B BIOS in Bochs? Given your first sentence,
> it seems you
> want the latter.
> > To get this far I've had to tweak a few things,
> mainly to move the PCI
> > hardware up to 440BX standard. I've also created
> a skeleton SuperIO.
> > This is the sort of generation of hardware that I
> wanted to go for, but
> > I had no real requirements. It seemed that the P2B
> was well understood
> > (It's the generation of Intel chip-set that seems
> to be best documented).
> > I had to add a little more support to the SMBus stuff,
> but I still don't
> > really know what values I should return to mean what -
> there's a good
> > chance I've told the BIOS that I have gigs of RAM.
> > Has anyone ever used a coreboot BIOS with Bochs? Does
> this work? Do
> > the coreboot guys even use Bochs to get things going
> (if they don't yet,
> > then I suspect that they would really appreciate Bochs
> emulation being
> > improved to the point where this is possible).
> The standard coreboot target for development without
> hardware is Qemu. I
> believe coreboot runs in Bochs as well, but it's been a
> long time since
> I tried and I don't really remember the results.
> > I first got interested in Bochs because I've been
> writing the VGA BIOS
> > for the OGD1 project. For this I wanted a development
> cycle that didn't
> > involve re-flashing a board and then power-cycling a
> PC. Bochs has been
> > great for this, so thanks.
> > MM
> > PS.
> > I will at some point have a few patches to send
> up-stream, but I have
> > slightly large questions about the configuration
> mechanism used in Bochs
> > at the moment. I'd like to be able to give it
> configuration files that
> > matched different _real_ hardware - I'm not
> convinced that we can do
> > that at the moment. (A P2B, a A7N8x, etc.).
> bochs-developers mailing list
> bochs-developers at lists.sourceforge.net
More information about the coreboot