在qemu vexpress-a15平台运行xen,guest OS Dom0 Linux

1) 基于QEMU搭建XEN on ARM64的开发环境 过程主要是参考这里 对于嵌入式开发学习来说,使用QEMU模拟的开发板可以达到事半功倍的效果。 下面介绍如何在X86机器上通过QEMU模拟出arm64的开发板,如何运行XEN和Dom0。 准备x86环境 在X86机器上安装ubuntu 16.04 desktop版本,因为后面跑的Dom0是arm64 版本的ubuntu 16.04,为了后续在交叉编译的方便,推荐X86也安装ubuntu 16.04... 阅读详情

1)编译linux内核

内核下载地址:The Linux Kernel Archives

配置内核:

make vexpress_defconfig ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

在生成的.config文件中添加下面两个选项:

CONFIG_XEN_DOM0=y
CONFIG_XEN=y

编译内核:

make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

测试编译生成的linux内核镜像:

qemu-system-aarch64 -M vexpress-a15 -m 512M -kernel zImage -dtb vexpress-v2p-ca15_a7.dtb -append "init=/linuxrc root=/dev/mmcblk0 rw rootwait console=ttyAMA0" -nographic


2)制作busybox根文件系统

busybox下载地址:https://busybox.net/

配置busybox:

make menuconfig

#   勾选  Settings-> [*] Build static binary (no shared libs)

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4

make install

创建rootfs image镜像:

$ cd _install/

$ mkdir proc sys dev etc etc/init.

$ vim ./etc/init.d/rcS

##########################################

#! /bin/sh

mount -t proc none /proc

mount -t sysfs none /sys

/sbin/mdev -s

##########################################

$ chmod +x ./etc/init.d/rcS

$ find . | cpio -o --format=newc > ../rootfs.img

$ cd ..

$ gzip -c rootfs.img > rootfs.img.gz

3)配置设备树信息

计算Image.gz的大小:

printf "0x%x\n" $(stat -c %s Image.gz)

计算rootfs.img.gz的大小:

printf "0x%x\n" $(stat -c %s rootfs.img.gz)修改设备树:
# 告诉 u-boot 设备树的加载位置
fdt addr $dtb_addr_r

# 调整FDT的大小以防万一
fdt resize

# 根据$xen_bootargs设置Xen参数
fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"

#setenv bootargs $xen_bootargs # 在Xen不稳定时,xen cmdline在bootargs中

# 根据$dom0_bootargs设置Dom0参数
fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"

# 创建模块节点
fdt mknode /chosen modules
fdt set /chosen/modules '#address-cells' <1>
fdt set /chosen/modules '#size-cells' <1>

# 为位于$kernel_addr_r的linux创建节点

fdt mknode /chosen/modules module@0
fdt set /chosen/modules/module@0 compatible xen,linux-zimage xen,multiboot-module
fdt set /chosen/modules/module@0 reg <$kernel_addr_r Image.gz的大小>

fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
fdt set /chosen/module@1 reg <initrd_addr_r rootfs.img.gz的大小>


uboot引导启动Xen
booti $xen_addr_r - $dtb_addr_r

4)运行 Qemu Xen Dom0 Linux

qemu-system-aarch64 -machine vexpress-a15 -machine virtualization=true -cpu cortex-a15 -m 1024 -kernel u-boot -device loader,file=xen-uImage,force-raw=on,addr=0x80400000 -device loader,file=zImage,addr=0xa0008000 -device loader,file=vexpress-v2p-ca15_a7.dtb,addr=0x81f00000 -device loader,file=rootfs.img.gz,addr=0x82000000 -nographic

U-Boot 2019.01 (Sep 14 2021 - 02:57:40 -0700)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
=> 

设置设备树:

fdt addr 0x81f00000
fdt resize
 
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
 
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
fdt set /chosen/module@0 reg <0xa0008000 0x422998>
fdt set /chosen/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot"
fdt mknod /chosen module@1
fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
fdt set /chosen/module@1 reg <0x82000000 0x29d8f4>
bootm 0x80400000 - 0x81f00000

U-Boot 2019.01 (Sep 14 2021 - 02:57:40 -0700)

