How to Use QEMU to simulate Raspberry Pi

Source: Internet
Author: User
Tags symlink arch linux

How to Use QEMU to simulate Raspberry Pi

The following describes how to use QEMU to simulate Raspberry Pi. After using this method, the system can be tested without a Development Board.

Development Environment

The Host OS environment used for testing is Debian 7.2 Wheezy amd64.

Guest OS is the Debian Raspbian () after the Raspberry Pi is optimized ).

Append: Debian 8 jessie amd64, QEMU 2.0.0, and Raspbian () confirmed the action in the same step.

Install QEMU

Install QEMU first.

Sudo aptitude install qemu

Run the following command to check whether the required CPU is supported. If arm1176 is displayed, OK.

If arm1176 is not expressed, re-compile QEMU, or find another Binary.

Qemu-system-arm-cpu '? '| Grep arm1176

Image download

Create a suitable directory, download the Raspbian image from the http://www.raspberrypi.org/downloads and expand.

Download kernel image files from http://xecdesign.com/downloads/linux-qemu/kernel-qemu in the same directory.

Start for the first time

Run the following command to start qemu for the first time.

Qemu-system-arm-kernel-qemu-cpu arm1176-m 256-M versatilepb-no-reboot-serial stdio-append "root =/dev/sda2 panic = 1 rootfstype = ext4 rw init =/bin/bash "-hda 2013-09-25-wheezy-raspbian.img

Encoding set/etc/ld. so. preload.

Nano/etc/ld. so. preload

Comment out the first line, save it, and close the file, as shown below.

#/Usr/lib/arm-linux-gnueabihf/libcofi_rpi.so

The following steps are optional. The disk on the QEMU simulator is regarded as/dev/sda, but the corresponding symbolic link must be set as/dev/mmcblk0 on the instance.

Create/etc/udev/rules. d/90-qemu.rules and append the following records.

/Etc/udev/rules. d/90-qemu.rules

KERNEL = "sda", SYMLINK + = "mmcblk0"

KERNEL = "sda? ", SYMLINK + =" mmcblk0p % n"

KERNEL = "sda2", SYMLINK + = "root"

End.

Exit

Start

Start the following command.

Qemu-system-arm-kernel-qemu-cpu arm1176-m 256-M versatilepb-no-reboot-serial stdio-append "root =/dev/sda2 panic = 1 rootfstype = ext4 rw "-hda 2013-09-25-wheezy-raspbian.img

Use Username: pi, password: raspberry to log on, so that you can start X.

About options

The options for QEMU startup are described.

-Kernel-qemu

Use the downloaded kernel image kernel-qemu.

-Cpu arm1176

Simulation ARM1176 CPU. Raspberry Pi board is equipped with Broadcom BCM2835, This processor uses ARM1176JZ-F.

-M 256

The RAM size is 256 MB. the disk cannot be started if it is set to a value larger than MB.

-M versatilepb

Set the simulated development Board type. versatilepb is ARM Versatile Platform Board

-No-reboot

Exit without restarting.

-Serial stdio

Redirects the serial port of Guest to the standard input and output of the Host.

-Append "root =/dev/sda2 panic = 1 rootfstype = ext4 rw"

The command line of the kernel.

-Hda 2013-09-25-wheezy-raspbian.img

Harddisk 0 uses 2013-09-25-wheezy-raspbian.img.

Others

If that image is used, the disk space is relatively small, and the disk size can be expanded as needed. for more information, see Raspberry Pi.

Reference

QEMU-Emulating Raspberry Pi the easy way (Linux or Windows !) Http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way)

  • Http://ja.broadcom.com/products/BCM2835 (BCM2835)

Install Weston on Raspberry Pi

Linux OS for Raspberry Pi is available

Raspberry Pi (Raspberry Pi) trial note

Introduction to Raspberry Pi (Raspberry Pi) installation, IP configuration, and software source

Ubuntu 12.04 cannot find the Qemu command

Install QEMU + efi bios on Arch Linux

QEMU translation framework and debugging tools

QEMU details: click here
QEMU: click here

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.