https://www.coreboot.org/api.php?action=feedcontributions&user=Augusto&feedformat=atomcoreboot - User contributions [en]2024-03-29T14:06:13ZUser contributionsMediaWiki 1.40.0https://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4882Booting Windows using coreboot2007-09-05T21:13:41Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
[http://www.linuxbios.org/data/windowsxp.mpeg Video: Booting Windows XP - Play it using ffmpeg]<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4881Booting Windows using coreboot2007-09-05T21:11:01Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
[http://www.linuxbios.org/data/windowsxp.mpeg Video: Booting Windows XP - Recorded using ffmpeg]<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4880Booting Windows using coreboot2007-09-05T21:09:52Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
[http://www.linuxbios.org/data/windowsxp.mpeg Video: Booting Windows XP - Recorded with ffmpeg]<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4879Booting Windows using coreboot2007-09-05T21:03:58Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
[http://www.linuxbios.org/data/windowsxp.mpeg Video: Booting Windows XP]<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4859Booting Windows using coreboot2007-08-26T01:46:25Z<p>Augusto: /* Building QEMU */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4858Booting Windows using coreboot2007-08-26T01:44:59Z<p>Augusto: /* Building QEMU */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
Download these two patches and save them in the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
<br />
Apply the patches and configure QEMU using the following:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ patch -p1 < qemu-bios-size.patch<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=QEMU_Build_Tutorial&diff=4857QEMU Build Tutorial2007-08-26T01:40:40Z<p>Augusto: /* Building Qemu */</p>
<hr />
<div>=== Introduction ===<br />
<br />
If you don't have a mainboard supported by LinuxBIOS don't worry: [http://qemu.org/ QEMU] can help you to emulate one. Using LinuxBIOS with QEMU may serve the purpose to familiarize you as a developer with LinuxBIOS and may be a reference system during development. <br />
<br />
This nice tutorial was written by [mailto:acassis@gmail.com Alan Carvalho de Assis], with additions by [mailto:eswierk@arastra.com Ed Swierk] (but please use the [[Mailinglist|LinuxBIOS mailing list]] rather than emailing the authors directly).<br />
<br />
While there are many ways to use LinuxBIOS to load and run a Linux kernel, this tutorial covers two of the most common:<br />
<br />
* LinuxBIOS with [[FILO]] as payload, using FILO to load a Linux kernel (and optional initramfs) from a hard disk image. This approach involves a bit more mechanism (it relies on FILO's built-in disk and filesystem drivers) but it produces a tiny LinuxBIOS image.<br />
* LinuxBIOS with a Linux kernel (and optional initramfs) as payload. This cuts FILO out of the picture, but the main challenge with this approach is squeezing the resulting LinuxBIOS image into QEMU's BIOS ROM area (currently 2 MB, but easy to extend by patching QEMU).<br />
<br />
=== Requirements === <br />
<br />
You need the following software packages:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] r2405 or greater<br />
* [http://qemu.org/ Qemu] 0.9.0 or greater<br />
* [[FILO]] 0.4.2 or greater (if using FILO)<br />
* [ftp://ftp.lnxi.com/pub/mkelfImage mkelfImage] 2.7 or greater (if not using FILO)<br />
<br />
plus a Linux kernel and root filesystem and a working development environment (make, gcc, etc.). gcc 4.0.x and 4.1.x are known to work for all packages except QEMU, which requires gcc 3.x.<br />
<br />
=== Building or finding a Linux kernel ===<br />
<br />
If you are using FILO, you can simply grab a Linux kernel and initramfs from your favorite distribution.<br />
<br />
Otherwise, you will probably need to build a kernel and initramfs from scratch, ensuring that the final LinuxBIOS image does not exceed QEMU's BIOS size limit (2MB if qemu-bios-size patch applied, 256KB otherwise). Building the kernel and initramfs is beyond the scope of this tutorial; how you configure them depends on your application.<br />
<br />
If you plan to use kexec to chain-boot another Linux kernel, tools from these projects can help automate the process of generating a kernel and initramfs:<br />
* [http://kboot.sourceforge.net/ kboot]<br />
* [http://wiki.laptop.org/go/Building_LinuxBIOS OLPC buildrom]<br />
<br />
=== Building a FILO payload ===<br />
<br />
If you plan to build your Linux kernel and root filesystem directly into LinuxBIOS, you can skip this section.<br />
<br />
Download FILO (I used filo-0.4.2.tar.bz2), decompress it, and cd to the created directory.<br />
<br />
First invocation of make creates the default Config file.<br />
$ make<br />
<br />
Edit this file as you like. The default configuration worked for me. <br />
$ vi Config <br />
<br />
Run make again to create filo.elf, the ELF FILO image. <br />
$ make <br />
<br />
You will use this file (filo.elf) as the LinuxBIOS payload later on.<br />
<br />
=== Building a Linux kernel payload ===<br />
<br />
If you are using FILO, skip this section.<br />
<br />
Download mkelfImage (I used mkelfImage-2.7.tar.gz), decompress it, and cd to the created directory.<br />
<br />
Configure and build the mkelfImage binary.<br />
$ ./configure && make<br />
<br />
Now use mkelfImage to convert your Linux kernel image (vmlinuz) and initramfs (initrd) into a usable LinuxBIOS payload (linux.elf):<br />
$ mkelfImage --append="console=ttyS0" --initrd=initrd vmlinuz linux.elf<br />
<br />
=== Building LinuxBIOS ===<br />
<br />
Download the LinuxBIOS source code (I used LinuxBIOSv2-2405) and extract it. <br />
<br />
Change to directory targets/emulation/qemu-i386 and modify Config.lb:<br />
* change payload to point to your payload (filo.elf or linux.elf)<br />
* if you are using a Linux payload, increase the value of option ROM_SIZE to 2048*1024 (2 MB)<br />
<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
<br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy and rename this file to bios.bin in your home directory.<br />
<br />
=== Building Qemu ===<br />
<br />
If you plan to run Qemu version 0.9.0, you will have to build QEMU from source after applying a couple of patches. (Later versions of QEMU might incorporate these patches, allowing you to run them unmodified; hopefully someone will be kind enough to update this tutorial if this happens.)<br />
<br />
Download the QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
<br />
Download these three patches and save them to the QEMU source directory:<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-isa-bios-ram.patch qemu-isa-bios-ram.patch]<br />
* [http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch qemu-piix-ram-size.patch]<br />
* [http://lbdistro.sourceforge.net/patches/qemu-bios-size.patch qemu-bios-size.patch]<br />
<br />
Enter the QEMU source directory and apply the patches:<br />
$ patch -p1 < qemu-isa-bios-ram.patch<br />
$ patch -p1 < qemu-piix-ram-size.patch<br />
$ patch -p1 < qemu-bios-size.patch<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=gcc-3.4 --target-list=i386-softmmu && make<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
=== Creating a hard disk image ===<br />
<br />
If you are using FILO, you must create a hard disk image containing the Linux kernel and optional initramfs that FILO loads.<br />
<br />
Whether or not you use FILO, you may also wish to populate the disk image with the root filesystem of whatever Linux distribution you want to run.<br />
<br />
Create an empty disk image:<br />
$ qemu-img create -f raw disk.img 200M<br />
<br />
Format it:<br />
$ mkfs.ext2 -F disk.img <br />
<br />
The remaining steps must be performed as root. Create a temporary mountpoint and mount the image:<br />
# mkdir /mnt/rootfs<br />
# mount -o loop disk.img /mnt/rootfs<br />
<br />
Create a boot directory and copy your Linux kernel (vmlinuz) and initramfs (initrd) to it:<br />
# mkdir /mnt/rootfs/boot<br />
# cp vmlinuz /mnt/rootfs/boot/vmlinuz<br />
# cp initrd /mnt/rootfs/boot/initrd<br />
<br />
At this point, you can also copy a complete root filesystem to the disk image. <br />
# cp -R /* /mnt/rootfs <br />
<br />
Alternatively, with Debian you can use the debootstrap command to create a basic root filesystem:<br />
# debootstrap --arch i386 sarge /mnt/rootfs http://ftp.debian.org/debian/ <br />
<br />
If you are using a debootstrap filesystem, open the file /mnt/rootfs/etc/inittab and change runlevel to level 1:<br />
id:1:initdefault: <br />
<br />
cd out of /mnt/rootfs and umount it:<br />
# umount /mnt/rootfs<br />
<br />
Exit from the root account:<br />
# exit<br />
<br />
=== Starting LinuxBIOS in QEMU ===<br />
<br />
Execute QEMU using the following parameters:<br />
$ qemu -L ~ -hda disk.img -nographic<br />
<br />
The -L option tells QEMU to look for bios.bin in your $HOME directory. The -nographic option suppresses the graphical VGA display and connects the virtual machine's serial port to your console.<br />
<br />
You should now see all sorts of interesting LinuxBIOS messages, followed by Linux kernel boot messages or a FILO prompt.<br />
<br />
If you are using FILO, enter at the boot: prompt:<br />
boot: hda:/boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0<br />
<br />
Example:<br />
<br />
[[Image:Screenshot linuxbios boots qemu.png]]<br />
[[Category:Testing]]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4846Booting Windows using coreboot2007-08-18T17:02:21Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Download and install [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86]:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4845Booting Windows using coreboot2007-08-18T16:59:37Z<p>Augusto: /* Building ADLO payload (LinuxBIOSv2) */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
Download and install as86:<br />
$ tar xzvf as86-0.16.17.tar.gz<br />
$ cd as86-0.16.17/<br />
$ make<br />
$ make install<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4844Booting Windows using coreboot2007-08-18T16:45:11Z<p>Augusto: /* Requirements */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://homepage.ntlworld.com/robert.debath/dev86/as86-0.16.17.tar.gz as86] 80x86 assembler<br />
<br />
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.<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4823Booting Windows using coreboot2007-08-15T18:37:23Z<p>Augusto: /* Building ADLO payload (LinuxBIOSv2) */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ cd util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4822Booting Windows using coreboot2007-08-15T18:36:51Z<p>Augusto: /* Building LinuxBIOSv3 */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/util<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4821Booting Windows using coreboot2007-08-15T18:12:46Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload (LinuxBIOSv2) ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4820Booting Windows using coreboot2007-08-15T18:11:58Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
'''IMPORTANT: This step is necessary only if using LinuxBIOSv2. If using LinuxBIOSv3 go to section ''Building LinuxBIOSv3'''''<br />
<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv2 ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ Apply patch that puts ADLO into LinuxBIOSv3<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ADLO payload file<br />
<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have successfully tested a win2k and a winXP images with and without ACPI support on.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4819Booting Windows using coreboot2007-08-15T00:15:50Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
$ patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k, a winXP image with no ACPI and a win2k image with ACPI support.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4818Booting Windows using coreboot2007-08-15T00:15:29Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to LinuxBIOSv2 directory:<br />
$ cd LinuxBIOSv2/<br />
# patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k, a winXP image with no ACPI and a win2k image with ACPI support.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4758Booting Windows using coreboot2007-08-03T13:39:32Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/<br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
& patch -p1 < xpboot.diff<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k, a winXP image with no ACPI and a win2k image with ACPI support.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4754Booting Windows using coreboot2007-07-27T20:15:57Z<p>Augusto: /* Installing Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO <br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to ADLO's directory:<br />
$ cd ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k, a winXP image with no ACPI and a win2k image with ACPI support.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4752Booting Windows using coreboot2007-07-26T00:54:30Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO <br />
'''APPLY PATCH SENT TO LINUXBIOS MAILING LIST!'''<br />
<br />
Go to ADLO's directory:<br />
$ cd ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k and a winXP image with no ACPI. <br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4751Booting Windows using coreboot2007-07-24T02:23:14Z<p>Augusto: /* Installing Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO <br />
'''I WILL SOON RELEASE SOME NECESSARY PATCHES!'''<br />
<br />
Go to ADLO's directory:<br />
$ cd ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k and a winXP image with no ACPI. <br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS. <br />
This step takes a lot longer than installing windows on a Hard Disk.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4750Booting Windows using coreboot2007-07-20T20:35:14Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv3]]<br />
* [http://www.linuxbios.org/ADLO ADLO] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download ADLO's source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2/util/ADLO <br />
'''I WILL SOON RELEASE SOME NECESSARY PATCHES!'''<br />
<br />
Go to ADLO's directory:<br />
$ cd ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder. I will call this folder 'LinuxBIOS_bios/'<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000/XP in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I have tested a win2k and a winXP image with no ACPI.<br />
<br />
<br />
Windows seems to be very sensitive to BIOS changes. I got the following error when installing windows with QEMU default BIOS and later trying to run it using LinuxBIOS:<br />
'''*** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE''' [http://www.biermann.org/philipp/STOP_0x0000007B/].<br />
<br />
So, the BIOS used during windows installation should be the same as the one that will be used to run windows. <br />
<br />
<br />
Before executing the next command, copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is, in my case, LinuxBIOS_bios/. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Then run:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda /path/to/win.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS.<br />
<br />
== Booting Windows ==<br />
<br />
Just execute this:<br />
$ qemu -L path/to/LinuxBIOS_bios/ -hda win.cow<br />
<br />
I get the following errors due to interrupt calls:<br />
<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''Just wait the boot process and ... enjoy it!!'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/LinuxBIOS_bios/ -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''Now that we are able to boot windows 2000 and XP, we will work hard on getting windows Vista soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4749Booting Windows using coreboot2007-07-20T19:41:38Z<p>Augusto: /* Useful Links */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder.<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging QEMU with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ Creating Windows QEMU images]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4748Booting Windows using coreboot2007-07-20T18:56:21Z<p>Augusto: /* Project Overview */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder.<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4741Booting Windows using coreboot2007-07-10T00:46:06Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder.<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
Even though some keyboard error messages are displayed, the keyboard works correctly with LinuxBIOSv3 (It has a wrong behavior with LinuxBIOSv2):<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4740Booting Windows using coreboot2007-07-10T00:40:12Z<p>Augusto: /* Building LinuxBIOS */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOSv3 ==<br />
Now it is time to build linuxBIOSv3.<br />
You should first download it:<br />
$ svn co svn://linuxbios.org/repository/LinuxBIOSv3<br />
$ cd LinuxBIOSv3/<br />
$ make menuconfig<br />
There are few options that should be enabled:<br />
Mainboard->Mainboard vendor->Emulated Systems <br />
Mainboard->Mainboard model->QEMU x86<br />
Payload->An ELF executable payload file<br />
Payload->Payload path and filename->Set the Path to ADLO's payload generated in the previous step<br />
Exit and when asked to generate a config file say yes. After, execute:<br />
$ make <br />
<br />
This creates a LinuxBIOS image named /build/bios.bin. Copy this file to a specific folder.<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also noticed a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4702Booting Windows using coreboot2007-06-29T17:54:58Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also noticed a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF781B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4701Booting Windows using coreboot2007-06-29T00:38:23Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also noticed a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
'''When using an image with no ACPI support I got a little farther in the boot process but a blue screen shows up with this message: *** STOP: 0x0000007B (0xF&81B84C,0xC0000034,0x00000000,0x00000000) INACCESSIBLE_BOOT_DEVICE'''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4700Booting Windows using coreboot2007-06-29T00:32:31Z<p>Augusto: /* Installing Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
<br />
Insert the installation CD, and install Windows 2000 in the QEMU image. During the installation process you can choose whether ACPI support is desired. This is done pressing F7 or F5 during the screen with the message "press F6 if you need to install a SCSI or RAID controller" on the bottom. F7 lets windows choose the most appropriate option. F5 shows all the available options so the user can choose. I am currently using a win2k image with no ACPI. <br />
<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4691Booting Windows using coreboot2007-06-21T19:03:07Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to ADLO's directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4672Booting Windows using coreboot2007-06-20T15:14:03Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After running ''make'', a file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4671Booting Windows using coreboot2007-06-20T15:12:29Z<p>Augusto: /* Project Overview */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
This project was accepted for the Google Summer Of Code 2007 and its main goal is 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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
I intend to describe in detailed all the steps taken up to now and some of the problems faced. My first goal is to repeat the stages to boot windows 2000 described in the paper entitled [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4670Booting Windows using coreboot2007-06-19T21:34:23Z<p>Augusto: /* Debugging using GDB */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch/ patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4669Booting Windows using coreboot2007-06-18T13:38:07Z<p>Augusto: /* Useful Links */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this patch [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with GDB]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4668Booting Windows using coreboot2007-06-17T23:52:03Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Recompile qemu with this patch [http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch] in order to disable timer interrupts.<br />
qemu-0.9.0$ patch -p0 <../qemu-20061108-debug-on-linux.patch <br />
qemu-0.9.0$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==<br />
<br />
* [http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html/ Debbuging with QEMU]<br />
* [http://www.hermann-uwe.de/blog/howto-install-windows-xp-in-debian-using-qemu/ QEMU Image]</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4667Booting Windows using coreboot2007-06-17T23:38:39Z<p>Augusto: /* Debugging using GDB */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Make sure Qemu was compiled using gcc's ''-g'' option<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''<br />
<br />
== Useful Links ==</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4666Booting Windows using coreboot2007-06-17T21:48:22Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set of emulated DOS interrupts. LinuxBIOS/ADLO, uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
== Debugging using GDB ==<br />
Make sure Qemu was compiled using gcc's ''-g'' option<br />
qemu-0.9.0/i386-softmmu$ gdb qemu<br />
(gdb) set args -L path/to/bios.bin -hda path/to/win2k.cow<br />
(gdb) break main<br />
(gdb) run<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4642Booting Windows using coreboot2007-06-11T13:45:10Z<p>Augusto: /* Building ADLO payload */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
$ make<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4619Booting Windows using coreboot2007-06-08T00:42:08Z<p>Augusto: /* Installing GRUB */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4616Booting Windows using coreboot2007-06-07T22:54:11Z<p>Augusto: /* Building QEMU */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar -xzvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4605Booting Windows using coreboot2007-06-07T13:56:15Z<p>Augusto: /* Building QEMU */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4604Booting Windows using coreboot2007-06-07T02:02:19Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
''While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.''<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4603Booting Windows using coreboot2007-06-07T02:00:38Z<p>Augusto: /* Building QEMU */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
If you need some bios debug messages from qemu add --extra-cflags="-DDEBUG_BIOS" to the configuration line below. <br />
Since LinuxBIOS already outputs debug messages without this option, turning it on will mess Qemu output error <br />
messages. It is useful for some situations though.<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4602Booting Windows using coreboot2007-06-07T01:51:50Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows (to enable QEMU bios debug messages check building Qemu section above). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4601Booting Windows using coreboot2007-06-07T01:46:27Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB.<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
While doing few tests, I found out the errors mentioned above are not responsible for boot failure since QEMU plus its original bios (bochs bios) also outputs them while booting windows ( to enable QEMU bios debug messages check [[Building Qemu]] ). Since QEMU is able to boot windows 2000 and windows XP I have been focusing on the bios it uses. Qemu uses a full bochs bios, which consists of some initialization code found in a file named rombios32.c and a set emulated DOS interrupts. LinuxBIOS/ADLO uses bochs bios partially, since all the initialization code is found in LinuxBIOS and ADLO code. Now we have to find out what is misssing in LinuxBIOS/ADLO initialization.<br />
<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4576Booting Windows using coreboot2007-05-30T16:08:40Z<p>Augusto: /* Booting Windows */</p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to interrupt calls<br />
from MBR code, in our case GRUB:<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
<br />
int13 function 41 -> (with BX = 55AAh) is a check for the "Installation of the INT 13 <br />
BIOS Extensions" in Memory. <br />
int13 function 08 -> Get Drive Parameters<br />
I have read few things in the STATUS file at ADLO's directory and it seems that LILO is fully supported.<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4544Booting Windows using coreboot2007-05-26T23:44:44Z<p>Augusto: </p>
<hr />
<div>{{Cc-by-sa-3.0}}<br />
=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the [http://tracker.linuxbios.org/trac/LinuxBIOS/browser/trunk/LinuxBIOSv2/util/ADLO/README README] file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated.<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to GRUB interrupt calls:<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
I have read few things in the STATUS file at ADLO's directory and it seems that LILO is fully supported.<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=GSoC&diff=4512GSoC2007-05-23T00:21:25Z<p>Augusto: /* Booting Windows and other Operating Systems in LinuxBIOS */</p>
<hr />
<div>= Google Summer of Code 2007 =<br />
<br />
Welcome to the [http://code.google.com/soc/ Google Summer of Code(tm)] page of the [[Welcome to LinuxBIOS|LinuxBIOS project]].<br />
<br />
= Projects =<br />
<br />
== Booting Windows and other Operating Systems in LinuxBIOS [http://linuxbios.org/Booting_Windows_using_LinuxBIOS]==<br />
<br />
The goal of this sub project is to figure out how to boot Windows Vista/XP/2003. There are three approaches that might proof successful:<br />
<br />
* using a dedicated LinuxBIOS loader (ie. adapting [http://www.reactos.org/ ReactOS] FREELDR)<br />
* booting Windows on top of Linux using [http://www.xmission.com/~ebiederm/files/kexec/README kexec]/[http://kboot.sourceforge.net/ kboot]<br />
* fixing [[ADLO]] so that it boots Vista/XP and removing the mainboard dependencies in it's code.<br />
* Some information on usage of bios services in Windows can be found [http://www.missl.cs.umd.edu/winint/index1.html here] and [http://www.missl.cs.umd.edu/winint/index2.html here].<br />
<br />
== Port GRUB2 to work in LinuxBIOS ==<br />
<br />
[[GRUB2]] is going to be _the_ bootloader of choice in the forseeable future. As such, it could replace both Grub legacy and FILO, the LinuxBIOS hack for grub compatibility. FILO lacks many features that come with GRUB2 with no extra effort.<br />
<br />
This task splits into four sub-problems:<br />
<br />
* Add a target i386-linuxbios, next to i386-pc and i386-efi to the configuration process<br />
* Add an IDE driver that does direct access instead of intXX calls<br />
* Make the build process generate a single static ELF image, like it is done on Sparc<br />
* Add support for reading the memory size from the LinuxBIOS table.<br />
<br />
== SCSI booting in LinuxBIOS ==<br />
<br />
Currently LinuxBIOS can not boot from an arbitrary SCSI controller. There are two solutions for the problem:<br />
* Use Linux and Kexec. This requires to keep the SCSI driver in the flash chip.<br />
* Use x86emu/vm86/[[ADLO]] and the int13 method. This would allow to use the PCI option rom available on all modern SCSI controllers.<br />
<br />
So we obviously need a solution based on the later. This could as well be implemented as a Linux program, as an intermediate payload, or as a shared library.<br />
<br />
The code you are going to write needs to catch the int13 interrupt vector that the SCSI option rom installs and make it available to arbitrary (firmware/payload) code trying to load something from disk. This<br />
<br />
This is a LinuxBIOSv3 project.<br />
<br />
== CMOS Config / Device Tree Browser Payload ==<br />
<br />
Unlike other BIOSes, Linux has no such thing as a "CMOS setup". This does not mean that you can not configure it. There is a nice and small Linux command line utility called [http://lxbios.sf.net lxbios] for that purpose. But people are often asking for a builtin config tool. Such a config tool could feature VGA graphics (maybe even VESA?), it should be easy to use, allow to browse information from LinuxBIOS' central structure: the device tree, and provide lxbios functionality with some sex appeal.<br />
<br />
This is a LinuxBIOSv3 project.<br />
<br />
== LinuxBIOS graphical port creator ==<br />
<br />
In LinuxBIOSv2, every port to a new mainboard requires that you touch a lot of source files with only minimal changes. In version 3 we try to fix this issue and pack all mainboard specific information into a configuration file that we call the Device Tree Source (DTS). <br />
This Device Tree config file is a simple text file describing what static (non-detectable and/or soldered on) devices are used on the mainbard and how they are wired (SPD-ROM, Interrupt Routing, SuperIO, Northbridge, Southbridge, Hypertransport,..). It is mostly organized as a tree (with some special cases, Hypertransport allows cycles for instance)<br />
<br />
The idea is to create a tool, based on the [www.eclipse.org/ Eclipse IDE], Swing, or your favourite portable toolkit, which allows you to drag and drop those components together and describe how they are wired. <br />
<br />
This would be a great help for mainboard vendors that build mainboards of already supported components. No more reading of LinuxBIOS code would be required, but rather only the understanding of the hardware, and probably the mainboard schematics.<br />
<br />
This is a LinuxBIOSv3 project. It requires good Java and/or Eclipse skills (or whatever toolkit/language you choose)<br />
<br />
== Open Firmware payload for LinuxBIOS ==<br />
<br />
Mitch Bradley from [http://www.firmworks.com/ Firmworks, Inc.] released the [http://www.openbios.org/OpenFirmware Open Firmware sources] under a BSD license. The released code does work in LinuxBIOS, but could use some proper integration and testing on some hardware or in [http://fabrice.bellard.free.fr/qemu/ Qemu]. <br />
<br />
Some ideas:<br />
<br />
* The released Open Firmware code is very much optimized towards the OLPC. A lot of things don't work yet on other systems, such as using a graphical framebuffer. Therefore things in LinuxBIOS need to be changed. For example, if LinuxBIOS initializes a graphics mode, it should add a LinuxBIOS table entry that specifies the address of the framebuffer and the depth and resolution.<br />
* Add words to view the LinuxBIOS table in OFW<br />
* Add words to change LinuxBIOS CMOS settings from OFW<br />
* For LinuxBIOSv3, the start address of the payload can be variable. This is a fundamental change to v2, and will make life a lot easier and LinuxBIOS a lot more flexible. OFW requires to know its in-rom address at build time. This needs to be fixed to a dynamic behavior<br />
* Also, there's no good documentation on what features can be used and how they can be used. Like the graphical OLPC menu, the built-in web server.<br />
* Get a STOP-A like behavior working in Linux<br />
* Get Smart Firmware working with new compilers<br />
* Get Smart Firmware working as a payload<br />
* Enhance the [[Distributed and Automated Testsystem]] to work with FILO and OpenFirmware payloads, and add The Hayes ANS Forth testsuite.<br />
<br />
Some parts might require cooperation with other GSoC projects:<br />
<br />
* Boot from Non-OFW SCSI controllers by running their int13 handler<br />
* Boot Windows XP/2003/Vista in OFW<br />
<br />
This project might benefit from Forth skills.<br />
<br />
== GNUFI or TianoCore payloads ==<br />
<br />
There are two open source EFI implementations out there. [http://gnufi.blogspot.com/ GNUFI] (or [http://www.hermann-uwe.de/blog/gnufi-the-gnu-firmware-implementation here] or [http://www.gnu.org/software/gnufi/ here]) and [http://www.tianocore.org/ TianoCore]. Try getting those to work as LinuxBIOS payloads, or change LinuxBIOS so it can load them as payloads.<br />
<br />
This project requires no hardware skills, but especially in case of TianoCore might require knowledge of Windows compilers (VC2005?)<br />
<br />
== Boot OpenSolaris, FreeBSD, NetBSD, OpenBSD or other free OSes ==<br />
<br />
LinuxBIOS has (despite its name) been a little Linux centric. A nice project would be to analyze what it takes to get OpenSolaris, the BSDs or other free operating systems to work in LinuxBIOS, without the need for legacy emulation (ie. no [[ADLO]])<br />
<br />
== Improve Linux as a BIOS ==<br />
<br />
There's a small project called [http://www.linuxbios.org/viewvc/?root=buildrom buildrom] which creates a payload from a Linux kernel and some user space utilities. It has been written to work with the OLPC. This project could be enhanced to work on all supported LinuxBIOS motherboards.<br />
<br />
= Your own Projects =<br />
<br />
We've listed some ideas for projects here, but we're more than happy to entertain other ideas if you've got any.<br />
Feel free to contact us under the address below, and don't hesitate to suggest whatever you have in mind.<br />
<br />
= Summer of Code 2007 Application =<br />
<br />
Please complete the standard [http://code.google.com/soc/ Google SoC 2007 application]. Additionally, please provide information on the following:<br />
<br />
# Who are you? What are you studying?<br />
# Why are you the right person for this task?<br />
# Do you have any other commitments that we should know about?<br />
# List your C, Assembler or Java experience. (Depending on the project)<br />
# List your history with open source projects.<br />
# What is your preferred method of contact? (Phone, email, Skype, etc) <br />
<br />
Feel free to keep your application short. A 15 page essay is no better than a 2 page summary. If you wish to write 15 pages, you are of course welcome to do so, and we will gladly put your paper up on the web page. But it is not required for the application.<br />
<br />
The Drupal project has a great page on [http://drupal.org/node/59037 How to write an SOC application].<br />
<br />
'''DEADLINE FOR STUDENT APPLICATIONS:''' Students who are interested in working on a LinuxBIOS-related GSoC project must apply until <strike>'''March 24, 2007'''</strike> [http://groups.google.com/group/google-summer-of-code-announce/browse_thread/thread/72f227109321bba5 Monday, March 27, 2007]!<br />
<br />
= Contact =<br />
<br />
If you are interested in becoming a GSoC student, please contact [mailto:stepan@coresystems.de Stefan Reinauer].<br />
<br />
There is also an IRC channel on irc.freenode.net: #LinuxBIOS (actually a forwarder to #OpenBIOS because it is the same folks hanging out there.)</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4495Booting Windows using coreboot2007-05-20T17:36:39Z<p>Augusto: /* Project Overview */</p>
<hr />
<div>=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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 [http://www.linuxbios.org/ADLO/ ADLO], it has been chosen in this phase of understanding better the problem.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the README file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated. <br />
<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to GRUB interrupt calls:<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
I have read few things in the STATUS file at ADLO's directory and it seems that LILO is fully supported.<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=Booting_Windows_using_coreboot&diff=4485Booting Windows using coreboot2007-05-20T00:12:02Z<p>Augusto: </p>
<hr />
<div>=== Why Windows? ===<br />
<br />
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.<br />
<br />
=== Project Overview ===<br />
<br />
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.<br />
<br />
Instead of a real hardware, [http://qemu.org/ QEMU] emulator will be used since it is easily available for anyone who wishes to contribute.<br />
<br />
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 [http://www.usenix.org/events/usenix03/tech/freenix03/agnew/agnew_html/index.html/ Flexibility in ROM: A Stackable Open Source BIOS]. After that, we will focus on windows XP and Vista that require a more complicated support.<br />
<br />
Any suggestion is welcome, please use the [[Mailinglist|LinuxBIOS mailing list]] or email [mailto:augusto.pedroza@gmail.com Augusto Pedroza].<br />
<br />
=== Requirements === <br />
<br />
The following software packages are needed:<br />
<br />
* [[Download_LinuxBIOS|LinuxBIOSv2]] <br />
* [http://qemu.org/ QEMU] 0.9.0 or greater<br />
* [http://www.cix.co.uk/~mayday/ as86] 80x86 assembler<br />
<br />
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.<br />
<br />
<br />
== Installing Qemu ==<br />
<br />
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.<br />
<br />
==== Building gcc 3.x ====<br />
$ wget ftp://ftp.mirrorservice.org/sites/sources.redhat.com/pub/gcc/releases/gcc-3.4.6/gcc-3.4.6.tar.gz<br />
$ tar zxvf gcc-3.4.6.tar.gz<br />
$ cd gcc-3.4.6/<br />
$ ./configure --prefix=/opt/gcc34 <br />
$ make bootstrap<br />
$ make install (as root)<br />
<br />
==== Building QEMU ====<br />
Download QEMU source code (I used qemu-0.9.0.tar.gz) and extract it.<br />
$ tar zxvf qemu-0.9.0.tar.gz<br />
$ cd qemu-0.9.0/<br />
<br />
Configure and make QEMU (use the --cc option if your default gcc is newer than version 3.4):<br />
$ ./configure --cc=/opt/gcc34/bin/gcc --target-list=i386-softmmu && make<br />
$ make install<br />
<br />
The QEMU binary is stored in the i386-softmmu directory.<br />
<br />
<br />
== Creating an Appropriate Disk Image ==<br />
=== Installing Windows ===<br />
There are few options to create an image, I chose to use the qemu-img tool.<br />
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.<br />
$ qemu-img create -f qcow /path/to/win2k.cow 2000M<br />
Insert the installation CD, and install Windows 2000 in the QEMU image:<br />
$ qemu -hda /path/to/win2k.cow -boot d -cdrom /dev/cdrom -m 384 -localtime<br />
You can test the image running the following:<br />
$ qemu -hda /path/to/xp.cow <br />
<br />
=== Installing GRUB ===<br />
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.<br />
<br />
<br />
== Building ADLO payload ==<br />
First, download LinuxBIOSv2 source code.<br />
$ svn co svn://linuxbios.org/repos/trunk/LinuxBIOSv2 <br />
Go to the ADLO directory:<br />
$ cd LinuxBIOSv2/util/ADLO<br />
Check the README file to see some information about installing as86 + patch in order to compile bochs' bios. You can also get a [http://www.cix.co.uk/~mayday/ prepatched version] of as86. I downloaded the newest version and patched it.<br />
After that just type ''make'' at ADLO's main directory. A file named ''payload'' will be generated. <br />
<br />
<br />
== Building LinuxBIOS ==<br />
Now it is time to build linuxBIOS.<br />
$ cd LinuxBIOSv2/targets/emulation/qemu-i386<br />
You should edit the Config.lb file, where it says payload put the path of the file generated by ADLO. It should look like this:<br />
* payload path/to/adlo/payload<br />
Return to targets directory and execute: <br />
$ ./buildtarget emulation/qemu-i386 <br />
Go to targets/emulation/qemu-i386/qemu-i386 and execute: <br />
$ make <br />
<br />
This creates the LinuxBIOS image (qemu-bios.rom). Copy this file to a specific folder and rename it to bios.bin.<br />
<br />
<br />
== Booting Windows ==<br />
<br />
Before trying to run everything together, we should copy a file named ''vgabios-cirrus.bin'' to the same folder where the ''bios.bin'' file is. This file can be found in the qemu directory at ''qemu-0.9.0/pc-bios''.<br />
Let's try to boot everything. Just execute this:<br />
$ qemu -L path/to/bios.bin -hda win2k.cow -serial stdio<br />
The ''-L'' option allows us to inform the path for BIOS, VGA BIOS and keymaps.<br />
<br />
Unfortunately it hangs as soon as the progress bar finishes. I get the following errors due to GRUB interrupt calls:<br />
int13_harddisk: function 41, unmapped device for ELDL=81<br />
int13_harddisk: function 08, unmapped device for ELDL=81<br />
*** int 15h function AX=00C0, BX=0000 not yet supported!<br />
*** int 15h function AX=5300, BX=0000 not yet supported!<br />
I have read few things in the STATUS file at ADLO's directory and it seems that LILO is fully supported.<br />
<br />
I also notice a problem with the keyboard even one I set the keymaps in qemu with the ''-k'' option:<br />
<br />
KBD: int09h_handler(): unknown scancode read: 0x72!<br />
KBD: int09h_handler(): unknown scancode read: 0x75!<br />
KBD: int09h_handler(): unknown scancode read: 0x74!<br />
<br />
'''These are some of my results. Now, I am trying to determine the specific point where windows 2000 hangs and appreciate any help. Hope we can boot windows 2000/XP/Vista very soon.'''</div>Augustohttps://www.coreboot.org/index.php?title=User:Augusto&diff=4484User:Augusto2007-05-19T22:44:34Z<p>Augusto: </p>
<hr />
<div>== Augusto Pedroza ==<br />
<br />
[[Image:Augusto.jpg|80px|]]<br />
<br />
I am currently a participant of the Google Summer of Code 2007. My main responsibility is to implement a stable way of booting windows XP/Vista on LinuxBIOS. It has been a very exciting journey since the beginning. Any help is very welcome, thanks!!<br />
<br />
==== Areas of Interest ====<br />
* Operating Systems<br />
* Real-Time Operating Systems<br />
* Device Drivers<br />
* Open/Free Development<br />
* A Good Hacking!!!<br />
<br />
==== Current Projects ====<br />
* LinuxBIOS [http://linuxbios.org]<br />
* One Laptop per Child [http://www.laptop.org]</div>Augusto