DRAM:  1 GiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
=> fdt addr 0x81f00000
=> fdt resize
=>  
=> fdt set /chosen \#address-cells <1>
=> fdt set /chosen \#size-cells <1>
=>  
=> fdt mknod /chosen module@0
=> fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
=> fdt set /chosen/module@0 reg <0xa0008000 0x422998>
=> fdt set /chosen/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot"
=> fdt mknod /chosen module@1
=> fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
=> fdt set /chosen/module@1 reg <0x82000000 0x29d8f4>
=> bootm 0x80400000 - 0x81f00000
## Booting kernel from Legacy Image at 80400000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1048584 Bytes = 1 MiB
   Load Address: 80200000
   Entry Point:  80200000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 81f00000
   Booting using the fdt blob at 0x81f00000
   Loading Kernel Image ... OK
   reserving fdt memory region: addr=81f00000 size=5000
   Loading Device Tree to 9fe60000, end 9fe67fff ... OK

Starting kernel ...

- UART enabled -
- Boot CPU booting -
- Setting up control registers -
- Turning on paging -
- Zero BSS -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 000000009fffffff
(XEN) RAM: 00000000a0000000 - 00000000bfffffff
(XEN) 
(XEN) MODULE[0]: 0000000080200000 - 000000008033e290 Xen         
(XEN) MODULE[1]: 000000009fe60000 - 000000009fe65000 Device Tree 
(XEN) MODULE[2]: 0000000082000000 - 000000008229d8f4 Ramdisk     
(XEN) MODULE[3]: 00000000a0008000 - 00000000a042a998 Kernel      
(XEN)  RESVD[0]: 0000000081f00000 - 0000000081f05000
(XEN)  RESVD[1]: 000000009ffbf000 - 000000009ffbf138
(XEN)  RESVD[2]: 000000009fe60000 - 000000009fe65000
(XEN) 
(XEN) CMDLINE[00000000a0008000]:chosen rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot
(XEN) 
(XEN) Command line: dom0_mem=768M console=dtuart dtuart=serial0 dom0_vcpus_pin hmp-unsafe=true dom0_max_vcpus=2 bootscrub=0 loglvl=all
(XEN) PFN compression on bits 18...18
(XEN) Xen heap: 00000000be000000-00000000c0000000 (8192 pages)
(XEN) Dom heap: 253952 pages
(XEN) Domain heap initialised
(XEN) Booting using Device Tree
(XEN) Platform: VERSATILE EXPRESS
(XEN) Looking for dtuart at "serial0", options ""
 Xen 4.17-unstable
