安卓 qemu 运行linux,Qemu运行linux 4.9

news/2025/1/29 6:33:39/

1、git clone最新的Qemu代码到本地:

ubuntu@ubuntu-X556UB:~/Qemu$ git clone git://git.qemu-project.org/qemu.git

正克隆到 'qemu'...

remote: Counting objects: 302770, done.

remote: Compressing objects: 100% (56838/56838), done.

remote: Total 302770 (delta 245135), reused 302770 (delta 245135)

接收对象中: 100% (302770/302770), 98.29 MiB | 74.00 KiB/s, 完成.

处理 delta 中: 100% (245135/245135), 完成.

检查连接... 完成。

正在检出文件: 100% (5068/5068), 完成.

2、配置Qemu

ubuntu@ubuntu-X556UB:~/Qemu/qemu$ ./configure --target-list=arm-softmmu --audio-drv-list=

ERROR: DTC (libfdt) version >= 1.4.0 not present. Your options:

(1) Preferred: Install the DTC (libfdt) devel package

(2) Fetch the DTC submodule, using:

git submodule update --init dtc

ubuntu@ubuntu-X556UB:~/Qemu/qemu$ git submodule update --init dtc

子模组 'dtc' (git://git.qemu-project.org/dtc.git) 未对路径 'dtc' 注册

正克隆到 'dtc'...

remote: Counting objects: 3521, done.

remote: Compressing objects: 100% (2076/2076), done.

remote: Total 3521 (delta 2600), reused 1937 (delta 1409)

接收对象中: 100% (3521/3521), 800.99 KiB | 495.00 KiB/s, 完成.

处理 delta 中: 100% (2600/2600), 完成.

检查连接... 完成。

子模组路径 'dtc':检出 '65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf'

64位ARM配置

ubuntu@ubuntu-X556UB:~/Qemu/qemu$./configure --target-list=aarch64-softmmu --audio-drv-list=

ubuntu@ubuntu-X556UB:~/Qemu/qemu$./configure --target-list=arm-softmmu --audio-drv-list=

Install prefix    /usr/local

BIOS directory    /usr/local/share/qemu

binary directory  /usr/local/bin

library directory /usr/local/lib

module directory  /usr/local/lib/qemu

libexec directory /usr/local/libexec

include directory /usr/local/include

config directory  /usr/local/etc

local state directory   /usr/local/var

Manual directory  /usr/local/share/man

ELF interp prefix /usr/gnemul/qemu-%M

Source path       /home/ubuntu/Qemu/qemu

C compiler        cc

Host C compiler   cc

C++ compiler      c++

Objective-C compiler cc

ARFLAGS           rv

CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g

QEMU_CFLAGS       -I/usr/include/pixman-1 -I$(SRC_PATH)/dtc/libfdt -Werror -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong  -I/usr/include/libpng12

LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g

make              make

install           install

python            python -B

smbd              /usr/sbin/smbd

module support    no

host CPU          x86_64

host big endian   no

target list       arm-softmmu

tcg debug enabled no

gprof enabled     no

sparse enabled    no

strip binaries    yes

profiler          no

static build      no

pixman            system

SDL support       no

GTK support       yes (2.24.30)

GTK GL support    no

VTE support       no

TLS priority      NORMAL

GNUTLS support    no

GNUTLS rnd        no

libgcrypt         no

libgcrypt kdf     no

nettle            no

nettle kdf        no

libtasn1          no

curses support    no

virgl support     no

curl support      no

mingw32 support   no

Audio drivers

Block whitelist (rw)

Block whitelist (ro)

VirtFS support    yes

VNC support       yes

VNC SASL support  no

VNC JPEG support  yes

VNC PNG support   yes

xen support       no

brlapi support    no

bluez  support    no

Documentation     yes

PIE               yes

vde support       no

netmap support    no

Linux AIO support no

ATTR/XATTR support yes

Install blobs     yes

KVM support       yes

COLO support      yes

RDMA support      no

TCG interpreter   no

fdt support       yes

preadv support    yes

fdatasync         yes

madvise           yes

posix_madvise     yes

libcap-ng support no

vhost-net support yes

vhost-scsi support yes

vhost-vsock support yes

Trace backends    log

spice support     no

rbd support       no

xfsctl support    no

smartcard support no

libusb            no

usb net redir     no

OpenGL support    no

OpenGL dmabufs    no

libiscsi support  no

libnfs support    no

build guest agent yes

QGA VSS support   no

QGA w32 disk info no

QGA MSI support   no

seccomp support   no

coroutine backend ucontext

coroutine pool    yes

debug stack usage no

GlusterFS support no

Archipelago support no

gcov              gcov

gcov enabled      no

TPM support       yes

libssh2 support   no

TPM passthrough   yes

QOM debugging     yes

lzo support       no

snappy support    no

bzip2 support     no

NUMA host support no

tcmalloc support  no

jemalloc support  no

avx2 optimization yes

replication support yes

3、make

ubuntu@ubuntu-X556UB:~/qemu$ make

4、make install

ubuntu@ubuntu-X556UB:~/qemu$ sudo make install

5、查看支持的芯片:

ubuntu@ubuntu-X556UB:~/qemu$ qemu-system-arm -M ?

Supported machines are:

akita                Sharp SL-C1000 (Akita) PDA (PXA270)

ast2500-evb          Aspeed AST2500 EVB (ARM1176)

borzoi               Sharp SL-C3100 (Borzoi) PDA (PXA270)

canon-a1100          Canon PowerShot A1100 IS

cheetah              Palm Tungsten|E aka. Cheetah PDA (OMAP310)

collie               Sharp SL-5500 (Collie) PDA (SA-1110)

connex               Gumstix Connex (PXA255)

cubieboard           cubietech cubieboard

highbank             Calxeda Highbank (ECX-1000)

imx25-pdk            ARM i.MX25 PDK board (ARM926)

integratorcp         ARM Integrator/CP (ARM926EJ-S)

kzm                  ARM KZM Emulation Baseboard (ARM1136)

lm3s6965evb          Stellaris LM3S6965EVB

lm3s811evb           Stellaris LM3S811EVB

mainstone            Mainstone II (PXA27x)

midway               Calxeda Midway (ECX-2000)

musicpal             Marvell 88w8618 / MusicPal (ARM926EJ-S)

n800                 Nokia N800 tablet aka. RX-34 (OMAP2420)

n810                 Nokia N810 tablet aka. RX-44 (OMAP2420)

netduino2            Netduino 2 Machine

none                 empty machine

nuri                 Samsung NURI board (Exynos4210)

palmetto-bmc         OpenPOWER Palmetto BMC (ARM926EJ-S)

raspi2               Raspberry Pi 2

realview-eb          ARM RealView Emulation Baseboard (ARM926EJ-S)

realview-eb-mpcore   ARM RealView Emulation Baseboard (ARM11MPCore)

realview-pb-a8       ARM RealView Platform Baseboard for Cortex-A8

realview-pbx-a9      ARM RealView Platform Baseboard Explore for Cortex-A9

romulus-bmc          OpenPOWER Romulus BMC (ARM1176)

sabrelite            Freescale i.MX6 Quad SABRE Lite Board (Cortex A9)

smdkc210             Samsung SMDKC210 board (Exynos4210)

spitz                Sharp SL-C3000 (Spitz) PDA (PXA270)

sx1                  Siemens SX1 (OMAP310) V2

sx1-v1               Siemens SX1 (OMAP310) V1

terrier              Sharp SL-C3200 (Terrier) PDA (PXA270)

tosa                 Sharp SL-6000 (Tosa) PDA (PXA255)

verdex               Gumstix Verdex (PXA270)

versatileab          ARM Versatile/AB (ARM926EJ-S)

versatilepb          ARM Versatile/PB (ARM926EJ-S)

vexpress-a15         ARM Versatile Express for Cortex-A15

vexpress-a9          ARM Versatile Express for Cortex-A9

virt-2.6             QEMU 2.6 ARM Virtual Machine

virt-2.7             QEMU 2.7 ARM Virtual Machine

virt-2.8             QEMU 2.8 ARM Virtual Machine

virt                 QEMU 2.9 ARM Virtual Machine (alias of virt-2.9)

virt-2.9             QEMU 2.9 ARM Virtual Machine

xilinx-zynq-a9       Xilinx Zynq Platform Baseboard for Cortex-A9

z2                   Zipit Z2 (PXA27x)

6、下载内核4.9版本内核linux-4.9.tar.gz并解压到linux-4.9文件夹

https://www.kernel.org/pub/linux/kernel/v4.x/

7、 配置内核并编译

ubuntu@ubuntu-X556UB:~/Qemu/linux-4.9$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm vexpress_defconfig

HOSTCC  scripts/basic/fixdep

HOSTCC  scripts/kconfig/conf.o

SHIPPED scripts/kconfig/zconf.tab.c

SHIPPED scripts/kconfig/zconf.lex.c

SHIPPED scripts/kconfig/zconf.hash.c

HOSTCC  scripts/kconfig/zconf.tab.o

HOSTLD  scripts/kconfig/conf

#

# configuration written to .config

ubuntu@ubuntu-X556UB:~/Qemu/linux-4.9$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm

8、下载busybox并编译安装

git clone https://github.com/mirror/busybox.git

make defconfig

make CROSS_COMPILE=arm-linux-gnueabi-

make CROSS_COMPILE=arm-linux-gnueabi- install

9、制作文件系统

sudo mkdir rootfs

sudo cp /home/ubuntu/Qemu/busybox/_install/* -r rootfs/

sudo mkdir rootfs/lib/

sudo cp -P /usr/arm-linux-gnueabi/lib/* rootfs/lib/

sudo mkdir rootfs/dev

sudo mknod rootfs/dev/tty1 c 4 1

sudo mknod rootfs/dev/tty2 c 4 2

sudo mknod rootfs/dev/tty3 c 4 3

sudo mknod rootfs/dev/tty4 c 4 4

dd if=/dev/zero of=a9rootfs.ext3 bs=1M count=32

mkfs.ext3 a9rootfs.ext3

10、启动系统

qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/ubuntu/Qemu/linux-4.9/arch/arm/boot/zImage -dtb /home/ubuntu/Qemu/linux-4.9/arch/arm/boot/dts/vexpress-v2p-ca9.dtb -nographic -append "root=/dev/mmcblk0  console=ttyAMA0" -sd /home/ubuntu/Qemu/a9rootfs.ext3


http://www.ppmy.cn/news/392880.html

相关文章

前端html转换为pdf,html2pdf-前端转pdf,并上传

3932dad0-05e4-409f-86bc-1c3100aee925.png 今天要解决的问题是,将页面上的一部分内容转换成pdf,并且存储起来。如上图所示,我们的内容包括了文字,图片,表格。表格甚至还有边框和背景颜色等样式的设置。 初始html代码如…

基于 QEMU进行 arm 仿真开发 (以 vexpress-a9 为例)

转载:https://www.cnblogs.com/schips/p/12345431.html 背景 基于 QEMU 的仿真可以节省 硬件成本。 参考:《qemu-system-arm仿真vexpress-a9踩坑记》、《在Ubuntu下使用QEMU搭建arm开发环境(一)搭建基本开发环境》 我们在这一讲…

linux arm kqemu,Ubuntu – ARM KVM

測試環境為 Ubuntu 16.04 ARM 處理器平台. ARM: Virtualization support for ARM was initially added to ARMv7-A processors starting with Cortex-A15 and including Cortex-A7 and Cortex-A17. ARMv8-A processors include support for virtualization. Refer to http://ww…

radius java_Java处理Radius access-challenge

最近使用 RSA Authentication Manager, 并且与其自带的Radius server整合, RSA的Radius server 配置不太透明, 目前只配成功了PAP方式的验证,CHAP目前不成功。 RSA Radius在token输错3次后有要求用户输入next token的安全设置方式…

depl服务器做系统开机蓝屏,系统蓝屏请分析dump文件出现蓝屏的具体原因是什么...

尊敬的工程师们,你们好: 我的电脑好几天都会出现蓝屏,用Windows Debugging Tool分析后,出现以下信息,请帮忙分析一下导致蓝屏主要的原因: Windows Kernel Version 7601 (Service Pack 1) MP (2 procs) Free x64 Product: WinNt, suite: TerminalServer SingleUserTS Buil…

Chunk at 0000001313C1A500 of size 512

错误现象: 2019-06-04 10:14:12.854238: I tensorflow/core/common_runtime/bfc_allocator.cc:632] Chunk at 000000130B200000 of size 256 2019-06-04 10:14:12.856756: I tensorflow/core/common_runtime/bfc_allocator.cc:632] Chunk at 000000130B200100 of size 256 2…

qemu常用参数选项说明

qemu常用参数选项说明 在我的系列博客《基于qemu-riscv从0开始构建嵌入式linux系统》中使用qemu项目一步步构造搭建了嵌入式linux系统,而其中在run.sh中qemu的启动参数选项非常多且繁杂,因此本文将对其进行归纳整理。 设备类型(-machine/-M…

Win32汇编:基本知识总结

汇编语言是所有程序设计语言中最古老的,它与计算机机器语言最为接近,通过汇编语言可以直接访问计算机的硬件,能够直接与CPU对话,可以说汇编语言是所有编程语言中语法格式最自由的,但自由的代价就是需要了解计算机体系结构和操作系统的大量细节,每编写一段程序都需要考虑各种硬件…