Qemu emulates ARM transplant UBOOT

Qemu emulates ARM transplant UBOOT

System: Ubuntu16.04.4 32bit
Cross Compiler: arm-linux-gnueabihf-gcc
VMware: VMware Workstation 14 Pro
u-boot: u-boot-2018.03

1. UBOOT download

Download address: http://ftp.denx.de/pub/u-boot/
Here first create a new working directory

mkdir ~/qemu

Download the uboot source code, the uboot2018.03 version is selected here

#进入刚新建的工作目录
cd ~/qemu
#使用wget下载源码
sudo wget http://ftp.denx.de/pub/u-boot/u-boot-2018.03.tar.bz2

2. Unzip the UBOOT source code

tar xvf u-boot-2018.03.tar.bz2

3. Configure the source code

This article simulates the vexpress-a9 development board

cd u-boot-2018.03/

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vexpress_ca9x4_defconfig

The following is for ubuntu17 64 bit

If the make tool is not installed in the system, install it according to the prompts

sudo apt-get install make

If you get the following error, you need to install gcc
write picture description here

sudo apt-get install gcc

You can gcc -vcheck if gcc is installed by
write picture description here

After installing the gcc tool, run the above configuration command again
write picture description here

5. Compile UBOOT

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4

6. Use QEMU to test UBOOT

# -nographic不带qemu GUI界面
qemu-system-arm -M vexpress-a9 -m 256 -nographic -kernel u-boot 

7. QEMU exit method

The first :
in the absence of a graphical interface, you can use Ctrl+A and then press X to exit, or you can use the following command to exit completely

Second :
run the following command in another terminal to kill the QEMU process
ps -A | grep qemu-system-arm | awk '{print $1}' | xargs sudo kill -9

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325438689&siteId=291194637