(XEN) Xen version 4.17-unstable (hdwei@) (arm-linux-gnueabihf-gcc (Linaro GCC 6.5-2018.12) 6.5.0) debug=y Fri Feb 11 08:15:37 PST 2022
(XEN) Latest ChangeSet: Tue Feb 1 18:03:21 2022 +0100 git:3457460
(XEN) build-id: 6d2190a52f826f15ad6a60cebfbf25cb9da162f0
(XEN) Processor: 412fc0f1: "ARM Limited", variant: 0x2, part 0xc0f,rev 0x1
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00001131:00011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 02010555
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 20000000
(XEN)                          01240000 02102211
(XEN)   ISA Features: 02101110 13112111 21232041
(XEN)                 11112131 10011142 00000000
(XEN) Set SYS_FLAGS to 00000000802000d4 (002000d4)
(XEN) SMP: Allowing 1 CPUs
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 62500 KHz
(XEN) GICv2 initialization:
(XEN)         gic_dist_addr=000000002c001000
(XEN)         gic_cpu_addr=000000002c002000
(XEN)         gic_hyp_addr=000000002c004000
(XEN)         gic_vcpu_addr=000000002c006000
(XEN)         gic_maintenance_irq=25
(XEN) GICv2: 160 lines, 1 cpu, secure (IID 00000000).
(XEN) XSM Framework v1.0.1 initialized
(XEN) Initialising XSM SILO mode
(XEN) Using scheduler: SMP Credit Scheduler rev2 (credit2)
(XEN) Initializing Credit2 scheduler
(XEN)  load_precision_shift: 18
(XEN)  load_window_shift: 30
(XEN)  underload_balance_tolerance: 0
(XEN)  overload_balance_tolerance: -3
(XEN)  runqueues arrangement: socket
(XEN)  cap enforcement granularity: 10ms
(XEN) load tracking window length 1073741824 ns
(XEN) Allocated console ring of 16 KiB.
(XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
(XEN) CPU0: Guest atomics will try 1 times before pausing the domain
(XEN) Brought up 1 CPUs
(XEN) I/O virtualisation disabled
(XEN) P2M: 40-bit IPA
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80003558
(XEN) Scheduling granularity: cpu, 1 CPU per sched-resource
(XEN) Adding cpu 0 to runqueue 0
(XEN)  First cpu on runqueue, activating
(XEN) alternatives: Patching with alt table 002d2c58 -> 002d2d48
(XEN) CPU0 will execute ICIALLU on guest exit
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading d0 kernel from boot module @ 00000000a0008000
(XEN) Loading ramdisk from boot module @ 0000000082000000
(XEN) Allocating 1:1 mappings totalling 768MB for dom0:
(XEN) BANK[0] 0x00000084000000-0x0000009c000000 (384MB)
(XEN) BANK[1] 0x000000a4000000-0x000000bc000000 (384MB)
(XEN) Grant table range: 0x00000080200000-0x00000080240000
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) The extended regions are only supported for 64-bit guest currently
(XEN) Loading zImage from 00000000a0008000 to 000000008ba00000-000000008be22998
(XEN) Loading d0 initrd from 0000000082000000 to 0x000000008c200000-0x000000008c49d8f4
(XEN) Loading d0 DTB to 0x000000008c000000-0x000000008c003e7b
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) ***************************************************
(XEN) WARNING: HMP COMPUTING HAS BEEN ENABLED.
(XEN) It has implications on the security and stability of the system,
(XEN) unless the cpu affinity of all domains is specified.
(XEN) ***************************************************
(XEN) 3... 2... 1... 
(XEN) *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)
(XEN) Freed 348kB init memory.
Booting Linux on physical CPU 0x0
Linux version 4.20.0 (hdwei@ubuntu) (gcc version 6.5.0 (Linaro GCC 6.5-2018.12)) #1 SMP Fri Feb 11 06:19:15 PST 2022
CPU: ARMv7 Processor [412fc0f1] revision 1 (ARMv7), cr=10c5387d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
OF: fdt: Machine model: V2P-CA15_CA7
OF: fdt: Ignoring memory range 0x84000000 - 0x88000000
earlycon: xenboot0 at I/O port 0x0 (options '')
printk: bootconsole [xenboot0] enabled
Memory policy: Data cache writealloc
Xen 4.17 support found
psci: probing for conduit method from DT.
psci: PSCIv1.1 detected in firmware.
psci: Using standard PSCI v0.2 function IDs
psci: Trusted OS migration not required
psci: SMC Calling Convention v1.1
random: get_random_bytes called from start_kernel+0x9c/0x464 with crng_init=0
percpu: Embedded 17 pages/cpu @(ptrval) s37772 r8192 d23668 u69632
Built 1 zonelists, mobility grouping on.  Total pages: 178560
Kernel command line: rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 700772K/720896K available (7168K kernel code, 406K rwdata, 1456K rodata, 1024K init, 165K bss, 20124K reserved, 0K cma-reserved)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xb4800000 - 0xff800000   (1200 MB)
    lowmem  : 0x80000000 - 0xb4000000   ( 832 MB)
    modules : 0x7f000000 - 0x80000000   (  16 MB)
      .text : 0x(ptrval) - 0x(ptrval)   (8160 kB)
      .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
      .data : 0x(ptrval) - 0x(ptrval)   ( 407 kB)
       .bss : 0x(ptrval) - 0x(ptrval)   ( 166 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
rcu: Hierarchical RCU implementation.
rcu: 	RCU event tracing is enabled.
rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER4
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER8
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER12
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER16
(XEN) d0v0: vGICD: unhandled word write 0xffffffff to ICACTIVER0
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@8000000/motherboard/iofpga@3,00000000/timer@120000': -22
arch_timer: cp15 timer(s) running at 62.50MHz (virt).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns
sched_clock: 56 bits at 62MHz, resolution 16ns, wraps every 4398046511096ns
Switching to timer-based delay loop, resolution 16ns
Console: colour dummy device 80x30
printk: console [hvc0] enabled
printk: console [hvc0] enabled
printk: bootconsole [xenboot0] disabled
printk: bootconsole [xenboot0] disabled
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: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
/cpus/cpu@0 missing clock-frequency property
/cpus/cpu@1 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
xen:grant_table: Grant tables using version 1 layout
Grant table initialized
xen:events: Using FIFO-based ABI
Xen: initializing cpu0
Setting up static identity map for 0x88100000 - 0x88100060
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
(XEN) d0v1: vGICD: unhandled word write 0xffffffff to ICACTIVER0
Xen: initializing cpu1
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU1: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable
smp: Brought up 1 node, 2 CPUs
SMP: Total of 2 processors activated (250.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes)
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at drivers/mfd/vexpress-sysreg.c:189 vexpress_sysreg_probe+0x19c/0x1d4
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0 #1
Hardware name: ARM-Versatile Express
[<801113ec>] (unwind_backtrace) from [<8010d2b0>] (show_stack+0x10/0x14)
[<8010d2b0>] (show_stack) from [<806e8ad4>] (dump_stack+0x84/0x98)
[<806e8ad4>] (dump_stack) from [<80121360>] (__warn+0xf8/0x110)
[<80121360>] (__warn) from [<8012148c>] (warn_slowpath_null+0x40/0x48)
[<8012148c>] (warn_slowpath_null) from [<804c2790>] (vexpress_sysreg_probe+0x19c/0x1d4)
[<804c2790>] (vexpress_sysreg_probe) from [<8049ae1c>] (platform_drv_probe+0x48/0x9c)
[<8049ae1c>] (platform_drv_probe) from [<80498f8c>] (really_probe+0x1cc/0x2b0)
[<80498f8c>] (really_probe) from [<804991d4>] (driver_probe_device+0x60/0x164)
[<804991d4>] (driver_probe_device) from [<804993b4>] (__driver_attach+0xdc/0xe0)
[<804993b4>] (__driver_attach) from [<804972d0>] (bus_for_each_dev+0x68/0xb4)
[<804972d0>] (bus_for_each_dev) from [<80498398>] (bus_add_driver+0x104/0x210)
[<80498398>] (bus_add_driver) from [<80499f3c>] (driver_register+0x78/0x10c)
[<80499f3c>] (driver_register) from [<80102e08>] (do_one_initcall+0x54/0x1fc)
[<80102e08>] (do_one_initcall) from [<80a010e0>] (kernel_init_freeable+0x28c/0x380)
[<80a010e0>] (kernel_init_freeable) from [<80700a70>] (kernel_init+0x8/0x10c)
[<80700a70>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
Exception stack(0xb3493fb0 to 0xb3493ff8)
3fa0:                                     00000000 00000000 00000000 00000000
3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace ba986b74276595f6 ]---
vexpress-sysreg 1c010000.sysreg: DT HBI (249) is not matching hardware (237)!
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
xen:swiotlb_xen: Warning: only able to allocate 4 MB for software IO TLB
software IO TLB: mapped [mem 0xbac00000-0xbb000000] (4MB)
hw-breakpoint: Failed to enable monitor mode on CPU 0.
Serial: AMBA PL011 UART driver
1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 30, base_baud = 0) is a PL011 rev1
1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 31, base_baud = 0) is a PL011 rev1
1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 32, base_baud = 0) is a PL011 rev1
OF: amba_device_add() failed (-19) for /smb@8000000/motherboard/iofpga@3,00000000/wdt@f0000
OF: amba_device_add() failed (-19) for /wdt@2a490000
OF: amba_device_add() failed (-19) for /memory-controller@2b0a0000
OF: amba_device_add() failed (-19) for /memory-controller@7ffd0000
OF: amba_device_add() failed (-19) for /dma@7ff00000
OF: amba_device_add() failed (-19) for /etb@20010000
OF: amba_device_add() failed (-19) for /tpiu@20030000
OF: amba_device_add() failed (-19) for /funnel@20040000
OF: amba_device_add() failed (-19) for /ptm@2201c000
xen:balloon: Initialising balloon driver
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 arch_sys_counter
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 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.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 2680K
failed to build OPP table
workingset: timestamp_bits=30 max_order=18 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 noop registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
clcd-pl11x 1c1f0000.clcd: PL111 designer 41 rev2 at 0x1c1f0000
clcd-pl11x 1c1f0000.clcd: clcd@1f0000 hardware, 640x480@59 display
Console: switching to colour frame buffer device 80x30
xen:xen_evtchn: Event-channel device installed
brd: module loaded
Invalid max_queues (4), will use default max: 2.
8000000.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
8000000.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): "8000000.flash"
(1): "8000000.flash"
into device "8000000.flash"
libphy: Fixed MDIO Bus: probed
smsc911x 1a000000.ethernet: Linked as a consumer to regulator.1
libphy: smsc911x-mdio: probed
smsc911x 1a000000.ethernet eth0: MAC Address: 52:54:00:12:34:56
xen_netfront: Initialising Xen virtual ethernet driver
isp1760 1b000000.usb: bus width: 32, oc: digital
isp1760 1b000000.usb: NXP ISP1760 USB Host Controller
isp1760 1b000000.usb: new USB bus registered, assigned bus number 1
isp1760 1b000000.usb: Scratch test failed.
isp1760 1b000000.usb: can't setup: -19
isp1760 1b000000.usb: USB bus 1 deregistered
usbcore: registered new interface driver usb-storage
rtc-pl031 1c170000.rtc: registered as rtc0
mmci-pl18x 1c050000.mmci: Got CD GPIO
mmci-pl18x 1c050000.mmci: Got WP GPIO
mmci-pl18x 1c050000.mmci: Linked as a consumer to regulator.1
mmci-pl18x 1c050000.mmci: mmc0: PL181 manf 41 rev0 at 0x1c050000 irq 26,27 (pio)
input: AT Raw Set 2 keyboard as /devices/platform/smb@8000000/smb@8000000:motherboard/smb@8000000:motherboard:iofpga@3,00000000/1c060000.kmi/serio0/input/input0
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
aaci-pl041 1c040000.aaci: ARM AC'97 Interface PL041 rev0 at 0x1c040000, irq 25
aaci-pl041 1c040000.aaci: FIFO 512 entries
oprofile: no performance counters
oprofile: using timer interrupt.
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
Registering SWP/SWPB emulation handler
rtc-pl031 1c170000.rtc: setting system clock to 2022-02-12 13:56:41 UTC (1644674201)
ALSA device list:
  #0: ARM AC'97 Interface PL041 rev0 at 0x1c040000, irq 25
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/smb@8000000/smb@8000000:motherboard/smb@8000000:motherboard:iofpga@3,00000000/1c070000.kmi/serio1/input/input2
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
mount: mounting tmpfs on /tmp failed: No such file or directory
Generic PHY 1a000000.ethernet-ffffffff:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1a000000.ethernet-ffffffff:01, irq=POLL)
smsc911x 1a000000.ethernet eth0: SMSC911x/921x identified at 0xb51d0000, IRQ: 23

