...
Code Block | ||
---|---|---|
| ||
dtc -I dts -O dtb xen.dts > xen.dtb |
Use this xen-rootfs-custom.cpio.gz for dom0 as it has /boot/xen-Image and /boot/xen-rootfs.cpio.gz
The following is the config file to be used with imagebuilder/scripts/uboot-script-gen
Code Block | ||||
---|---|---|---|---|
| ||||
MEMORY_START="0x0"
MEMORY_END="0x80000000"
DEVICE_TREE="xen.dtb"
XEN="xen"
DOM0_KERNEL="xen-Image"
DOM0_RAMDISK="xen-rootfs-custom.cpio.gz"
NUM_DOMUS=0
UBOOT_SOURCE="boot.source"
UBOOT_SCRIPT="boot.scr" |
When dom0 boots up, one can confirm that ethernet is not up.
Code Block | ||||
---|---|---|---|---|
| ||||
root@xilinx-zcu102-2021_2:/etc/xen# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
|
Edit /etc/xen/example-passnet.cfg to make it as follows
Code Block | ||||
---|---|---|---|---|
| ||||
name = "guest0"
kernel = "/boot/xen-Image"
ramdisk = "/boot/xen-rootfs.cpio.gz"
extra = "console=hvc0 rdinit=/sbin/init root=/dev/ram0 init=/bin/sh"
memory = 1024
vcpus = 2
dtdev = [ "/amba/ethernet@ff0e0000" ]
device_tree = "/etc/xen/passthrough-example-part.dtb"
irqs = [ 95 ]
iomem = [ "0xff0e0,1" ] |
Then, boot the guest0
Code Block | ||||
---|---|---|---|---|
| ||||
xl create -c example-passnet.cfg |
And confirm that guest0 can access ethernet
Code Block | ||||
---|---|---|---|---|
| ||||
root@xilinx-zcu102-2021_2:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:01
inet addr:10.0.2.16 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::20a:35ff:fe00:2201/64 Scope:Link
inet6 addr: fec0::20a:35ff:fe00:2201/64 Scope:Site
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:134 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1824 (1.7 KiB) TX bytes:36092 (35.2 KiB)
Interrupt:13
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
Starting a Guest with a Passthrough SD Card
...
For MMC assignment to a dom0less guest, use the attached partial device tree binary:
passthrough-example-part-dom0less.dtb
To use it, just add it to your ImageBuilder config as follows:
...
theme | Midnight |
---|
...
:
passthrough-example-part-dom0less.dtb
To use it, the following are the contents of the ImageBuilder config:
Code Block | ||
---|---|---|
| ||
MEMORY_START="0x0" MEMORY_END="0x80000000" DEVICE_TREE="xen.dtb" XEN="xen" DOM0_KERNEL="xen-Image" DOM0_RAMDISK="xen-rootfs-custom.cpio.gz" DOMU_KERNEL[0]="xen-Image" DOMU_RAMDISK[0]="initrdxen-rootfs-custom.cpio.gz" DOMU_PASSTHROUGH_DTB[0]="passthrough-example-part-dom0less.dtb" NUM_DOMUS=1 UBOOT_SOURCE="boot-dom0less.source" UBOOT_SCRIPT="boot-dom0less.scr" |
Regenerate the boot.scr and boot.source scripts as usual with ImageBuilder’s uboot-script-gen.
...