mirror of
				https://gitlab.com/qemu-project/qboot.git
				synced 2024-02-13 08:33:40 +08:00 
			
		
		
		
	
			
				
					
						
					
					master
				
			
			
		
	 Jason A. Donenfeld
		
	
	8ca302e86d
	
	
	Place setup_data at location specified by host
			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>
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
				
					Languages
				
				
								
								
									C
								
								86.9%
							
						
							
								
								
									C++
								
								8.1%
							
						
							
								
								
									Assembly
								
								3.6%
							
						
							
								
								
									Meson
								
								1.4%