Please press Enter to activate this console. 
[root@vexpress ]#

可以把设置设备树的步骤写入设备树:

chosen {
	bootargs = "dom0_mem=768M console=dtuart dtuart=serial0 dom0_vcpus_pin hmp-unsafe=true dom0_max_vcpus=2 bootscrub=0 loglvl=all";

	/delete-property/stdout-path;

	xen,dom0-bootargs = "console=hvc0 root=/dev/ram rdinit=/sbin/init rw rootwait clk_ignore_unused";

	modules {
		#address-cells = <1>;
		#size-cells = <1>;

		module@1 {
			compatible = "xen,linux-zimage", "xen,multiboot-module";
			reg = <0xa0008000 0x422998>;
		};

		module@2 {
			compatible = "xen,linux-initrd", "xen,multiboot-module";
			reg = <0x82000000 0x29d8f4>;
		};
	};
};

进入uboot之后,可直接引导启动xen,bootm 0x80400000 - 0x81f00000。

已编译好的可执行文件

[Hypervisor]Xen On Qemu for arm64-复现 由于我的第一份工作也是有关hypervisor虚拟化的,此前玩过minos-hypervisor,但是与xen-hypervisor相比代码量与稳定性都相差较大,我找了很多帖子,有关xen的项目都很零碎,在csdn看到了一篇文章,参考这篇文章复现利用xen实现双系统的运行。。这篇文章也是为了记录复现时遇到的问题,及其解决办法,欢迎讨论交流。文中提到的log和脚本的源文件在文章末尾下载,复现有其他问题欢迎联系交流:1665575244@qq.comxen-4.12.0。 阅读详情

