summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-07-03 20:45:32 +0300
committerBin Meng <bmeng.cn@gmail.com>2019-08-09 17:24:02 +0300
commit00f237e226bc8a6ecf168ca0d2e1853f203f17d1 (patch)
tree52e6e8ccb99785049bb792d422762f8885736210 /doc
parent42ef7079224abc7c6073c0bab63f3aa6fffd5d00 (diff)
downloadu-boot-00f237e226bc8a6ecf168ca0d2e1853f203f17d1.tar.xz
qemu-x86: Use config_distro_bootcmd
Converts qemu x86 machines to boot using distro_config. The intent is to allow u-boot in qemu to be maximally compatible with many boot methods without having to change the config. Previously, u-boot would only boot in a very limited set of circumstances where there was a /boot/vmlinuz on scsi 0:3 with no ramdisk. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: convert doc updates to reST] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/board/emulation/qemu-x86.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu-x86.rst
index c2e704afb2..db842f2ece 100644
--- a/doc/board/emulation/qemu-x86.rst
+++ b/doc/board/emulation/qemu-x86.rst
@@ -54,6 +54,23 @@ If you want to check both consoles, use '-serial stdio'.
Multicore is also supported by QEMU via '-smp n' where n is the number of cores
to instantiate. Note, the maximum supported CPU number in QEMU is 255.
+U-Boot uses 'distro_bootcmd' by default when booting on x86 QEMU. This tries to
+load a boot script, kernel, and ramdisk from several different interfaces. For
+the default boot order, see 'qemu-x86.h'. For more information, see
+'README.distro'. Most Linux distros can be booted by writing a uboot script.
+For example, Debian (stretch) can be booted by creating a script file named
+'boot.txt' with the contents::
+
+ setenv bootargs root=/dev/sda1 ro
+ load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} /vmlinuz
+ load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} /initrd.img
+ zboot ${kernel_addr_r} - ${ramdisk_addr_r} ${filesize}
+
+Then compile and install it with::
+
+ $ apt install u-boot-tools && \
+ mkimage -T script -C none -n "Boot script" -d boot.txt /boot/boot.scr
+
The fw_cfg interface in QEMU also provides information about kernel data,
initrd, command-line arguments and more. U-Boot supports directly accessing
these informtion from fw_cfg interface, which saves the time of loading them