`
lobin
  • 浏览: 426102 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

QEMU下安装&运行linux系统

 
阅读更多

# wget --no-check-certificate https://download.qemu.org/qemu-2.1.2.tar.bz2

# tar -jxvf qemu-2.1.2.tar.bz2

 

 

# ./configure --help

如果出现以下错误:

ERROR: Cannot use 'python', Python 2.4 or later is required.

       Note that Python 3 or later is not yet supported.

       Use --python=/path/to/python to specify a supported Python.

 

请先安装Python(Python 2.4~Python 3)

 

如果不是默认安装,需要覆盖老版本的Python。或者

可以指定--python=/path/to/python

# ./configure --python=/usr/local/python-2.6.2/bin/python --help

Python安装参考另一篇文章: https://www.iteye.com/blog/lobin-2431416

 

查看下qemu支持的目标平台

--target-list=LIST   set target list (default: build everything)

                           Available targets: aarch64-softmmu alpha-softmmu 

                           arm-softmmu cris-softmmu i386-softmmu lm32-softmmu 

                           m68k-softmmu microblazeel-softmmu microblaze-softmmu 

                           mips64el-softmmu mips64-softmmu mipsel-softmmu 

                           mips-softmmu moxie-softmmu or32-softmmu 

                           ppc64-softmmu ppcemb-softmmu ppc-softmmu 

                           s390x-softmmu sh4eb-softmmu sh4-softmmu 

                           sparc64-softmmu sparc-softmmu unicore32-softmmu 

                           x86_64-softmmu xtensaeb-softmmu xtensa-softmmu 

                           aarch64-linux-user alpha-linux-user armeb-linux-user 

                           arm-linux-user cris-linux-user i386-linux-user 

                           m68k-linux-user microblazeel-linux-user 

                           microblaze-linux-user mips64el-linux-user 

                           mips64-linux-user mipsel-linux-user mips-linux-user 

                           mipsn32el-linux-user mipsn32-linux-user 

                           or32-linux-user ppc64abi32-linux-user 

                           ppc64le-linux-user ppc64-linux-user ppc-linux-user 

                           s390x-linux-user sh4eb-linux-user sh4-linux-user 

                           sparc32plus-linux-user sparc64-linux-user 

                           sparc-linux-user unicore32-linux-user 

                           x86_64-linux-user

查看下qemu支持的audio驱动

--audio-drv-list=LIST  

                           set audio drivers list:

                           Available drivers: oss alsa sdl esd pa fmod

 

ERROR: glib-2.12 gthread-2.0 is required to compile QEMU

 

# yum install gettext

 

安装glib

通过yum方式没有找到glib,所以采用源代码方式安装:

# wget --no-check-certificate https://download.gnome.org/sources/glib/2.12/glib-2.12.0.tar.gz

# tar -zxf glib-2.12.0.tar.gz

# ./configure

# make

# make install

 

# yum install zlib

# yum install zlib-devel

 

 

配置阿里云的yum源:http://mirrors.aliyun.com/repo/Centos-6.repo

配置华为云的yum源:https://repo.huaweicloud.com/repository/conf/CentOS-6-reg.repo

# yum clean all

# yum makecache

 

# yum install autoconf automake libtool

# yum install glib*

 

# ./configure --prefix=/usr/local/qemu-2.1.2 --target-list=arm-softmmu --audio-drv-list=

Disabling libtool due to broken toolchain support

Install prefix    /usr/local/qemu-2.1.2

BIOS directory    /usr/local/qemu-2.1.2/share/qemu

binary directory  /usr/local/qemu-2.1.2/bin

library directory /usr/local/qemu-2.1.2/lib

module directory  /usr/local/qemu-2.1.2/lib/qemu

libexec directory /usr/local/qemu-2.1.2/libexec

include directory /usr/local/qemu-2.1.2/include

config directory  /usr/local/qemu-2.1.2/etc

local state directory   /usr/local/qemu-2.1.2/var

Manual directory  /usr/local/qemu-2.1.2/share/man

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

Source path       /home/root/qemu-2.1.2

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 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -g 

QEMU_CFLAGS       -fPIE -DPIE -m32 -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  -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-all -I$(SRC_PATH)/pixman/pixman -I$(BUILD_DIR)/pixman/pixman -I$(SRC_PATH)/dtc/libfdt

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

make              make

install           install

python            python -B

smbd              /usr/sbin/smbd

module support    no

host CPU          i386

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            internal

SDL support       no

GTK support       no

VTE support       no

curses support    no

curl support      no

mingw32 support   no

Audio drivers     

Block whitelist (rw) 

Block whitelist (ro) 

VirtFS support    no

VNC support       yes

VNC TLS support   no

VNC SASL support  no

VNC JPEG support  no

VNC PNG support   no

VNC WS support    no

xen support       no

brlapi support    no

bluez  support    no

Documentation     no

GUEST_BASE        yes

PIE               yes

vde support       no

netmap support    no

Linux AIO support no

ATTR/XATTR support yes

Install blobs     yes

KVM support       yes

RDMA support      no

TCG interpreter   no

fdt support       yes

preadv support    yes

fdatasync         yes

madvise           yes

posix_madvise     yes

sigev_thread_id   yes

uuid support      no

libcap-ng support no

vhost-net support yes

vhost-scsi support yes

Trace backends    nop

spice support     no

rbd support       no

xfsctl support    no

nss used          no

libusb            no

usb net redir     no

GLX support       no

libiscsi support  no

libnfs support    no

build guest agent yes

QGA VSS support   no

seccomp support   no

coroutine backend ucontext

coroutine pool    yes

GlusterFS support no

virtio-blk-data-plane no

gcov              gcov

gcov enabled      no

TPM support       yes

libssh2 support   no

TPM passthrough   yes

QOM debugging     yes

vhdx              no

Quorum            no

lzo support       no

snappy support    no

NUMA host support no

 

# make 

# make install

 

查看版本:

# qemu-system-arm --version

QEMU emulator version 2.1.2, Copyright (c) 2003-2008 Fabrice Bellard

 

查看支持的开发板:

# qemu-system-arm -M ?

# qemu-system-arm -M help

Supported machines are:

lm3s811evb           Stellaris LM3S811EVB

canon-a1100          Canon PowerShot A1100 IS

vexpress-a15         ARM Versatile Express for Cortex-A15

vexpress-a9          ARM Versatile Express for Cortex-A9

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

connex               Gumstix Connex (PXA255)

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

lm3s6965evb          Stellaris LM3S6965EVB

versatileab          ARM Versatile/AB (ARM926EJ-S)

borzoi               Borzoi PDA (PXA270)

tosa                 Tosa PDA (PXA255)

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

midway               Calxeda Midway (ECX-2000)

mainstone            Mainstone II (PXA27x)

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

terrier              Terrier PDA (PXA270)

highbank             Calxeda Highbank (ECX-1000)

cubieboard           cubietech cubieboard

sx1-v1               Siemens SX1 (OMAP310) V1

sx1                  Siemens SX1 (OMAP310) V2

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

kzm                  ARM KZM Emulation Baseboard (ARM1136)

akita                Akita PDA (PXA270)

z2                   Zipit Z2 (PXA27x)

musicpal             Marvell 88w8618 / MusicPal (ARM926EJ-S)

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

versatilepb          ARM Versatile/PB (ARM926EJ-S)

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

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

spitz                Spitz PDA (PXA270)

none                 empty machine

virt                 ARM Virtual Machine

collie               Collie PDA (SA-1110)

smdkc210             Samsung SMDKC210 board (Exynos4210)

verdex               Gumstix Verdex (PXA270)

nuri                 Samsung NURI board (Exynos4210)

integratorcp         ARM Integrator/CP (ARM926EJ-S)

 

 

安装交叉编译工具:

# yum install gcc-arm-linux-gnueabi

 

# wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_9-2015q1-20150306-src.tar.bz2

# tar -jxvf gcc-arm-none-eabi-4_9-2015q1-20150306-src.tar.bz2

 

# wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

# tar -jxvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 

 

# mkdir -p /usr/local/arm-none-linux-gnueabi

# cp -rf * /usr/local/arm-none-linux-gnueabi

 

# vi ~/.bash_profile

PATH=$PATH:$HOME/bin:/usr/local/arm-none-linux-gnueabi/bin

 

# arm-none-linux-gnueabi-gcc  -v

Using built-in specs.

Target: arm-none-linux-gnueabi

Configured with: /scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/src/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q1-203' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/host-libs-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/install/arm-none-linux-gnueabi/bin

Thread model: posix

gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) 

 

# cat test.c

#include <stdio.h>

 

int main(int argc, char** argv)

{

  printf("hello, world!");

}

 

 

# arm-none-linux-gnueabi-gcc test.c -o test

 

# arm-none-linux-gnueabi-gcc -S test.c -o test.S

 

# cat test.S 

.cpu arm10tdmi

.fpu softvfp

.eabi_attribute 20, 1

.eabi_attribute 21, 1

.eabi_attribute 23, 3

.eabi_attribute 24, 1

.eabi_attribute 25, 1

.eabi_attribute 26, 2

.eabi_attribute 30, 6

.eabi_attribute 18, 4

.file"test.c"

.section.rodata

.align2

.LC0:

.ascii"hello, world!\000"

.text

.align2

.globalmain

.typemain, %function

main:

.fnstart

.LFB2:

@ args = 0, pretend = 0, frame = 16

@ frame_needed = 1, uses_anonymous_args = 0

stmfdsp!, {fp, lr}

.save {fp, lr}

.LCFI0:

.setfp fp, sp, #4

addfp, sp, #4

.LCFI1:

.pad #16

subsp, sp, #16

.LCFI2:

strr0, [fp, #-8]

strr1, [fp, #-12]

ldrr0, .L3

blprintf

subsp, fp, #4

ldmfdsp!, {fp, pc}

.L4:

.align2

.L3:

.word.LC0

.LFE2:

.fnend

.sizemain, .-main

.ident"GCC: (Sourcery G++ Lite 2009q1-203) 4.3.3"

.section.note.GNU-stack,"",%progbits

 

linux

# wget https://mirrors.edge.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.gz

# tar -zxf linux-2.6.39.tar.gz

 

vexpress板

Versatile Express板,简称VE板,一种开发板。是ARM公司推出的,提供给厂商评估ARM内核的高效的软硬件平台。

 

编译linux内核:

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm vexpress_defconfig

编译

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm

 

 

 

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm vexpress_defconfig

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm zImage -j4

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm modules -j4    // 编译驱动模块

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm dtbs

 

 

制作根文件系统

使用busybox制作根文件系统

 

首先需要先安装busybox

 

# wget http://www.busybox.net/downloads/busybox-1.20.2.tar.bz2

# tar -jxvf busybox-1.20.2.tar.bz2

 

先修改下配置,使得在构建BusyBox的时候构建为静态库,否则在下面运行时会报如下错误:

Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

 

# vi Config.in

 

menu 'Build Options'

 

config STATIC

        bool "Build BusyBox as a static binary (no shared libs)"

        default y

        help

          If you want to build a static BusyBox binary, which does not

          use or require any shared libraries, then enable this option.

          This can cause BusyBox to be considerably larger, so you should

          leave this option false unless you have a good reason (i.e.

          your target platform does not support shared libraries, or

          you are building an initrd which doesn't need anything but

          BusyBox, etc).

 

          Most people will leave this set to 'N'.

 

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm defconfig

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm

# make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm install

 

开始制作根文件系统

# mkdir -p rootfs/{dev,etc/init.d,lib}

该操作相当于:

# mkdir rootfs

# mkdir rootfs/dev

# mkdir rootfs/etc

# mkdir rootfs/etc/init.d

# mkdir rootfs/lib

 

# cp -rf _install/* ../rootfs/

 

# cp -rf /usr/local/arm-none-linux-gnueabi/arm-none-linux-gnueabi/lib/* rootfs/lib

 

 

# mknod rootfs/dev/tty1 c 4 1

# mknod rootfs/dev/tty2 c 4 2

# mknod rootfs/dev/tty3 c 4 3

# mknod rootfs/dev/tty4 c 4 4

 

制作根文件系统镜像

制作镜像文件:

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

格式化镜像为ext3格式:

# mkfs.ext3 rootfs.ext3

 

# mkdir tmpfs

# mount -t ext3 rootfs.ext3 tmpfs/ -o loop

# cp -r rootfs/*  tmpfs/

# umount tmpfs

# rm -rf tmpfs/


启动:

# qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/root/linux-2.6.39/arch/arm/boot/zImage -nographic -append "root=/dev/mmcblk0 console=ttyAMA0" -sd rootfs.ext3

 

如果出现以下错误, 检查下上面安装BusyBox的时候的配置, 需要在构建BusyBox的时候构建为静态库。

 

Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

[<800419b8>] (unwind_backtrace+0x0/0xf8) from [<803502f8>] (panic+0x6c/0x19c)

[<803502f8>] (panic+0x6c/0x19c) from [<800357ec>] (init_post+0xf8/0x154)

[<800357ec>] (init_post+0xf8/0x154) from [<80008508>] (kernel_init+0x198/0x1b0)

[<80008508>] (kernel_init+0x198/0x1b0) from [<8003c2bc>] (kernel_thread_exit+0x0/0x8)

 

如果运行正常的话:

# qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/root/linux-2.6.39/arch/arm/boot/zImage -nographic -append "root=/dev/mmcblk0 console=ttyAMA0" -sd rootfs.ext3

Uncompressing Linux... done, booting the kernel.

Initializing cgroup subsys cpuset

Linux version 2.6.39 (root@localhost.localdomain) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #2 SMP Sat Sep 14 07:27:22 CST 2019

CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c53c7f

CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine: ARM-Versatile Express

Memory policy: ECC disabled, Data cache writealloc

sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms

PERCPU: Embedded 7 pages/cpu @80892000 s6784 r8192 d13696 u32768

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048

Kernel command line: root=/dev/mmcblk0 console=ttyAMA0

PID hash table entries: 2048 (order: 1, 8192 bytes)

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 512MB = 512MB total

Memory: 515084k/515084k available, 9204k reserved, 0K highmem

Virtual kernel memory layout:

    vector  : 0xffff0000 - 0xffff1000   (   4 kB)

    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)

    vmalloc : 0xa0800000 - 0xf8000000   (1400 MB)

    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)

    modules : 0x7f000000 - 0x80000000   (  16 MB)

      .init : 0x80008000 - 0x80035000   ( 180 kB)

      .text : 0x80035000 - 0x8044a3c0   (4181 kB)

      .data : 0x8044c000 - 0x8046e800   ( 138 kB)

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

Hierarchical RCU implementation.

RCU-based detection of stalled CPUs is disabled.

NR_IRQS:128

Console: colour dummy device 80x30

Calibrating delay loop... 63.48 BogoMIPS (lpj=317440)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 1 counters available

Brought up 1 CPUs

SMP: Total of 1 processors activated (63.48 BogoMIPS).

NET: Registered protocol family 16

L310 cache controller enabled

l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x02420000, Cache size: 131072 B

hw-breakpoint: debug architecture 0x0 unsupported.

Serial: AMBA PL011 UART driver

mb:uart0: ttyAMA0 at MMIO 0x10009000 (irq = 37) is a PL011 rev1

console [ttyAMA0] enabled

mb:uart1: ttyAMA1 at MMIO 0x1000a000 (irq = 38) is a PL011 rev1

mb:uart2: ttyAMA2 at MMIO 0x1000b000 (irq = 39) is a PL011 rev1

mb:uart3: ttyAMA3 at MMIO 0x1000c000 (irq = 40) is a PL011 rev1

bio: create slab <bio-0> at 0

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

Advanced Linux Sound Architecture Driver Version 1.0.24.

Switching to clocksource timer3

NET: Registered protocol family 2

IP route cache hash table entries: 4096 (order: 2, 16384 bytes)

TCP established hash table entries: 16384 (order: 5, 131072 bytes)

TCP bind hash table entries: 16384 (order: 5, 131072 bytes)

TCP: Hash tables configured (established 16384 bind 16384)

TCP reno registered

UDP hash table entries: 256 (order: 1, 8192 bytes)

UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)

NET: Registered protocol family 1

RPC: Registered udp transport module.

RPC: Registered tcp transport module.

RPC: Registered tcp NFSv4.1 backchannel transport module.

PMU: registered new PMU device of type 0

JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.

msgmni has been set to 1006

io scheduler noop registered (default)

clcd-pl11x ct:clcd: PL111 rev2 at 0x10020000

clcd-pl11x ct:clcd: CT-CA9X4 hardware, XVGA display

v2m_cfg_write: writing 03c8eee0 to 00110001

v2m_cfg_write: writing 00000000 to 00710000

v2m_cfg_write: writing 00000002 to 00b10000

Console: switching to colour frame buffer device 128x48

armflash-0: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000

Intel/Sharp Extended Query Table at 0x0031

Using buffer write method

armflash-1: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000

Intel/Sharp Extended Query Table at 0x0031

Using buffer write method

Concatenating MTD devices:

(0): "armflash-0"

(1): "armflash-1"

into device "armflash"

RedBoot partition parsing not available

afs partition parsing not available

smsc911x: Driver version 2008-10-21.

smsc911x smsc911x: eth0: Features changed: 0x00004800 -> 0x00004000

smsc911x-mdio: probed

eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=ffffffff:01, irq=-1)

net eth0: MAC Address: 52:54:00:12:34:56

isp1760 isp1760: NXP ISP1760 USB Host Controller

isp1760 isp1760: new USB bus registered, assigned bus number 1

isp1760 isp1760: Scratch test failed.

isp1760 isp1760: can't setup

isp1760 isp1760: USB bus 1 deregistered

isp1760: Failed to register the HCD device

Initializing USB Mass Storage driver...

usbcore: registered new interface driver usb-storage

USB Mass Storage support registered.

mousedev: PS/2 mouse device common for all mice

rtc-pl031 mb:rtc: rtc core: registered pl031 as rtc0

mmci-pl18x mb:mmci: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 41,42 (pio)

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

mmc0: host does not support reading read-only switch. assuming write-enable.

mmc0: new SD card at address 4567

input: AT Raw Set 2 keyboard as /devices/mb:kmi0/serio0/input/input0

aaci-pl041 mb:aaci: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 43

aaci-pl041 mb:aaci: FIFO 512 entries

ALSA device list:

  #0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 43

oprofile: using arm/armv7-ca9

TCP cubic registered

NET: Registered protocol family 17

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0

mmcblk0: mmc0:4567 QEMU! 32.0 MiB 

mmcblk0: detected capacity change from 0 to 33554432

input: ImExPS/2 Generic Explorer Mouse as /devices/mb:kmi1/serio1/input/input1

rtc-pl031 mb:rtc: setting system clock to 2019-09-14 01:54:18 UTC (1568426058)

 mmcblk0: unknown partition table

EXT3-fs: barriers not enabled

kjournald starting.  Commit interval 5 seconds

EXT3-fs (mmcblk0): mounted filesystem with writeback data mode

VFS: Mounted root (ext3 filesystem) readonly on device 179:0.

Freeing init memory: 180K

 

 

 

 

can't run '/etc/init.d/rcS': No such file or directory

 

Please press Enter to activate this console. / # 

/ # 

/ # 

/ # ls

bin         etc         linuxrc     sbin

dev         lib         lost+found  usr

/ # 

 

如果出现如下错误:

/usr # pwd

/usr

/usr # mkdir local

mkdir: can't create directory 'local': Read-only file system

 

启动时通过以下方式指定读写权限

# qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/root/linux-2.6.39/arch/arm/boot/zImage -nographic -append "root=/dev/mmcblk0 rw console=ttyAMA0" -sd rootfs.ext3

 

图形化启动:

 

以上为在串口终端启动系统,按照以下的启动命令可以使用LCD屏作为输出启动系统

qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/root/linux-2.6.39/arch/arm/boot/zImage -append "root=/dev/mmcblk0 rw console=ttyAMA0" -sd rootfs.ext3

 

 

 

模拟的机器:

ARM-Versatile Express

模拟的处理器架构:

ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c53c7f

 

 

分享到:
评论

相关推荐

    linux qemu离线安装包

    2. **创建目标目录并解压**:将下载的离线安装包复制到你的Linux系统中一个适当的目录,例如`/home/user/downloads/qemu-offline`。然后,在终端中导航到这个目录,使用`tar`命令解压缩文件(如果下载的是.tar.gz或....

    win10系统下利用QEMU安装ARM架构的银河麒麟桌面操作系统V10

    win10系统下利用QEMU安装ARM架构的银河麒麟桌面操作系统V10 双击qemu-w64-setup-20210505.exe,指定安装目录,例:D:\qemu 安装好后,利用如下步骤qemu创建一个虚拟硬盘文件: 在D:\qemu文件夹下,打开cmd命令行 在...

    QEMU for windows+安装说明

    在本文中,我们将详细介绍如何在Windows环境下安装和使用QEMU。 首先,QEMU 3.0版本被许多用户认为相比5.0版本更加稳定且易用,可能是因为其界面和功能设计更为成熟。尽管新版本通常会带来更多的特性与改进,但选择...

    linux0.01 qemu文件

    QEMU支持多种架构,包括x86、ARM、MIPS等,因此,无论你的主机操作系统是什么,只要QEMU支持,你都能运行Linux 0.01。 在提供的文件中,有两个映像文件:`linux0.01-3.5.img`和`hd_oldlinux.img`。`linux0.01-3.5....

    使用QEMU搭建U-boot+linux+NFS开发环境.zip

    QEMU是一款开源的全系统模拟器,它允许我们在主机上运行各种不同的客体操作系统,而无需物理硬件。NFS则是一种网络文件系统协议,允许网络中的计算机共享文件和目录。 首先,让我们详细了解QEMU。QEMU能够模拟多种...

    预装linux系统的QEMU虚拟机

    "LinuxBox"很可能是这个预装Linux系统QEMU虚拟机的镜像文件,它可能是一个.qcow2、.vmdk或者其他的虚拟磁盘格式,用于在QEMU中启动和运行Linux系统。用户可以通过QEMU提供的命令行工具,加载这个镜像文件,启动并...

    linux img for qemu

    在这个场景中,“linux.img”就是用于在 QEMU 中启动和运行 Linux 操作系统的镜像。 Linux 镜像文件通常有几种不同的格式,例如 raw、qcow2、vmdk 等。"linux.img" 这样的文件名暗示这可能是一个原始(raw)格式的...

    基于 Docker/Qemu/Bochs 的极速 Linux 0.11 内核学习和开发环境

    【标题】"基于 Docker/Qemu/...借助 QEMU 和 Bochs,他们能够在不破坏现有系统的情况下安全地试验内核修改。这种结合使用多种工具的方法不仅提高了学习效率,也降低了入门门槛,使得对内核的探索变得更加容易和有趣。

    C6678上运行linux系统总结

    总的来说,要在TMS320C6678上成功运行Linux系统,需要熟悉嵌入式系统开发的多个方面,包括硬件驱动开发、操作系统移植、网络通信以及编译工具的使用。这是一个挑战性但极具价值的过程,因为它能解锁C6678的强大计算...

    qemu下u-boot+kernel+rootfs完整启动移植手册

    总结,这个过程涵盖了 QEMU 的安装、交叉编译工具链的配置、u-boot 的定制与编译、Linux 内核的配置与编译,以及根文件系统的创建。这些步骤对于在 QEMU 虚拟环境中实现一个完整的嵌入式 Linux 系统启动至关重要。每...

    调试linux内核的平台qemu

    QEMU(Quick Emulator)是一个强大的开源模拟器,它允许我们在一个平台上运行另一个系统的软件,包括操作系统。QEMU常被用于Linux内核的调试,因为它提供了在物理机上对内核进行远程调试的能力,而无需实际硬件环境...

    Qemu&Kvm虚拟计算机系统启动流程图

    1. 系统引导与初始化:在虚拟化环境中,KVM模块在加载到Linux内核中后,用户可以通过QEMU来创建和管理虚拟机。当系统启动时,相关的KVM驱动和模块会进行初始化,并准备就绪。 2. 创建虚拟机实例:通过QEMU命令或者...

    linux下的qemu模块

    在Linux系统中,QEMU通过加载内核模块与宿主机的硬件交互,实现对虚拟机的控制。QEMU支持动态二进制翻译(Dynamic Binary Translation),这意味着它可以将 guest OS 的指令转换为宿主机可执行的形式,以实现模拟...

    qemu-win10:使用QEMU在Linux上运行Windows 10

    Qemu Windows 10 Botstrap使用Qemu(带有QXL驱动程序和外部桥接网络)在Linux机器上运行Windows 10。开始吧创建Windows 10文件夹并将其放置在虚拟驱动器中。 对于Windows 10,建议使用50G及更高容量。 mkdir -p ~ /...

    usb-hid.rar_linux hid usb_qemu usb_usb hid linux

    描述 "QEMU USB HID devices for Linux Device." 表明这是关于如何在QEMU模拟环境中配置和使用Linux系统的USB HID设备。 USB HID是USB规范的一部分,主要用于键盘、鼠标、游戏控制器等输入设备以及某些简单的输出...

    qemu启动x86操作系统busybox版

    BusyBox是一款轻量级的Linux实用程序集合,它包含了众多常见的Unix命令,常用于嵌入式设备和最小化的Linux系统中。它被设计成一个单一可执行文件,大大减少了存储空间的需求,因此在构建简单而功能齐全的操作系统时...

    Qemu安装使用手册中文版

    在Linux环境下,可以通过包管理器如apt、yum或dnf来安装QEMU。以Ubuntu为例,可以在终端执行以下命令: ```bash sudo apt update sudo apt install qemu-system ``` 对于其他操作系统,如Windows或macOS,建议下载...

    实现linux系统在VHD、Vdi虚拟磁盘中运行在实体机里.doc

    使用 QEMU-KVM 虚拟机安装 Linux 系统。在虚拟机中选择需要安装的系统光盘,设置存储和 CPU 数量,然后启动虚拟机。安装系统之前,需要阅读 Ventoy 的官方文档,了解支持的 Linux 发行版。 知识点 3:安装 GRUB 包 ...

    可以用于qemu启动的aarch64 linux kernel Image

    通过这种方式,QEMU和Aarch64 Linux内核Image的结合,为我们提供了一个在软件模拟环境下测试和调试64位ARM Linux系统的能力,这对于开发者来说是一个极其有价值的工具。 总的来说,理解和掌握如何使用QEMU启动Aarch...

    Qemu-windows.rar_qemu_qemu arm windows_qemu arm 仿真_qemu windows

    Qemu的跨平台特性使得它能在Windows这样的非Linux系统上运行,为开发者提供了一个便利的工具,用于测试和调试在不同硬件平台上运行的应用程序或操作系统。 描述中的"windows下的Qemu模拟"和"模拟arm、pc的操作系统...

Global site tag (gtag.js) - Google Analytics