相关推荐

【网络存储技术】

文章目录一、HUAWEI HCIA存储技术趋势与智能存储组件1.存储趋势1.1 数据、信息与数据存储什么是数据?数据的种类?数据的处理周期什么是信息?数据与信息的关系1.2数据存储系统数据存储分类存储架构历程:分布式存储存储虚拟化1.3存储介质的发展1.4存储产品的发展趋势2.智能存储组件2.1控制框2.2硬盘框2.3硬盘2.4接口模块二、虚拟化与网络存储技术1.虚拟化技术1.1XEN虚拟化技术简介1.2KVM虚拟化技术简介1.3红帽RHEV虚拟化系统简介1.4其他虚拟化技术介绍2.Qemu-KVm2.1K

weixin_56947109的博客 1997

在qemu vexpress-a15平台运行xen, guest OS Dom0 Linux和guest OS DomU1 Linux

在qemu vexpress-a15平台运行xen, guest OS Dom0 Linux和guest OS DomU1 Linux

small_process的博客 749

i.MX6Q_Uboot2016_linaro gcc 6.5 编译

文章目录(一)Ubuntu 20.04 中植入 linaro gcc 6.51. linaro官网下载6.5版本交叉编译工具链2. 安装路径:/usr/local/arm3. 配置/etc/profile(二)编译环境安装1. 安装build-essential2. 安装libncurses5-dev2.1 缺少libncurses5-dev报的错误3. 安装 lzop3.1 缺少lzop报的错误(三)编译 U-boot1. 清理工程2. 配置工程3. 编译U-boot3.1 问题 error:bad va

