用Qemu搭建aarch64学习环境

作者信息

作者: 彭东林

邮箱: pengdonglin137@163.com

QQ: 405728433

 

软件平台

主机: Ubuntu14.04 64位版本

模拟器:Qemu-2.8.0

Linux内核版本: Linux-4.10

Busybox版本:busybox-1.24.2

工具链: gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux

 

参考博文

用Qemu模拟vexpress-a9 --- 配置 qemu 的网络功能

用Qemu模拟vexpress-a9 (一) --- 搭建Linux kernel调试环境

用Qemu模拟vexpress-a9 (三)--- 实现用u-boot引导Linux内核

qemu中使用9p,支持host和guest中共享目录

讓TQ2440也用上設備樹(1)

用Qemu模拟vexpress-a9 (六) --- 多核

 

缘起

随着aarch64在手机和服务器上面的普及,我们越来越有必要学习一下aarch64的知识,但是目前市面上面还没有做的很好的aarch64的开发板,之前我买了一块NanoPC-T3,用的SoC是Samsung的6818,是cortex-a53 八核架构,但是商家给的资料全都是32位的(armv8兼容aarch32和aarch64),他们说Samsung没有给64位的BSP资料,所以只能等待Samsung来解决,这样的结果令我很失望,偶然看到网上有人用Qemu模拟器来搭建aarch64的运行环境,让我看到了曙光,所以从网上搜刮了一下资料,为后人铺路。

下面涉及到的软件包可以到这里下载。

具备的功能

模拟一个cortex-a53 双核或者单核的环境,同时可以跟Host通信,以便于共享一些文件,为了简单起见,根文件系统使用的是ramdisk格式。

正文

1、编译Qemu模拟器

首先到Qemu官网下载最新的模拟器,我下到的是Qemu-2.8.0,也可以下载其他版本

1 tar -xf qemu-2.8.0.tar.xz
2 cd qemu-2.8.0/
3 mkdir build
4 cd build/
5 # 需要安装这个软件包,因为我们使能了--enable-virtfs, 否则configure的时候会失败
6 sudo apt-get install libcap-dev  
7 ../configure --target-list=arm-softmmu,i386-softmmu,x86_64-softmmu,aarch64-linux-user,arm-linux-user,i386-linux-user,x86_64-linux-user,aarch64-softmmu --audio-drv-list=alsa --enable-virtfs
8 make -j8
9 sudo make install 

然后就可以使用我们下面会用到的qemu-system-aarch64工具了。

2、下载工具链

登录这个网址:http://www.veryarm.com/aarch64-linux-gnu-gcc

其中有一些注意事项:

aarch64-linux-gnu-gcc是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译ARMv8 64位目标中的裸机程序、u-boot、Linux kernel、filesystem和App应用程序。aarch64-linux-gnu-gcc交叉编译器必须安装在64为主机上,才能编译目标代码。

我们这里使用的是最新的Linux解压版:

3、下载编译最新的Linux内核

登录https://www.kernel.org/,   下载最新的Linux版本,目前最新的是Linux-4.10。 

下面是编译下面要用的kernel的命令:

1 #!/bin/bash
2 cross_compile=/home/pengdonglin/src/qemu/aarch64/gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/bin/aarch64-linux-gnu-
3 make CROSS_COMPILE=$cross_compile ARCH=arm64 O=./out_aarch64 defconfig
4 make CROSS_COMPILE=$cross_compile ARCH=arm64 O=./out_aarch64 menuconfig
5 make CROSS_COMPILE=$cross_compile ARCH=arm64 O=./out_aarch64 Image -j4

由于下面要用到ramdisk的启动方式,需要在kernel配置中支持:

