Preparing QEMU, compiling the operating environment of ARM
- $ wget http://wiki.qemu-project.org/download/qemu-2.0.0.tar.bz2
- $ tar xzvf qemu-2.0.0.tar.bz2
- $ mkdir./qemu-2.0.0/bin
- $ CD./qemu-2.0.0/bin/
- $ .. /configure--target-list=arm-softmmu
- $ make
(System mode, which simulates the entire hardware, the user mode is only to emulate the ARM CPU, SYS call is converted to the host linux-x86)
To prepare build root, build root automatically downloads the kernel required for file compilation, Rootfs
- $ wget http://buildroot.uclibc.org/downloads/buildroot-2014.05.tar.bz2
- $ tar xjvf buildroot-2014.05.tar.bz2
- $ CD buildroot-2014.05/
- $ make Qemu_arm_vexpress_defconfig
- $ make Menuconfig
Toolchain-C library, Eglibctoolchain, Enable C + + supportSystem configuration--Root Filesyste M overlay directories, <path to your alien rootfs dir, e.g./home/payne/qemu/rootfs_my/>target packages How packages is also provided by Busyboxtarget packages debugging, profiling and benchmark, gdb-ful L Debuggertarget Packages, Networking applications, Dhcpcdtarget packages, Shell and utilities, BASHFI Lesystem images, cpio the root filesystemfilesystem images, tar the root filesystem
- $ Export br2_jlevel=4
- $ make Linux-menuconfig
Device Drivers (*) Staging Drivers-(*) Android-(*) Android Binder IPC Driverfile Systems--(*) FUSE (Filesystem in userspace) support
- $ make
You can specify your own rootfs, put the target arm executable file in this directory/home/payne/qemu/rootfs_my/, run Qemu-arm, you can execute in the shell
running QEMU, the zimage and Rootfs used are all generated in BuildRoot
- $./qemu-2.0.0/bin/system/arm-softmmu/qemu-system-arm-m vexpress-a9-m 1g-kernel./buildroot-2014.05/output/images/ Zimage-drive file=./buildroot-2014.05/output/images/rootfs.ext2,if=sd-append "console=ttyAMA0,115200 root=/dev/ Mmcblk0 "-serial stdio-net nic,model=lan9118-net user-redir tcp:5900::5900
- Input "Root" when you see the login prompt
- # DHCPCD
- #
It's worth noting that QEMU does not automatically netwrok to run DHCPCD get IP (more Android, 10.0.2.15 is itself, 10.0.2.2 is host ), you can access the external Internet in QEMU, but external access internally requires port forwarding-redir tcp:5900: : 5900, that is, the guest OS 5900 and the host OS 5900 map, so that access to host OS 5900 is to access the guest OS 5900