weixin_46201756的博客 514

使用dtb文件引导内核

在 QEMU 以 vexpress-a15运行 3.10.28内核的时候,刚开始 boot之后就停住了。

小猪爱拱地 7616

Xen on qemu for arm64: 由qemu-system-aarch64导致的kernel-panic

我在A平台利用qemu实现了xen中dom0的运行,将其移植到B平台运行,dom0的复现遭遇了kernel-panic,在虚拟设备的添加时异常。

weixin_48175016的博客 2209

该资源系qemu xen vexpress-a15 运行虚拟guest OS资料

u-boot:vexpress-a15 u-boot镜像 xen-uImage:xen镜像 zImage:linux内核镜像 rootfs.img.gz:busybox文件系统镜像 vexpress-v2p-ca15_a7.dtb:设备树二进制文件

在qemu vexpress-a15平台运行xen

Xen ARM with Virtualization

small_process的博客 1285

告别VMware Tools!用open-vm-tools在Ubuntu 22.04上搞定共享文件夹(附开机自动挂载)

本文详细介绍了在Ubuntu 22.04上使用open-vm-tools替代VMware Tools实现高效共享文件夹管理的方法。通过开源工具open-vm-tools,用户可避免传统方案的兼容性问题,享受自动适配内核、系统更新同步等优势。文章包含从安装配置到开机自动挂载的全流程指导,特别适合在VMware虚拟机中运行Ubuntu Desktop的开发者提升工作效率。

weixin_32520095的博客 584

在qemu vexpress-a15平台运行xen,guest OS Dom0 Mini-OS(Rtos)和Dom1 Linux

在qemu vexpress-a15平台运行xen,guest OS Dom0 Mini-OS(Rtos)和Dom1 Linux

small_process的博客 655

烽火HG680-LC刷机后体验:当贝纯净桌面+讯飞语音,老盒子秒变智能电视的折腾记录

本文详细记录了烽火HG680-LC机顶盒刷机后的使用体验,通过安装当贝纯净桌面和讯飞语音助手,老盒子焕发新生,实现无广告、快速响应的智能电视功能。文章对比了刷机前后的性能差异,分享了影音播放、语音控制等实用功能,并提供了ADB调试和问题解决的实用技巧,帮助用户将闲置的运营商盒子变身为高性能的智能影音中心。