1 General setup  --->
2     ----> [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
3 
4 Device Drivers  --->
5     [*] Block devices  --->
6             <*>   RAM block device support
7             (65536) Default RAM disk size (kbytes)

这里我们给ramdisk设置的默认大小是64MB,不能比后面我们实际生成的ramdisk.img的size小。

此外,由于我们还需要支持NFS挂在以及通过9p的方式跟Host共享文件,这些也需要在kernel中进行相应的配置。(默认配置已经支持了

关于Qemu的9p方式实现跟Host的目录共享可以参考 : qemu中使用9p,支持host和guest中共享目录    

这样就有了我们下面要用到的内核镜像Image。

4、制作根文件系统

登录https://busybox.net/downloads/下载要用的busybox版本,这里我下的是busybox-1.24.2

要设置的不多:

执行make menuconfig,配置下面几项:

1 Build Options  --->
2 
3     [*] Build BusyBox as a static binary (no shared libs)
4 
5     (/home/pengdonglin/src/qemu/aarch64/gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/bin/aarch64-linux-gnu-) Cross Compiler prefix

然后执行make && make install命令

下面制作启动用的ramdisk,我把这个过程写成了脚本,如下:

 1 #!/bin/bash
 2 sudo rm -rf rootfs
 3 sudo rm -rf tmpfs
 4 sudo rm -rf ramdisk*
 5 sudo mkdir rootfs
 6 sudo cp ../busybox-1.24.2/_install/*  rootfs/ -raf
 7 sudo mkdir -p rootfs/proc/
 8 sudo mkdir -p rootfs/sys/
 9 sudo mkdir -p rootfs/tmp/
10 sudo mkdir -p rootfs/root/
11 sudo mkdir -p rootfs/var/
12 sudo mkdir -p rootfs/mnt/
13 sudo cp etc rootfs/ -arf
14 sudo mkdir -p rootfs/lib
15 sudo cp -arf ../gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/aarch64-linux-gnu/libc/lib/aarch64-linux-gnu/* rootfs/lib/
16 sudo rm rootfs/lib/*.a
17 sudo ../gcc-linaro-aarch64-linux-gnu-4.9-2014.07_linux/bin/aarch64-linux-gnu-strip rootfs/lib/*
18 sudo mkdir -p rootfs/dev/
19 sudo mknod rootfs/dev/tty1 c 4 1
20 sudo mknod rootfs/dev/tty2 c 4 2
21 sudo mknod rootfs/dev/tty3 c 4 3
22 sudo mknod rootfs/dev/tty4 c 4 4
23 sudo mknod rootfs/dev/console c 5 1
24 sudo mknod rootfs/dev/null c 1 3
25 sudo dd if=/dev/zero of=ramdisk bs=1M count=16
26 sudo mkfs.ext4 -F ramdisk
27 sudo mkdir -p tmpfs
28 sudo mount -t ext4 ramdisk ./tmpfs/  -o loop
29 sudo cp -raf rootfs/*  tmpfs/
30 sudo umount tmpfs
31 sudo gzip --best -c ramdisk > ramdisk.gz
32 sudo mkimage -n "ramdisk" -A arm -O linux -T ramdisk -C gzip -d ramdisk.gz ramdisk.img

制作ramdisk用到的文件到这里下载。

5、Qemu支持网络

请参考博客:

用Qemu模拟vexpress-a9 --- 配置 qemu 的网络功能

用Qemu模拟vexpress-a9 (三)--- 实现用u-boot引导Linux内核

6、测试

共享目录的方法:

 1 sudo qemu-system-aarch64 \
 2     -M  virt \
 3     -cpu cortex-a53 \
 4     -smp 2 \
 5     -m 4096M \
 6     -kernel ./linux-4.10/out_aarch64/arch/arm64/boot/Image \
 7     -nographic \
 8     -append "root=/dev/ram0 rw rootfstype=ext4 console=ttyAMA0 init=/linuxrc ignore_loglevel" \
 9     -initrd ./rootfs/ramdisk.img \
10     -fsdev local,security_model=passthrough,id=fsdev0,path=/nfsroot \
11     -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare

 支持网络的启动:

 1 sudo qemu-system-aarch64 \
 2     -M  virt \
 3     -cpu cortex-a53 \
 4     -smp 2 \
 5     -m 4096M \
 6     -kernel ./linux-4.10/out_aarch64/arch/arm64/boot/Image \
 7     -nographic \
 8     -append "root=/dev/ram0 rw rootfstype=ext4 console=ttyAMA0 init=/linuxrc ignore_loglevel" \
 9     -initrd ./rootfs/ramdisk.img \
10     -net nic,vlan=0 -net tap,vlan=0,ifname=tap0

当然,也可以将上面的两种方是合在一起:

 1 sudo qemu-system-aarch64 \
 2     -M  virt \
 3     -cpu cortex-a53 \
 4     -smp 2 \
 5     -m 4096M \
 6     -kernel ./linux-4.10/out_aarch64/arch/arm64/boot/Image \
 7     -nographic \
 8     -append "root=/dev/ram0 rw rootfstype=ext4 console=ttyAMA0 init=/linuxrc ignore_loglevel" \
 9     -initrd ./rootfs/ramdisk.img \
10     -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
11     -fsdev local,security_model=passthrough,id=fsdev0,path=/nfsroot \
12     -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare

我们需要在Host上面先指定一个共享目录, 比如就用/nfsroot,如果用nfs挂载的话还需要在/etc/export中进行相应的配置。

nfs挂载:

mount -t nfs -o nolock 172.16.14.203:/nfsroot /mnt

9p挂载:

mount -t 9p -o trans=virtio,version=9p2000.L hostshare /mnt2

在/etc/fstab中可以写成如下方式:

hostshare  /mnt   9p   trans=virtio,version=9p2000.L   0   2

这样就实现了跟Host的文件共享, 推荐用9p的方式,这个更稳定一些。

下面是启动信息:

  1 $./run_all.sh 
  2 sudo tunctl -u root -t tap0
  3 TUNSETIFF: Device or resource busy
  4 sudo ifconfig tap0 0.0.0.0 promisc up
  5 sudo brctl addif br0 tap0
  6 brctl show
  7 bridge name    bridge id        STP enabled    interfaces
  8 br0        8000.2a30f59a82a1    no        eth0
  9                             tap0
 10 docker0        8000.02429cade970    no        
 11 [    0.000000] Booting Linux on physical CPU 0x0
 12 [    0.000000] Linux version 4.10.0 (pengdonglin@pengdonglin-HP) (gcc version 4.9.1 20140529 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.07 - Linaro GCC 4.9-2014.06) ) #2 SMP PREEMPT Wed Feb 22 19:39:00 CST 2017
 13 [    0.000000] Boot CPU: AArch64 Processor [410fd034]
 14 [    0.000000] debug: ignoring loglevel setting.
 15 [    0.000000] efi: Getting EFI parameters from FDT:
 16 [    0.000000] efi: UEFI not found.
 17 [    0.000000] cma: Reserved 16 MiB at 0x00000000ff000000
 18 [    0.000000] On node 0 totalpages: 1048576
 19 [    0.000000]   DMA zone: 12288 pages used for memmap
 20 [    0.000000]   DMA zone: 0 pages reserved
 21 [    0.000000]   DMA zone: 786432 pages, LIFO batch:31
 22 [    0.000000]   Normal zone: 4096 pages used for memmap
 23 [    0.000000]   Normal zone: 262144 pages, LIFO batch:31
 24 [    0.000000] psci: probing for conduit method from DT.
 25 [    0.000000] psci: PSCIv0.2 detected in firmware.
 26 [    0.000000] psci: Using standard PSCI v0.2 function IDs
 27 [    0.000000] psci: Trusted OS migration not required
 28 [    0.000000] percpu: Embedded 21 pages/cpu @ffff8000fffc0000 s48128 r8192 d29696 u86016
 29 [    0.000000] pcpu-alloc: s48128 r8192 d29696 u86016 alloc=21*4096
 30 [    0.000000] pcpu-alloc: [0] 0 [0] 1 
 31 [    0.000000] Detected VIPT I-cache on CPU0
 32 [    0.000000] CPU features: enabling workaround for ARM erratum 845719
 33 [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 1032192
 34 [    0.000000] Kernel command line: root=/dev/ram0 rw rootfstype=ext4 console=ttyAMA0 init=/linuxrc ignore_loglevel
 35 [    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
 36 [    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
 37 [    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
 38 [    0.000000] software IO TLB [mem 0xfafff000-0xfefff000] (64MB) mapped at [ffff8000bafff000-ffff8000beffefff]
 39 [    0.000000] Memory: 4022724K/4194304K available (8508K kernel code, 946K rwdata, 3852K rodata, 1024K init, 393K bss, 155196K reserved, 16384K cma-reserved)
 40 [    0.000000] Virtual kernel memory layout:
 41 [    0.000000]     modules : 0xffff000000000000 - 0xffff000008000000   (   128 MB)
 42 [    0.000000]     vmalloc : 0xffff000008000000 - 0xffff7dffbfff0000   (129022 GB)
 43 [    0.000000]       .text : 0xffff000008080000 - 0xffff0000088d0000   (  8512 KB)
 44 [    0.000000]     .rodata : 0xffff0000088d0000 - 0xffff000008ca0000   (  3904 KB)
 45 [    0.000000]       .init : 0xffff000008ca0000 - 0xffff000008da0000   (  1024 KB)
 46 [    0.000000]       .data : 0xffff000008da0000 - 0xffff000008e8ca00   (   947 KB)
 47 [    0.000000]        .bss : 0xffff000008e8ca00 - 0xffff000008eeee50   (   394 KB)
 48 [    0.000000]     fixed   : 0xffff7dfffe7fd000 - 0xffff7dfffec00000   (  4108 KB)
 49 [    0.000000]     PCI I/O : 0xffff7dfffee00000 - 0xffff7dffffe00000   (    16 MB)
 50 [    0.000000]     vmemmap : 0xffff7e0000000000 - 0xffff800000000000   (  2048 GB maximum)
 51 [    0.000000]               0xffff7e0000000000 - 0xffff7e0004000000   (    64 MB actual)
 52 [    0.000000]     memory  : 0xffff800000000000 - 0xffff800100000000   (  4096 MB)
 53 [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
 54 [    0.000000] Preemptible hierarchical RCU implementation.
 55 [    0.000000]     Build-time adjustment of leaf fanout to 64.
 56 [    0.000000]     RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=2.
 57 [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=2
 58 [    0.000000] NR_IRQS:64 nr_irqs:64 0
 59 [    0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]
 60 [    0.000000] arm_arch_timer: WARNING: Invalid trigger for IRQ3, assuming level low
 61 [    0.000000] arm_arch_timer: WARNING: Please fix your firmware
 62 [    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 62.50MHz (virt).
 63 [    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
 64 [    0.000107] sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
 65 [    0.002457] Console: colour dummy device 80x25
 66 [    0.002953] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=250000)
 67 [    0.005003] pid_max: default: 32768 minimum: 301
 68 [    0.005495] Security Framework initialized
 69 [    0.005796] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
 70 [    0.005823] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
 71 [    0.033688] ASID allocator initialised with 65536 entries
 72 [    0.055888] EFI services will not be available.
 73 [    0.070508] smp: Bringing up secondary CPUs ...
 74 [    0.103718] Detected VIPT I-cache on CPU1
 75 [    0.104137] CPU1: Booted secondary processor [410fd034]
 76 [    0.105447] smp: Brought up 1 node, 2 CPUs
 77 [    0.105484] SMP: Total of 2 processors activated.
 78 [    0.105544] CPU features: detected feature: 32-bit EL0 Support
 79 [    0.106390] CPU: All CPU(s) started at EL1
 80 [    0.106993] alternatives: patching kernel code
 81 [    0.117571] devtmpfs: initialized
 82 [    0.125123] DMI not present or invalid.
 83 [    0.125968] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
 84 [    0.126043] futex hash table entries: 512 (order: 4, 65536 bytes)
 85 [    0.129131] pinctrl core: initialized pinctrl subsystem
 86 [    0.140179] NET: Registered protocol family 16
 87 [    0.174101] cpuidle: using governor menu
 88 [    0.174984] vdso: 2 pages (1 code @ ffff0000088d7000, 1 data @ ffff000008da5000)
 89 [    0.175144] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
 90 [    0.179636] DMA: preallocated 256 KiB pool for atomic allocations
 91 [    0.180866] Serial: AMBA PL011 UART driver
 92 [    0.217051] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 39, base_baud = 0) is a PL011 rev1
 93 [    0.229660] console [ttyAMA0] enabled
 94 [    0.234380] irq: type mismatch, failed to map hwirq-27 for /intc!
 95 [    0.332166] HugeTLB registered 2 MB page size, pre-allocated 0 pages
 96 [    0.346761] ACPI: Interpreter disabled.
 97 [    0.351316] vgaarb: loaded
 98 [    0.352841] SCSI subsystem initialized
 99 [    0.354129] libata version 3.00 loaded.
100 [    0.356211] usbcore: registered new interface driver usbfs
101 [    0.356660] usbcore: registered new interface driver hub
102 [    0.357155] usbcore: registered new device driver usb
103 [    0.363521] pps_core: LinuxPPS API ver. 1 registered
104 [    0.363666] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
105 [    0.364073] PTP clock support registered
106 [    0.365464] dmi: Firmware registration failed.
107 [    0.366899] Advanced Linux Sound Architecture Driver Initialized.
108 [    0.376396] clocksource: Switched to clocksource arch_sys_counter
109 [    0.377906] VFS: Disk quotas dquot_6.6.0
110 [    0.379184] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
111 [    0.381159] pnp: PnP ACPI: disabled
112 [    0.410723] NET: Registered protocol family 2
113 [    0.425569] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
114 [    0.426069] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
115 [    0.426727] TCP: Hash tables configured (established 32768 bind 32768)
116 [    0.427411] UDP hash table entries: 2048 (order: 4, 65536 bytes)
117 [    0.427736] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
118 [    0.429815] NET: Registered protocol family 1
119 [    0.432139] RPC: Registered named UNIX socket transport module.
120 [    0.432824] RPC: Registered udp transport module.
121 [    0.432964] RPC: Registered tcp transport module.
122 [    0.433091] RPC: Registered tcp NFSv4.1 backchannel transport module.
123 [    0.433311] PCI: CLS 0 bytes, default 128
124 [    0.436037] Trying to unpack rootfs image as initramfs...
125 [    0.440854] rootfs image is not initramfs (no cpio magic); looks like an initrd
126 [    0.453369] Freeing initrd memory: 2400K
127 [    0.455311] kvm [1]: HYP mode not available
128 [    0.466090] audit: initializing netlink subsys (disabled)
129 [    0.469328] audit: type=2000 audit(0.452:1): initialized
130 [    0.475039] workingset: timestamp_bits=46 max_order=20 bucket_order=0
131 [    0.518138] squashfs: version 4.0 (2009/01/31) Phillip Lougher
132 [    0.523010] NFS: Registering the id_resolver key type
133 [    0.523578] Key type id_resolver registered
134 [    0.523654] Key type id_legacy registered
135 [    0.523791] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
136 [    0.524960] 9p: Installing v9fs 9p2000 file system support
137 [    0.534620] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
138 [    0.534832] io scheduler noop registered
139 [    0.535541] io scheduler cfq registered (default)
140 [    0.557194] pl061_gpio 9030000.pl061: PL061 GPIO chip @0x0000000009030000 registered
141 [    0.564858] OF: PCI: host bridge /pcie@10000000 ranges:
142 [    0.565315] OF: PCI:    IO 0x3eff0000..0x3effffff -> 0x00000000
143 [    0.565681] OF: PCI:   MEM 0x10000000..0x3efeffff -> 0x10000000
144 [    0.565850] OF: PCI:   MEM 0x8000000000..0xffffffffff -> 0x8000000000
145 [    0.566651] pci-host-generic 3f000000.pcie: ECAM at [mem 0x3f000000-0x3fffffff] for [bus 00-0f]
146 [    0.568716] pci-host-generic 3f000000.pcie: PCI host bridge to bus 0000:00
147 [    0.569014] pci_bus 0000:00: root bus resource [bus 00-0f]
148 [    0.569196] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
149 [    0.569343] pci_bus 0000:00: root bus resource [mem 0x10000000-0x3efeffff]
150 [    0.569501] pci_bus 0000:00: root bus resource [mem 0x8000000000-0xffffffffff]
151 [    0.570327] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
152 [    0.573729] pci 0000:00:01.0: [1af4:1000] type 00 class 0x020000
153 [    0.574091] pci 0000:00:01.0: reg 0x10: [io  0x0000-0x001f]
154 [    0.574263] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x00000fff]
155 [    0.574487] pci 0000:00:01.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
156 [    0.574667] pci 0000:00:01.0: reg 0x30: [mem 0x00000000-0x0003ffff pref]
157 [    0.575624] pci 0000:00:02.0: [1af4:1009] type 00 class 0x000200
158 [    0.575801] pci 0000:00:02.0: reg 0x10: [io  0x0000-0x003f]
159 [    0.575945] pci 0000:00:02.0: reg 0x14: [mem 0x00000000-0x00000fff]
160 [    0.576117] pci 0000:00:02.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit pref]
161 [    0.579248] pci 0000:00:01.0: BAR 6: assigned [mem 0x10000000-0x1003ffff pref]
162 [    0.579773] pci 0000:00:01.0: BAR 4: assigned [mem 0x8000000000-0x8000003fff 64bit pref]
163 [    0.580132] pci 0000:00:02.0: BAR 4: assigned [mem 0x8000004000-0x8000007fff 64bit pref]
164 [    0.580965] pci 0000:00:01.0: BAR 1: assigned [mem 0x10040000-0x10040fff]
165 [    0.581226] pci 0000:00:02.0: BAR 1: assigned [mem 0x10041000-0x10041fff]
166 [    0.581423] pci 0000:00:02.0: BAR 0: assigned [io  0x1000-0x103f]
167 [    0.581602] pci 0000:00:01.0: BAR 0: assigned [io  0x1040-0x105f]
168 [    0.612049] virtio-pci 0000:00:01.0: enabling device (0000 -> 0003)
169 [    0.615182] virtio-pci 0000:00:02.0: enabling device (0000 -> 0003)
170 [    0.617449] xenfs: not registering filesystem on non-xen platform
171 [    0.629378] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
172 [    0.636035] SuperH (H)SCI(F) driver initialized
173 [    0.645049] msm_serial: driver initialized
174 [    0.647353] cacheinfo: Unable to detect cache hierarchy for CPU 0
175 [    0.703861] brd: module loaded
176 [    0.744597] loop: module loaded
177 [    0.746301] hisi_sas: driver version v1.6
178 [    0.763497] libphy: Fixed MDIO Bus: probed
179 [    0.764792] tun: Universal TUN/TAP device driver, 1.6
180 [    0.764893] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
181 [    0.778786] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
182 [    0.778947] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
183 [    0.779221] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
184 [    0.779350] igb: Copyright (c) 2007-2014 Intel Corporation.
185 [    0.779597] igbvf: Intel(R) Gigabit Virtual Function Network Driver - version 2.4.0-k
186 [    0.779732] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
187 [    0.779963] sky2: driver version 1.30
188 [    0.785210] VFIO - User Level meta-driver version: 0.3
189 [    0.790416] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
190 [    0.790566] ehci-pci: EHCI PCI platform driver
191 [    0.790837] ehci-platform: EHCI generic platform driver
192 [    0.791295] ehci-exynos: EHCI EXYNOS driver
193 [    0.791675] ehci-msm: Qualcomm On-Chip EHCI Host Controller
194 [    0.792007] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
195 [    0.792378] ohci-pci: OHCI PCI platform driver
196 [    0.792662] ohci-platform: OHCI generic platform driver
197 [    0.793038] ohci-exynos: OHCI EXYNOS driver
198 [    0.794623] usbcore: registered new interface driver usb-storage
199 [    0.798672] mousedev: PS/2 mouse device common for all mice
200 [    0.805642] rtc-pl031 9010000.pl031: rtc core: registered pl031 as rtc0
201 [    0.811835] i2c /dev entries driver
202 [    0.828982] sdhci: Secure Digital Host Controller Interface driver
203 [    0.829089] sdhci: Copyright(c) Pierre Ossman
204 [    0.830537] Synopsys Designware Multimedia Card Interface Driver
205 [    0.834397] sdhci-pltfm: SDHCI platform and OF driver helper
206 [    0.838884] ledtrig-cpu: registered to indicate activity on CPUs
207 [    0.844425] usbcore: registered new interface driver usbhid
208 [    0.844550] usbhid: USB HID core driver
209 [    0.854742] NET: Registered protocol family 17
210 [    0.856085] 9pnet: Installing 9P2000 support
211 [    0.858100] Key type dns_resolver registered
212 [    0.860637] registered taskstats version 1
213 [    0.866590] input: gpio-keys as /devices/platform/gpio-keys/input/input0
214 [    0.868829] rtc-pl031 9010000.pl031: setting system clock to 2017-02-22 11:58:46 UTC (1487764726)
215 [    0.869655] ALSA device list:
216 [    0.869743]   No soundcards found.
217 [    0.871669] uart-pl011 9000000.pl011: no DMA platform data
218 [    0.873769] RAMDISK: gzip image found at block 0
219 [    1.242574] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)
220 [    1.242933] VFS: Mounted root (ext4 filesystem) on device 1:0.
221 [    1.244541] devtmpfs: mounted
222 [    1.292728] Freeing unused kernel memory: 1024K
223 Please press Enter to activate this console. 
224 [root@aarch64 ]# 
225 [root@aarch64 ]# 
226 [root@aarch64 ]# 
227 [root@aarch64 ]# ifconfig 
228 eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
229           inet addr:172.16.14.250  Bcast:172.16.15.255  Mask:255.255.252.0
230           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
231           RX packets:143 errors:0 dropped:14 overruns:0 frame:0
232           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
233           collisions:0 txqueuelen:1000 
234           RX bytes:23589 (23.0 KiB)  TX bytes:0 (0.0 B)
235 lo        Link encap:Local Loopback  
236           inet addr:127.0.0.1  Mask:255.0.0.0
237           UP LOOPBACK RUNNING  MTU:65536  Metric:1
238           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
239           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
240           collisions:0 txqueuelen:1000 
241           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
242 [root@aarch64 ]# mount -t nfs -o nolock 172.16.14.203:/nfsroot /mnt
243 [   26.558855] random: fast init done
244 [root@aarch64 ]# mount
245 /dev/root on / type ext4 (rw,relatime,data=ordered)
246 devtmpfs on /dev type devtmpfs (rw,relatime,size=2011360k,nr_inodes=502840,mode=755)
247 proc on /proc type proc (rw,relatime)
248 tmpfs on /tmp type tmpfs (rw,relatime)
249 sysfs on /sys type sysfs (rw,relatime)
250 debugfs on /sys/kernel/debug type debugfs (rw,relatime)
251 devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
252 172.16.14.203:/nfsroot on /mnt type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.16.14.203,mountvers=3,mountproto=tcp,local_lock=all,addr=172.16.14.203)
253 [root@aarch64 ]# mkdir mnt2
254 [root@aarch64 ]# mount -t 9p -o trans=virtio,version=9p2000.L hostshare /mnt2
255 [root@aarch64 ]# mount
256 /dev/root on / type ext4 (rw,relatime,data=ordered)
257 devtmpfs on /dev type devtmpfs (rw,relatime,size=2011360k,nr_inodes=502840,mode=755)
258 proc on /proc type proc (rw,relatime)
259 tmpfs on /tmp type tmpfs (rw,relatime)
260 sysfs on /sys type sysfs (rw,relatime)
261 debugfs on /sys/kernel/debug type debugfs (rw,relatime)
262 devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
263 172.16.14.203:/nfsroot on /mnt type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.16.14.203,mountvers=3,mountproto=tcp,local_lock=all,addr=172.16.14.203)
264 hostshare on /mnt2 type 9p (rw,sync,dirsync,relatime,trans=virtio,version=9p2000.L)
265 [root@aarch64 ]# [  246.789966] random: crng init done

 

完。

posted @ 2017-02-22 21:57  摩斯电码  阅读(20144)  评论(9编辑  收藏  举报