...
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 |
---|
language | bash |
---|
theme | Midnight |
---|
|
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 |
---|
language | bash |
---|
theme | Midnight |
---|
|
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 |
---|
language | bash |
---|
theme | Midnight |
---|
|
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 = [ "/axi/ethernet@ff0e0000" ]
device_tree = "/etc/xen/passthrough-example-part.dtb"
irqs = [ 95 ]
iomem = [ "0xff0e0,1" ] |
Then, boot the guest0
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
xl create -c example-passnet.cfg |
And confirm that guest0 can access ethernet
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
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
...