Qemu 运行ARMv8开发平台 ubuntu16.04
2017-10-01 12:07
375 查看
1. Ubuntu 安装aarch64的gcc编译工具:
2. 编译制作aarch64架构的最小文件系统
Download busybox:
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
3.编译linux kernel
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support │ │
│ │ (_install) Initramfs source file(s)
Boot options --->
Default kernel command string
Kernel Features --->
Page size (4KB) --->
Virtual address space size (48-bit) --->
sudo apt-get install gcc-aarch64-linux-gnu
2. 编译制作aarch64架构的最小文件系统
Download busybox:
http://busybox.net/download
$cd busybox
$export ARCH=arm64
$export CROSS_COMPILE=aarch64-linux-gnu- $make menuconfig静态编译busybox
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
$make
$make install
$cp _install/ -rf ../linux-4.0/
$cd linux-4.0/_install $mkdir etc dev mnt $mkdir -p etc/init.d/
$vim init.d/rcS mkdir -p /proc mkdir -p /tmp mkdir -p /sys mkdir -p /mnt /bin/mount -a mkdir -p /dev/pts mount -t devpts devpts /dev/pts echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s
$vim etc/fstab proc /proc proc defaults 0 0 tmpfs /tmp tmpfs defaults 0 0 sysfs /sys sysfs defaults 0 0 tmpfs /dev tmpfs defaults 0 0 debugfs /sys/kernel/debug debugfs defaults 0 0
$vim etc/inittab ::sysinit:/etc/init.d/rcS ::respawn:-/bin/sh ::askfirst:-/bin/sh ::cttlaltdel:/bin/umount -a -r
$cd dev sudo mknod console c 5 1 sudo mknod null c 1 3
3.编译linux kernel
$export ARCH=arm64
$export CROSS_COMPILE=aarch64-linux-gnu- $make menuconfigGeneral setup --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support │ │
│ │ (_install) Initramfs source file(s)
Boot options --->
Default kernel command string
Kernel Features --->
Page size (4KB) --->
Virtual address space size (48-bit) --->
$make -j8
$qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -m 2048 -smp 2 -kernel arch/arm64/boot/Image --append "rdinit=/linuxrc console=ttyAMA0"
Booting Linux on physical CPU 0x0 Initializing cgroup subsys cpuset Linux version 4.0.0 (xinchangxiang@xinchangxiang) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) ) #5 SMP Sun Oct 1 12:53:11 CST 2017 CPU: AArch64 Processor [411fd070] revision 0 Detected PIPT I-cache on CPU0 efi: Getting EFI parameters from FDT: efi: UEFI not found. psci: probing for conduit method from DT. psci: PSCIv0.2 detected in firmware. psci: Using standard PSCI v0.2 function IDs PERCPU: Embedded 14 pages/cpu @ffff80007ffcc000 s18008 r8192 d31144 u57344 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 516096 Kernel command line: rdinit=/linuxrc console=ttyAMA0 PID hash table entries: 4096 (order: 3, 32768 bytes) Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes) Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes) software IO TLB [mem 0xb9a00000-0xbda00000] (64MB) mapped at [ffff800079a00000-ffff80007d9fffff] Memory: 1986756K/2097152K available (4795K kernel code, 281K rwdata, 1640K rodata, 1312K init, 220K bss, 110396K reserved, 0K cma-reserved) Virtual kernel memory layout: vmalloc : 0xffff000000000000 - 0xffff7bffbfff0000 (126974 GB) vmemmap : 0xffff7bffc0000000 - 0xffff7fffc0000000 ( 4096 GB maximum) 0xffff7bffc1000000 - 0xffff7bffc3000000 ( 32 MB actual) fixed : 0xffff7ffffabfe000 - 0xffff7ffffac00000 ( 8 KB) PCI I/O : 0xffff7ffffae00000 - 0xffff7ffffbe00000 ( 16 MB) modules : 0xffff7ffffc000000 - 0xffff800000000000 ( 64 MB) memory : 0xffff800000000000 - 0xffff800080000000 ( 2048 MB) .init : 0xffff8000006cb000 - 0xffff800000813000 ( 1312 KB) .text : 0xffff800000080000 - 0xffff8000006ca504 ( 6442 KB) .data : 0xffff800000815000 - 0xffff80000085b600 ( 282 KB) SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 Hierarchical RCU implementation. CONFIG_RCU_FANOUT set to non-default value of 32 Additional per-CPU info printed with stalls. RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2. RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 NR_IRQS:64 nr_irqs:64 0 Architected cp15 timer(s) running at 62.50MHz (virt). sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 2199023255552ns Console: colour dummy device 80x25 Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=625000) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 4096 (order: 3, 32768 bytes) Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes) EFI services will not be available. CPU1: Booted secondary processor Detected PIPT I-cache on CPU1 Brought up 2 CPUs SMP: Total of 2 processors activated. devtmpfs: initialized DMI not present or invalid. NET: Registered protocol family 16 cpuidle: using governor ladder cpuidle: using governor menu vdso: 2 pages (1 code @ ffff80000081d000, 1 data @ ffff80000081c000) hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. DMA: preallocated 256 KiB pool for atomic allocations Serial: AMBA PL011 UART driver 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 38, base_baud = 0) is a PL011 rev1 console [ttyAMA0] enabled 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 Initialized. Switched to clocksource arch_sys_counter NET: Registered protocol family 2 TCP established hash table entries: 16384 (order: 5, 131072 bytes) TCP bind hash table entries: 16384 (order: 6, 262144 bytes) TCP: Hash tables configured (established 16384 bind 16384) TCP: reno registered UDP hash table entries: 1024 (order: 3, 32768 bytes) UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. futex hash table entries: 512 (order: 3, 32768 bytes) squashfs: version 4.0 (2009/01/31) Phillip Lougher jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. 9p: Installing v9fs 9p2000 file system support io scheduler noop registered (default) 0.flash: 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 0.flash: 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): "0.flash" (1): "0.flash" into device "0.flash" usbcore: registered new interface driver usb-storage mousedev: PS/2 mouse device common for all mice rtc-pl031 9010000.pl031: rtc core: registered pl031 as rtc0 Driver 'mmcblk' needs updating - please use bus_type methods ledtrig-cpu: registered to indicate activity on CPUs usbcore: registered new interface driver usbhid usbhid: USB HID core driver TCP: cubic registered NET: Registered protocol family 17 9pnet: Installing 9P2000 support rtc-pl031 9010000.pl031: setting system clock to 2017-10-01 04:53:36 UTC (1506833616) ALSA device list: No soundcards found. Freeing unused kernel memory: 1312K (ffff8000006cb000 - ffff800000813000) Freeing alternatives memory: 4K (ffff800000813000 - ffff800000814000) Bad inittab entry at line 4 Please press Enter to activate this console. / # ls bin etc mnt sbin tmp dev linuxrc proc sys usr / # / #4.ok , 到这里就已经run起来了。
相关文章推荐
- Ubuntu14.04使用QEMU模拟ARM平台开发环境
- Ubuntu下装QEMU配置ARM-Linux开发环境
- Ubuntu 16.04下用Wine运行的软件出现方块的解决思路(应该是兼容现在所有平台的Wine碰到这个的问题)
- ubuntu上建立交叉编译环境,在qemu上运行ARM镜像
- 利用QEMU运行ARM开发环境
- 图解如何将Ubuntu上的Qt程序交叉编译出可在ARM平台运行的程序(五部曲)
- 一步步教你如何在Ubuntu虚拟机中安装QEMU并模拟模拟arm 开发环境(一)uImage u-boot
- 用vs2013+velt-0.1.4进行嵌入式开发 进行海思平台 UBOOT 开发 分类: arm-linux-Ubuntu Windows-嵌入式 2015-06-27 11:59 393人阅读 评论(0) 收藏
- 【Jetson TX1开发笔记】Ubuntu16.04 上安装Nodejs(ARM版本)
- 一步步教你如何在ubuntu虚拟机中安装QEMU并模拟arm 开发环境(二)rootfs制作
- # 【ARM-Linux开发】在Win7的电脑上直接运行安装Ubuntu14.04发生的问题 标签(空格分隔): 【Linux开发】 --- > 一段时间以来,一直是在Windows上安装虚拟机
- QT开发pjsip的VOIP,A8平台运行
- 在Ubuntu下开始搭建Python开发平台
- 在Ubuntu平台上开发快递邮件查询Scope
- Ubuntu 16.04 64位 javascript开发 vim配置
- 机会网络平台haggle在Ubuntu下的运行环境配置过程遇到问题的解决方案
- Ubuntu16.04下安装有关python的开发环境
- Ubuntu 16.04 64位中搭建Node.js开发环境教程
- arm-linux安装Ubuntu12.4开发环境(三)安装nfs server
- Linux下开发Windows平台运行的程序 - MinGW