Booting Windows using coreboot
The wiki is being retired!
Documentation is now handled by the same processes we use for code: Add something to the Documentation/ directory in the coreboot repo, and it will be rendered to https://doc.coreboot.org/. Contributions welcome!
LinuxBIOS itself has many positive aspects that should be made widely available. In order to make LinuxBIOS a very strong alternative firmware for PC's we cannot afford not considering support for windows since it owns about 90% in the PC market.
This projects was accepted for the Google Summer Of Code 2007 and its main goal to figure out how to boot Windows Vista/XP/2003. There is not a chosen approach to achieve that. Having a dedicated LinuxBIOS loader is the most desired solution but since some success has been reported using ADLO, it has been chosen in this phase of understanding better the problem.
Instead of a real hardware, QEMU emulator will be used since it is easily available for anyone who wishes to contribute.
I intend to describe in a detailed all the steps taken up to now and some the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled Flexibility in ROM: A Stackable Open Source BIOS. After that, we will focus on windows XP and Vista that require a more complicated support.
Any suggestion is welcome, please use the LinuxBIOS mailing list or email Augusto Pedroza.
The following software packages are needed:
- QEMU 0.9.0 or greater
- as86 80x86 assembler
plus a working development environment (make, gcc, etc.). gcc verions 4.0.x and 4.1.x work fine except for QEMU, which requires gcc 3.x.
In order to build QEMU from source gcc 3.x. is required. If you use a different version of gcc, take a look at the following section.
Building gcc 3.x
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz $ tar zxvf gcc-3.4.6.tar.gz $ cd gcc-3.4.6/ $ ./configure --prefix=/opt/gcc34 $ make bootstrap $ make install (as root)
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.
$ tar zxvf qemu-0.9.0.tar.gz $ cd qemu-0.9.0/
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make $ make install
The QEMU binary is stored in the i386-softmmu directory.
Creating an Appropriate Disk Image
There are few options to create an image, I chose to use the qemu-img tool. Create an image no smaller than 1.2Gb to avoid any kind of problems during windows installation. The qcow format is very appropriate because will only take up as much space as is really needed. Since I wanted to install a small version of linux, I created an image of 2Gb.
$ qemu-img create -f qcow /path/to/win2k.cow 2000M
Insert the install CD, and install Windows in the QEMU image:
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime
You can test the image running the following:
$ qemu -hda /path/to/xp.cow -boot c -m 384 -localtime
I repeated the steps above to install a small version of linux so grub was installed together with the distro I chose. I will soon post a way of installing grub without the need of installing Linux.
Building LinuxBIOS payload