No description
Find a file
Jason A. Donenfeld 8ca302e86d Place setup_data at location specified by host
QEMU places setup_data at a particular location, which cannot be
relocated due to it containing self references in absolute address
terms. For this reason, it supplies the intended location in
FW_CFG_SETUP_ADDR.  That is what is used in the option ROMs provided
by QEMU, use this too in qboot.

This also has the effect of removing the 8k limit on the copied size,
since the header is copied to the right location from the beginning.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Message-Id: <20220916133603.693135-1-Jason@zx2c4.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-09-19 15:35:50 +02:00
include Place setup_data at location specified by host 2022-09-19 15:35:50 +02:00
benchmark.h pvh: add benchmark exit point 2018-12-28 14:31:29 +01:00
code16.c clear CF on entry to BIOS handlers 2019-07-24 10:21:46 +02:00
code32seg.c Add meson build 2019-12-13 15:40:03 +01:00
cstart.S do not mix tabs and spaces in a single file 2019-07-24 12:14:56 +02:00
entry.S implement PCIBIOS specification 2019-07-24 11:00:15 +02:00
flat.lds copy only ~11K down to low memory 2016-09-06 16:19:54 +02:00
fw_cfg.c Place setup_data at location specified by host 2022-09-19 15:35:50 +02:00
hwsetup.c support machines without PCI 2019-07-24 16:55:26 +02:00
LICENSE Initial commit 2015-05-21 11:44:57 +02:00
linuxboot.c Place setup_data at location specified by host 2022-09-19 15:35:50 +02:00
main.c support smbios 2019-11-18 15:52:42 +01:00
malloc.c limit C headers to freestanding ones 2019-12-18 11:03:26 +01:00
meson.build qboot: Disable PIE for ELF binary build step 2020-05-22 09:51:42 +02:00
mptable.c implement mptable generation 2019-07-24 16:55:26 +02:00
pci.c limit C headers to freestanding ones 2019-12-18 11:03:26 +01:00
printf.c clean up printf 2019-07-24 12:18:35 +02:00
README Update README 2019-12-14 08:55:42 +01:00
smbios.c limit C headers to freestanding ones 2019-12-18 11:03:26 +01:00
string.c support smbios 2019-11-18 15:52:42 +01:00
tables.c support smbios 2019-11-18 15:52:42 +01:00

A simple x86 firmware that can boot Linux.

Most of QEMU's startup time is spent:

* in the dynamic linker.  This can be reduced by 150 ms simply by
  compiling a stripped down QEMU:

    ./configure --disable-libssh2 --disable-tcmalloc --disable-glusterfs \
        --disable-seccomp --disable-{bzip2,snappy,lzo} --disable-usb-redir \
        --disable-libusb --disable-smartcard-nss --disable-libnfs  \
        --disable-libiscsi --disable-rbd  --disable-spice --disable-attr \
        --disable-cap-ng --disable-linux-aio --disable-brlapi \
        --disable-vnc-{jpeg,tls,sasl,png,ws} --disable-rdma --disable-bluez \
        --disable-fdt --disable-curl --disable-curses --disable-sdl \
        --disable-gtk  --disable-tpm --disable-vte --disable-vnc  \
        --disable-xen --disable-opengl --target-list=x86_64-softmmu

* in the BIOS.  qboot saves another 150 ms.

* until QEMU 2.7+, in fw_cfg.  qboot uses the DMA interface which is pretty
  much instantaneous.

Compile qboot
=============

Clone the source:

    $ git clone https://github.com/bonzini/qboot.git

Compile the qboot firmware (you may need to install the relevant build
time dependancies):

    $ meson build && ninja -C build

The result will be a 64K file named bios.bin under the build/ directory.

Usage
=====

    $ qemu-kvm -bios bios.bin \
      -kernel /boot/vmlinuz-4.0.3-300.fc22.x86_64 \
      -serial mon:stdio -append 'console=ttyS0,115200,8n1'

TODO
====

* Add the possibility to configure out PIC and PCI bridge initialization