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
2018-12-28 14:31:29 +01:00
2019-07-24 10:21:46 +02:00
2019-12-13 15:40:03 +01:00
2019-07-24 11:00:15 +02:00
2016-09-06 16:19:54 +02:00
2019-07-24 16:55:26 +02:00
2015-05-21 11:44:57 +02:00
2019-11-18 15:52:42 +01:00
2019-12-18 11:03:26 +01:00
2019-07-24 16:55:26 +02:00
2019-12-18 11:03:26 +01:00
2019-07-24 12:18:35 +02:00
2019-12-14 08:55:42 +01:00
2019-12-18 11:03:26 +01:00
2019-11-18 15:52:42 +01:00
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
Description
No description provided
Readme 165 KiB
Languages
C 86.9%
C++ 8.1%
Assembly 3.6%
Meson 1.4%