weixin_30292843的博客 471

Pyside6实战:3种.ui文件加载方式对比(附完整代码示例)

本文深入解析Pyside6中3种.ui文件加载方式的优劣与性能优化策略,包括动态加载QUiLoader、预编译方案及混合策略。通过实测数据和完整代码示例,帮助开发者根据项目需求选择最优解,提升界面加载效率与内存管理。

weixin_30897233的博客 89

Qemu搭建ARM vexpress开发环境(一)

嵌入式软件开发依赖于嵌入式硬件设备,比如:开发板、外部模块设备等,但是如果只是想学习、研究Linux内核,想学习Linux内核的架构,工作模式,需要修改一些代码,重新编译并烧写到开发板中进行验证,这样未必有些复杂,并且为此专门购买各种开发版,浪费资金,开会演示效果还需要携带一大串的板子和电线,不胜其烦。然而Qemu的使用可以避免频繁在开发板上烧写版本,如果进行的调试工作与外设无关,仅仅是内核方面的调试,Qemu模拟ARM开发环境完全可以完美地胜任。目录下面简单介绍下我的Qemu开发环境搭建过程。

kunkliu的博客 1272

当启动容器的时候提示:exec format error?如何解决问题

Docker容器出现"exec format error"的主要原因是架构不兼容(如ARM设备运行x86镜像)。解决方案包括:1)匹配镜像与宿主机架构;2)构建时指定平台;3)安装QEMU模拟器;4)修复文件权限和格式;5)验证基础镜像兼容性。排查流程应从检查架构匹配开始,逐步验证权限、解释器和换行符等问题。建议优先使用多架构镜像,构建时明确指定平台,并使用buildx工具生成多平台镜像。调试时可进入容器手动验证文件格式和兼容性。

weixin_39291964的博客 2719

TrustZone——开发环境—QEMU

由于FastModels是收费的,所以例子希望能够在QEMU中运行。 经过不停的尝试和崩溃。RTSM_VE的例子,可以通过QEMU启动了。 qemu-system-arm -M vexpress-a15 -m 256M -serial stdio -kernel RTSM_VE_CLI_V7.axf -sd ~/ARM/FastModelsPortfolio_8.2/images/RTSM

TrustZone领域先行者 6592

lammps模拟技巧:高熵合金势函数设置三种方法

大家好,我是小马老师。 本文继续介绍lammps模拟中的势函数设置方法。 在前面的文章中,介绍过高熵合金的建模:高熵合金建模 高熵合金包含的原子数较多,势函数的设置相对复杂,在平时一对一的咨询中,这种问题也相对较多。 下面介绍三种高熵合金势函数设置方法。 1.下载专用势函数 下面的网站包含了大多数原子的势函数: https://www.ctcms.nist.gov/potentials/ 如需下载包含Fe原子的势函数,直接点Fe: 出现势函数列表: 比如Al-Co-Cr-Fe-Ni就是高熵合金AlCoC

lammps_jiayou的博客 8962

24. SAP UI5 应用如何使用 OData 数据模型

本教程之前的二十三个步骤,使用的数据模型都是 JSON 模型。从本步骤开始,我们要学习另一种非常重要的数据模型:OData 数据模型。 OData 数据模型也是 SAP 产品里广泛使用的数据模型,比如 SAP S/4HANA,SAP CRM Fiori 应用等等,都使用的是 OData 数据模型而不是 JSON 数据模型。 使用 OData 数据模型的典型场景就是,通过 OData 模型提供的 Read API,将远端服务器上存储的数据通过 OData 协议读取到客户端,并显示在 SAP UI5 应用里。.

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 5797

qemu实践一:arm + linux + u-boot + NFS

一、基本环境 二、qemu 安装 三、开发板简介 四、编译 Linux 内核和 dtb 文件 五、使用 busybox 制作根文件系统 六、使用 u-boot 加载 Linux 内核 七、挂载 NFS 文件系统 八、完善根文件系统 九、在虚拟板上运行应用和内核驱动...

qq_20023231的博客 2273

ABAP CDS SELECT, parameters 全面解析:把参数化视图玩明白(含可运行示例)

