qemu可以用来模拟嵌入式的开发板,很多的嵌入式开发技巧完全可以抛开开发板来做实验,甚至可以直接调试驱动。内核调试就更加方便了。

主要参考了:https://www.jianshu.com/p/94833e841742

但是完全按照这个来会有各种问题,一般情况下都是busybox和kernel的版本问题,我按照原来的博客的版本搞过一遍,各种报错,后来索性瞎几把整了。

主要有如下几点不一样:

1 busybox原来的说是要动态编译,我偏静态,免得我少拷贝lib出问题

2 kernel版本我试过很多个,但是各有各的问题,最后我用的最新版:linux-5.5

3 busybox我也用的最新版,老版本编译都编不过:busybox-1.31.1

4 编译器用的:arm-linux-gnueabihf/5.3.1

5 qemu用的:QEMU emulator version 4.2.0

6 使用博客里面那种小的文件系统,内存-m 512M足够,但是如果自己的文件系统这里的内存要放大,否则运行出问题

其他的基本上按照他的博客来就行了,另外,用图形界面启动会报sdl错误,我始终装不上这个库,索性就是用命令行来启动了。

启动参数为:

qemu-system-arm -M vexpress-a9 -m 512M -kernel ./zImage -dtb ./vexpress-v2p-ca9.dtb -nographic -append "root=/dev/mmcblk0 rw console=ttyAMA0" -sd rootfs.ext3

结果是这样的,成功了:

