赞
踩
作者 | 将狼才鲸 |
---|---|
日期 | 2024-03-01 |
先下载源码和编译程序:
我准备在QEMU模拟器中运行ARM Cortex-M4的轻型开源鸿蒙系统
在电脑上安装QEMU模拟器软件,可以在Windows下安装,也可以在Linux发行版下安装
Ubuntu回到OpenHarmony源码根目录下,使用命令行用QEMU模拟器运行开源鸿蒙系统
这是开源鸿蒙在QEMU硬件模拟器中运行的结果,在网口时程序跑飞了,可能源码中对QEMU Cortex-M4的适配有点问题,你也可以再尝试一下别的QEMU开发板,步骤和上述流程一样的:
jim@ubuntu:~/openHarmony$ ./qemu-run -e out/arm_mps2_an386/qemu_mini_system_demo/OHOS_Image board: arm_mps2_an386 Enter to start qemu[y/n]:entering kernel init... LfsLowLevelInit: DiskPartition succeed LfsLowLevelInit: PartitionFormat succeed LfsLowLevelInit: mount fs on '/littlefs' succeed LfsLowLevelInit: mkdir '/littlefs' succeed tcpip_init start *************Exception Information************** Type = 11 ThrdPid = 25 Phase = exc in task FaultAddr = 0xabababab Current task info: Task name = (null) Task ID = 25 Task SP = (nil) Task ST = 0x0 Task SS = 0x0 Exception reg dump: PC = 0x2100e62a LR = 0x2101b045 SP = 0x210b18e0 R0 = 0x210a725c R1 = 0x200 R2 = 0x210a725c R3 = 0x2108a9b3 R4 = 0x0 R5 = 0x0 R6 = 0x0 R7 = 0x210b18e8 R8 = 0x0 R9 = 0x0 R10 = 0x0 R11 = 0x0 R12 = 0xc8000000 PriMask = 0x0 xPSR = 0x610f0000 ----- backtrace start ----- backtrace 0 -- lr = 0x21015178 backtrace 1 -- lr = 0x2101b044 backtrace 2 -- lr = 0x210235da backtrace 3 -- lr = 0x210235e2 backtrace 4 -- lr = 0x2102379a ----- backtrace end ----- qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1) R00=210b2ad0 R01=2109fa3f R02=210a18f8 R03=6c0da998 R04=00000000 R05=00000060 R06=00000018 R07=210b1708 R08=00000019 R09=000003e8 R10=218ba1e8 R11=00000000 R12=00000000 R13=210b1708 R14=210011db R15=21000fcc XPSR=21030006 --C- T handler s00=00000000 s01=00000000 d00=0000000000000000 s02=00000000 s03=00000000 d01=0000000000000000 s04=00000000 s05=00000000 d02=0000000000000000 s06=00000000 s07=00000000 d03=0000000000000000 s08=00000000 s09=00000000 d04=0000000000000000 s10=00000000 s11=00000000 d05=0000000000000000 s12=00000000 s13=00000000 d06=0000000000000000 s14=00000000 s15=00000000 d07=0000000000000000 s16=00000000 s17=00000000 d08=0000000000000000 s18=00000000 s19=00000000 d09=0000000000000000 s20=00000000 s21=00000000 d10=0000000000000000 s22=00000000 s23=00000000 d11=0000000000000000 s24=00000000 s25=00000000 d12=0000000000000000 s26=00000000 s27=00000000 d13=0000000000000000 s28=00000000 s29=00000000 d14=0000000000000000 s30=00000000 s31=00000000 d15=0000000000000000 FPSCR: 00000000 /home/jim/openHarmony/vendor/ohemu/qemu_mini_system_demo/qemu_run.sh: line 95: 50440 Aborted (core dumped) qemu-system-arm -M mps2-an386 -m 16M -kernel $elf_file $qemu_option -append "root=dev/vda or console=ttyS0" -nographic jim@ubuntu:~/openHarmony$
D:\Program Files\qemu>qemu-system-arm -M mps2-an386 -cpu cortex-m4 -kernel OHOS_Image -serial stdio -nodefaults -nographic qemu-system-arm: warning: nic lan9118.0 has no peer entering kernel init... LfsLowLevelInit: DiskPartition succeed LfsLowLevelInit: PartitionFormat succeed LfsLowLevelInit: mount fs on '/littlefs' succeed LfsLowLevelInit: mkdir '/littlefs' succeed tcpip_init start *************Exception Information************** Type = 11 ThrdPid = 25 Phase = exc in task FaultAddr = 0xabababab Current task info: Task name = (null) Task ID = 25 Task SP = (nil) Task ST = 0x0 Task SS = 0x0 Exception reg dump: PC = 0x2100e62a LR = 0x2101b045 SP = 0x210b18e0 R0 = 0x210a725c R1 = 0x200 R2 = 0x210a725c R3 = 0x2108a9b3 R4 = 0x0 R5 = 0x0 R6 = 0x0 R7 = 0x210b18e8 R8 = 0x0 R9 = 0x0 R10 = 0x0 R11 = 0x0 R12 = 0xc8000000 PriMask = 0x0 xPSR = 0x610f0000 ----- backtrace start ----- backtrace 0 -- lr = 0x21015178 backtrace 1 -- lr = 0x2101b044 backtrace 2 -- lr = 0x210235da backtrace 3 -- lr = 0x210235e2 backtrace 4 -- lr = 0x2102379a ----- backtrace end ----- qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1) R00=210b2ad0 R01=2109fa3f R02=210a18f8 R03=6c0da998 R04=00000000 R05=00000060 R06=00000018 R07=210b1708 R08=00000019 R09=000003e8 R10=218ba1e8 R11=00000000 R12=00000000 R13=210b1708 R14=210011db R15=21000fcc XPSR=21030006 --C- T handler s00=00000000 s01=00000000 d00=0000000000000000 s02=00000000 s03=00000000 d01=0000000000000000 s04=00000000 s05=00000000 d02=0000000000000000 s06=00000000 s07=00000000 d03=0000000000000000 s08=00000000 s09=00000000 d04=0000000000000000 s10=00000000 s11=00000000 d05=0000000000000000 s12=00000000 s13=00000000 d06=0000000000000000 s14=00000000 s15=00000000 d07=0000000000000000 s16=00000000 s17=00000000 d08=0000000000000000 s18=00000000 s19=00000000 d09=0000000000000000 s20=00000000 s21=00000000 d10=0000000000000000 s22=00000000 s23=00000000 d11=0000000000000000 s24=00000000 s25=00000000 d12=0000000000000000 s26=00000000 s27=00000000 d13=0000000000000000 s28=00000000 s29=00000000 d14=0000000000000000 s30=00000000 s31=00000000 d15=0000000000000000 FPSCR: 00000000 D:\Program Files\qemu>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。