如何在Ubuntu中利用Qemu运行BeagleBoard firmware

1. 准备工作

    (1). 安装 Linaro qEmu:
        -----------------------
       cd $(WORKROOT)
       git clone git://git.linaro.org/qemu/qemu-linaro.git
       cd $(WORKROOT)/qemu-linaro
       ./configure --target-list=arm-softmmu,arm-linux-user,armeb-linux-user
        make

     (2). Installing Linaro image Creator:(一定要用0.4.8版本,否则会有一些错误)
             --------------------------------
           wget http://launchpad.net/linaro-image-tools/trunk/0.4.8/+download/linaro-image-tools-0.4.8.tar.gz
           tar xzf linaro-image-tools-0.4.8.tar.gz
           cd $(WORKROOT)/linaro-image-tools-0.4.8/
          sudo apt-get install parted dosfstools uboot-mkimage python-argparse python-dbus python-debian python-parted

                      qemu-arm-static btrfs-tools command-not-found

      (3). 创建 "u-boot + Linux Linaro image"
              -------------------------------------
        mkdir $(WORKROOT)/beagle_image && cd $(WORKROOT)/beagle_image
        wget http://releases.linaro.org/platform/linaro-m/hwpacks/final/hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz
        wget http://releases.linaro.org/platform/linaro-m/headless/release-candidate/linaro-m-headless-tar-20101101-0.tar.gz
        sudo $(WORKROOT)/linaro-image-tools-0.4.8/linaro-media-create --image_file beagle_sd.img --dev beagle --binary

                 linaro-m-headless-tar-20101101-0.tar.gz --hwpack hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz

        sudo chmod a+rw beagle_sd.img

2. 使用Qemu测试" u-boot + Linux Linaro image"
      -----------------------------------------
    $qemu-system-arm -M beagle -sd $(WORKROOT)/beagle_image/beagle_sd.img -serial stdio -clock unix

3. 测试UEFI Beagle code

    (1) replace u-boot.bin

           mkdir /tmp/beagle_boot

           sudo mount -o loop,offset=$[63*512] $(WORKROOT)/beagle_image/beagle_sd.img /tmp/beagle_boot

         sudo cp $(WORKROOT)/edk2/Build/BeagleBoard/RELEASE_ARMGCC/FV/BEAGLEBOARD_EFI.fd /tmp/beagle_boot/u-boot.bin

           sudo umount /tmp/beagle_boot
    (2) 往SD中添加zImage

          tar xzf hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz

          cd pkgs/

          dpkg -x linux-image-2.6.35-1008-linaro-omap_2.6.35-1008.15_armel.deb .

          sudo mount -o loop,offset=$[63*512] $(WORKROOT)/beagle_image/beagle_sd.img /tmp/beagle_boot

          sudo cp boot/vmlinuz-2.6.35-1008-linaro-omap /tmp/beagle_boot/zImage

     (3) 修改cmdline参数

       console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw earlyprintk fixrtc nocompcache

                     vram=12M omapfb.mode=dvi:1280x720MR-16@60

      (4) 运行qemu

          qemu-system-arm -M beagle -serial stdio -sd beagle_sd.img

你可能感兴趣的:(如何在Ubuntu中利用Qemu运行BeagleBoard firmware)