这篇技术博客介绍了ABAP CDS中参数化视图的用法与实践。文章从业务需求出发,解释了参数化视图的必要性,并详细说明了语法规则、参数类型匹配、视图内部参数引用等关键点。重点展示了在JOIN和ASSOCIATION中传递参数的写法,提供了航线分析的完整业务案例和可运行代码示例。文章还总结了视图实体与DDIC视图的差异、会话变量使用技巧等实践要点,特别强调了JOIN中必须显式传参的语法要求。通过真实场景演示,帮助开发者掌握参数化CDS的高效应用。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 363

qemu模拟A9/A15运行Linux4.2.3

根据http://www.linuxidc.com/Linux/2012-07/65478p2.htm修改 1.安装qemu sudo apt-get install qemu-system 2.安装arm编译工具 sudo apt-get insatll gcc-arm-linux-gnueabi 3.下载Linux内核 https://cdn.kernel.org/pub/

人工智能 1718

《AI Coding手册:Claude Code、OpenAI Codex、OpenClaw深度解析与实战指南》

AI编码技术经历了从简单规则匹配到深度神经网络,再到当前智能体(Agent)架构的范式转变。第一阶段:静态代码补全(2010-2018)早期工具如IntelliSense、Emmet基于语法分析和固定模板提供代码提示。这类系统依赖预定义规则,缺乏语义理解能力,仅能处理局部代码片段。第二阶段:统计语言模型(2018-2020)以GPT-2、TabNine为代表,引入基于大规模代码训练的神经语言模型。

AI天才研究院 1033

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

五分钟搞懂Xen、KVM、Qemu间的关系和区别

Qemu是一套独立的虚拟化解决方案,KVM是另一套虚拟化解决方案,不过因为这个方案实际上只实现了内核中对处理器(Intel VT, AMDSVM)虚拟化特性的支持,换言之,它缺乏设备虚拟化以及相应的用户空间管理虚拟机的工具,所以它借用了QEMU的代码并加以精简,连同KVM一起构成了另一个独立的虚拟化解决方案,不妨称之为:KVM+QEMU.。Xen是另一套独立的虚拟化解决方案,最初的Xen只支持半虚拟化,Intel VT技术出现后,添加了全虚拟化功能,这个全虚拟化功能也是借助了qemu实现,但不是完全依赖qe

YSBJ123的博客 4万+

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Uboot启动Xen的过程

背景基于Xen On Qemu for arm64项目,解读uboot-2019启动xen-4.15的源码结构。

weixin_48175016的博客 563

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

CPU虚拟化

虚拟化概念 Qemu-KVM虚拟机 – 核心由Qemu和KVM两部分组成,Qemu本身是一个独立的虚拟机 软件,运行在OS的用户态;KVM是Linux的内核模块,利用CPU 硬件虚拟化特性对CPU和内存虚拟化进行加速 – Libvirt是对KVM虚拟机进行管理的工具和应用编程接口 – Virsh是Linux下管理KVM虚拟机的命令行接口,它基于libvirt API 工作 – Virt-manager是一个Linux上的GUI程序,实现对KVM虚拟机的图 形化管理,也是基于libvirt API工作 **

u012413204的博客 7003

arm-linux-gnueabihf-gcc 工具链编译报错

环境:ubuntu 14.04 64bit 一、刚开始的时候报错信息如下: arm-linux-gnueabihf-gcc: command not found.(确认不是PATH问题) 出现这种情况的原因是:在64位Linux系统下无法兼容32位交叉编译器。 安装32位兼容包解决该问题 sudoapt-get install lib32ncurses5 lib32z1 运...

zgp2917的专栏 6876

xen虚拟机的常见引导方式

1、在配置文件中直接指向存放在dom0上的domU的内核(半虚拟化和全虚拟化皆可) kernel = "/boot/vmlinuz-2.6.18.8-xenU" xen还提供bootloader,用于虚拟机启动时使用存储在domU内的内核引导 2、pygrub(半虚拟化) bootloader = "/usr/bin/pygrub" 3、hvmloader(全虚拟化)

eason3307的专栏 741
上一篇: 在xen virt平台运行xen
下一篇: 在qemu virt平台运行xen,guest OS Dom0 Linux和Dom1 Linux
-逐鹿中原
博客等级 码龄9年 44粉丝 24原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值