diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-07-03 12:45:32 -0500 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-08-09 22:24:02 +0800 |
commit | 00f237e226bc8a6ecf168ca0d2e1853f203f17d1 (patch) | |
tree | 52e6e8ccb99785049bb792d422762f8885736210 /doc/board/emulation | |
parent | 42ef7079224abc7c6073c0bab63f3aa6fffd5d00 (diff) | |
download | u-boot-00f237e226bc8a6ecf168ca0d2e1853f203f17d1.zip u-boot-00f237e226bc8a6ecf168ca0d2e1853f203f17d1.tar.gz u-boot-00f237e226bc8a6ecf168ca0d2e1853f203f17d1.tar.bz2 |
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/board/emulation')
-rw-r--r-- | doc/board/emulation/qemu-x86.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu-x86.rst index c2e704a..db842f2 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 |