WARNING: Image format was not specified for 'rootfs.ext3' and probing guessed raw.Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.Specify the 'raw' format explicitly to remove the restrictions.
Booting Linux on physical CPU 0x0
Linux version 5.5.0 (oushaojun@ubuntu) (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05)) #2 SMP Wed Mar 25 04:20:19 PDT 2020
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
OF: fdt: Machine model: V2P-CA9
Memory policy: Data cache writeback
Reserved memory: created DMA memory pool at 0x4c000000, size 8 MiB
OF: reserved mem: initialized node vram@4c000000, compatible id shared-dma-pool
cma: Reserved 16 MiB at 0x7f000000
CPU: All CPU(s) started in SVC mode.
percpu: Embedded 19 pages/cpu s45696 r8192 d23936 u77824
Built 1 zonelists, mobility grouping on.  Total pages: 130048
Kernel command line: root=/dev/mmcblk0 rw console=ttyAMA0
printk: log_buf_len individual max cpu contribution: 4096 bytes
printk: log_buf_len total cpu_extra contributions: 12288 bytes
printk: log_buf_len min size: 16384 bytes
printk: log_buf_len: 32768 bytes
printk: early log buf free: 14852(90%)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 492104K/524288K available (7168K kernel code, 430K rwdata, 1684K rodata, 1024K init, 157K bss, 15800K reserved, 16384K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
rcu: Hierarchical RCU implementation.
rcu:    RCU event tracing is enabled.
rcu:    RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
GIC CPU mask not found - kernel will fail to boot.
GIC CPU mask not found - kernel will fail to boot.
L2C: platform modifies aux control register: 0x02020000 -> 0x02420000
L2C: DT/platform modifies aux control register: 0x02020000 -> 0x02420000
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 dynamic clock gating disabled, standby mode disabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46420001
random: get_random_bytes called from start_kernel+0x314/0x4b0 with crng_init=0
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
Failed to initialize '/smb@4000000/motherboard/iofpga@7,00000000/timer@12000': -22
smp_twd: clock not found -2
Console: colour dummy device 80x30
Calibrating local timer... 92.08MHz.
Calibrating delay loop... 572.62 BogoMIPS (lpj=2863104)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: using BPIALL workaround
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x60100000 - 0x60100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 1 CPU
SMP: Total of 1 processors activated (572.62 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
hw-breakpoint: debug architecture 0x4 unsupported.
Serial: AMBA PL011 UART driver
10009000.uart: ttyAMA0 at MMIO 0x10009000 (irq = 29, base_baud = 0) is a PL011 rev1
printk: console [ttyAMA0] enabled
1000a000.uart: ttyAMA1 at MMIO 0x1000a000 (irq = 30, base_baud = 0) is a PL011 rev1
1000b000.uart: ttyAMA2 at MMIO 0x1000b000 (irq = 31, base_baud = 0) is a PL011 rev1
1000c000.uart: ttyAMA3 at MMIO 0x1000c000 (irq = 32, base_baud = 0) is a PL011 rev1
OF: amba_device_add() failed (-19) for /smb@4000000/motherboard/iofpga@7,00000000/wdt@f000
OF: amba_device_add() failed (-19) for /memory-controller@100e0000
OF: amba_device_add() failed (-19) for /memory-controller@100e1000
OF: amba_device_add() failed (-19) for /watchdog@100e5000
irq: type mismatch, failed to map hwirq-75 for interrupt-controller@1e001000!
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.
clocksource: Switched to clocksource arm,sp804
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
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.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 5 counters available
workingset: timestamp_bits=30 max_order=17 bucket_order=0
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 mq-deadline registered
io scheduler kyber registered
i2c i2c-0: Added multiplexed i2c bus 2
drm-clcd-pl111 1001f000.clcd: assigned reserved memory node vram@4c000000
drm-clcd-pl111 1001f000.clcd: using device-specific reserved memory
drm-clcd-pl111 1001f000.clcd: initializing Versatile Express PL111
drm-clcd-pl111 1001f000.clcd: core tile graphics present
drm-clcd-pl111 1001f000.clcd: this device will be deactivated
Error: Driver 'vexpress-muxfpga' is already registered, aborting...
drm-clcd-pl111 10020000.clcd: initializing Versatile Express PL111
drm-clcd-pl111 10020000.clcd: DVI muxed to daughterboard 1 (core tile) CLCD
drm-clcd-pl111 10020000.clcd: found bridge on endpoint 0
drm-clcd-pl111 10020000.clcd: Using non-panel bridge
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
[drm] Initialized pl111 1.0.0 20170317 for 10020000.clcd on minor 0
Console: switching to colour frame buffer device 128x48
drm-clcd-pl111 10020000.clcd: fb0: pl111drmfb frame buffer device
physmap-flash 40000000.flash: physmap platform flash device: [mem 0x40000000-0x43ffffff]
40000000.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
physmap-flash 40000000.flash: physmap platform flash device: [mem 0x44000000-0x47ffffff]
40000000.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): "40000000.flash"
(1): "40000000.flash"
into device "40000000.flash"
physmap-flash 48000000.psram: physmap platform flash device: [mem 0x48000000-0x49ffffff]
libphy: Fixed MDIO Bus: probed
libphy: smsc911x-mdio: probed
smsc911x 4e000000.ethernet eth0: MAC Address: 52:54:00:12:34:56
isp1760 4f000000.usb: bus width: 32, oc: digital
isp1760 4f000000.usb: NXP ISP1760 USB Host Controller
isp1760 4f000000.usb: new USB bus registered, assigned bus number 1
isp1760 4f000000.usb: Scratch test failed.
isp1760 4f000000.usb: can't setup: -19
isp1760 4f000000.usb: USB bus 1 deregistered
usbcore: registered new interface driver usb-storage
rtc-pl031 10017000.rtc: registered as rtc0
mmci-pl18x 10005000.mmci: Got CD GPIO
mmci-pl18x 10005000.mmci: Got WP GPIO
mmci-pl18x 10005000.mmci: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 25,26 (pio)
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
input: AT Raw Set 2 keyboard as /devices/platform/smb@4000000/smb@4000000:motherboard/smb@4000000:motherboard:iofpga@7,00000000/10006000.kmi/serio0/input/input0
aaci-pl041 10004000.aaci: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 24
aaci-pl041 10004000.aaci: FIFO 512 entries
oprofile: using arm/armv7-ca9
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Registering SWP/SWPB emulation handler
mmc0: new SD card at address 4567
mmcblk0: mmc0:4567 QEMU! 32.0 MiB
rtc-pl031 10017000.rtc: setting system clock to 2020-03-25T11:38:52 UTC (1585136332)
ALSA device list:#0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 24
random: fast init done
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/smb@4000000/smb@4000000:motherboard/smb@4000000:motherboard:iofpga@7,00000000/10007000.kmi/serio1/input/input2
EXT4-fs (mmcblk0): mounting ext3 file system using the ext4 subsystem
EXT4-fs (mmcblk0): mounted filesystem with ordered data mode. Opts: (null)
ext3 filesystem being mounted at /root supports timestamps until 2038 (0x7fffffff)
VFS: Mounted root (ext3 filesystem) on device 179:0.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
random: crng init done
can't run '/etc/init.d/rcS': No such file or directoryPlease press Enter to activate this console.
/ #
/ #
/ #
/ # ls
bin         lib         lost+found  usr
dev         linuxrc     sbin

QEMU搭建ARM linux开发环境相关推荐

  1. ubuntu20.04.1 64位搭建嵌入式linux开发环境

    目录 背景 开发环境的搭建 1.交叉编译工具的安装 2.开发工具和依赖库的安装 2.1. 必需部分 2.2.可选部分 ubuntu20.04.1 64位配置和编译Linux3.0内核 背景 市面上的嵌 ...

  2. 在Windows使用VSCode搭建嵌入式Linux开发环境

    在Windows使用VSCode搭建嵌入式Linux开发环境 百问网已经制作好了完备的Ubuntu镜像,可以从这里下载: 链接:https://pan.baidu.com/s/1vw4VUV_Mvt0 ...

  3. Linux学习之云服务器搭建嵌入式Linux开发环境

    Linux学习之云服务器搭建嵌入式Linux开发环境 第一步:购买云服务器 进入腾讯云官方网站腾讯云官方网站 选择云+校园云+校园 进入控制台 将云服务器系统设置为Ubuntu系统 使用Xshell6 ...

  4. 构建嵌入式系统软件开发环境-VMware的安装及搭建嵌入式Linux开发环境

    嵌入式系统操作系统 目前流行的嵌入式操作系统主要有VxWorks.WindowsCE.Linux等,由于Linux的源码开放性.内核可裁剪性.在图像处理.文件管理及多任务支持等诸多方面的特点,使得它成 ...

  5. windows+vscode搭建远程linux开发环境

    windows+vscode搭建远程linux开发环境 保证linux安装了ssh服务 在vscode安装插件 配置远程Linux服务器信息 链接Linux服务器 选择项目开发目录 保证linux安装 ...

  6. 嵌入式linux编译环境搭建,嵌入式Linux开发环境搭建

    整理下嵌入式Linux开发环境搭建过程笔记. 一.制作u-boot.bin文件: tar xjf u-boot-1.1.6.tar.bz2 cd u-boot-1.1.6 patch -p1 < ...

  7. QEMU搭建arm64 Linux调试环境

    https://zhuanlan.zhihu.com/p/345232459 简述 本文记录了在ubuntu20.04上,使用QEMU搭建arm64 的Linux开发调试环境.可以方便得使用gdb调试 ...

  8. Linux开发(1):搭建嵌入式Linux开发环境

    在讲述详细的开发环境搭建之前,先大概讲讲本文介绍了哪些内容 首先,我们是在Windows下通过VMware运行虚拟机Ubuntu来运行主机端的Linux,然后再通过串口线连接电脑和Linux开发板 那 ...

  9. 从0开始在ubuntu18.04上搭建嵌入式Linux开发环境以及嵌入式Qt5.6开发环境

    博客中提到的一些工具文件都可以在该链接中下载:https://pan.baidu.com/s/10r4kku8C0bt8vLampOyvWQ 目录 一  Oflash软件通过openJtag下载u-b ...

最新文章

  1. mysql当前时间减1小时_最佳睡眠时间:晚上睡眠不超8小时,午睡不超1小时
  2. android socket通信如何抓取,安卓Socket通信实例(客户端、服务端)
  3. 如何将图片中的一个任意四边形区域的图像转化为矩形【附源码】
  4. JVM中OutOFMemory和StackOverflowError异常代码
  5. Python在cmd中配置虚拟环境ERROR: Command errored out with exit status 1:
  6. discuz模板引擎语法
  7. 风控建模基础笔记(一)
  8. 爱心的数学函数方程_数学里有哪些可以示爱的图像?它们的函数方程又是什么?...
  9. 双耳节拍 枕头_枕头2-3-0不在
  10. 12306中前端验证身份证件(及其他证件号)的方法
  11. React-native项目中如何使用阿里字体库呢?
  12. Windows Server 2012 R2 安装 Docker
  13. 数字孪生|数字孪生装备-关键技术和发展阶段
  14. 阿里执行副主席蔡崇信投资NBA篮网队;工信部约谈运营商,不得限制用户资费选择丨价值早报
  15. context 的用法是什么?(数据之间的跨组件交互传递)
  16. 一文详解肖特基二极管损坏的六大原因
  17. Latex 数学符号--双括号
  18. 洞房花烛夜山西人必喝的和气拌汤——西红柿鸡蛋拌汤
  19. 对Java建造者模式(Builder)的一点理解
  20. 在虚拟机Ubuntu下安装java环境

热门文章

  1. 头歌Educoder——Java高级特性 - JDBC(上)
  2. 量子计算机分解时间,量子计算机如何分解两个质数乘积
  3. 人人都能看懂的Spring源码解析,Spring如何解决循环依赖
  4. Webpack 安装
  5. 区块链搭建eos开发环境
  6. JavaGUI:多功能计算器(五)--Swing实现双语数据包+菜单切换(完整源码+EXE下载)
  7. centos ssh免密登录 多台互相免密登录
  8. Python-Flask-2023.1.22
  9. sort-选择排序法
  10. 选择适合的Node js授权认证策略