使用Qemu模拟Cortex-A9运行U-boot和Linux
使用Qemu模拟Cortex-A9运行U-boot和Linux
开发环境: Ubuntu 12.04 所有软件包为最新1. 安装GNU工具链
- sudo apt-get insatll gcc-arm-linux-gnueabi
- sudo apt-get insatll g++-arm-linux-gnueabi
- arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
- Copyright (C) 2011 Free Software Foundation, Inc.
- sudo apt-get install qemu qemu-system qemu-utils
- qemu-system-arm --version
- QEMU emulator version 1.0.50 (Debian 1.0.50-2012.03-0ubuntu2), Copyright (c) 2003-2008 Fabrice Bellard
3. 编译和运行U-boot: 到 ftp://ftp.denx.de/pub/u-boot/ 下载最新版本的U-Boot源代码, 我用的目前最新版本 u-boot-2012.04.tar.bz2 解压后进入源代码目录,在Makefile里面增加两行:
- ARCH ?= arm
- CROSS_COMPILE ?= arm-linux-gnueabi-
- make ca9x4_ct_vxp_config
- make
编译完成后会生成u-boot文件 运行:
- qemu-system-arm -M vexpress-a9 -m 256M -nographic -kernel u-boot
- qemu-system-arm -M vexpress-a9 -m 256M -serial stdio -kernel u-boot
参数-m 256M为指定内存大小。-M 指定板卡的名称, 支持的板卡可以用-M ?查看, 如下:
- #qemu-system-arm -M ?
- Supported machines are:
- beagle Beagle board (OMAP3530)
- beaglexm Beagle board XM (OMAP3630)
- ............
- versatilepb ARM Versatile/PB (ARM926EJ-S)
- versatileab ARM Versatile/AB (ARM926EJ-S)
- vexpress-a9 ARM Versatile Express for Cortex-A9
- vexpress-a15 ARM Versatile Express for Cortex-A15
- qemu-system-arm -M vexpress-a9 -m 256M -nographic -kernel u-boot
- U-Boot 2012.04 (Jul 08 2012 - 00:14:08)
- DRAM: 256 MiB
- WARNING: Caches not enabled
- Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
- ## Unknown flash on Bank 2 - Size = 0x00000000 = 0 MB
- *** failed ***
- MMC: MMC: 0
- *** Warning - bad CRC, using default environment
- In: serial
- Out: serial
- Err: serial
- Net: smc911x-0
- Hit any key to stop autoboot: 0
- VExpress#
- VExpress# printenv
- baudrate=38400
- bootcmd=run bootflash;
- bootdelay=2
- bootflash=run flashargs; cp ${ramdisk_addr} ${ramdisk_addr_r} ${maxramdisk}; bootm ${kernel_addr} ${ramdisk_addr_r}
- console=ttyAMA0,38400n8
- 。。。。。
|
评论暂时关闭