We're no longer updating This wiki!!

This is an old revision of the document!


Virtualization using Xen on ODROID-XU3/4

This page contains the step-by-step guide for virtualization using Xen on ODROID-XU3/4.

HOST-PC Environments:

  • Ubuntu 14.04 LTS Desktop
  • SD card device name assumption: /dev/sdc
  • SD card mount point assumption: /media/boot, /media/rootfs

Basic preparation

SD card or eMMC basic platform preparation:

$ wget http://odroid.in/ubuntu_14.04lts/ubuntu-14.04lts-server-odroid-xu3-20150725.img.xz
$ unxz ubuntu-14.04lts-server-odroid-xu3-20150725.img.xz
$ sudo dd if=ubuntu-14.04lts-server-odroid-xu3-20150725.img.xz of=/dev/sdc bs=1M conv=fsync
$ sync

Bootloader

Bootloader must enable HYP mode to support virtualization before jump to kernel. So, it is needed to reinstall bootloader.

Install Bootloader to support HYP mode:

$ git clone https://github.com/hardkernel/u-boot.git -b odroidxu3-v2012.07
$ cd u-boot
$ make odroid_config
$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j8
$ cd sd_fuse/hardkernel
$ sudo ./sd_fusing.sh /dev/sdc
$ sync

Changing boot.ini file for virtualization:

$ wget http://git.io/vCu3c -O boot.ini
$ sudo cp -f boot.ini /media/boot/
$ sync
boot.ini
ODROIDXU-UBOOT-CONFIG
# source by kenken> http://forum.odroid.com/viewtopic.php?f=98&t=6643#p64051
setenv dtb_addr_r 0x42000000
setenv dtb_path /exynos5422-odroidxu3.dtb

setenv kernel_addr_r 0x60000000
setenv kernel_path /zImage

setenv xen_addr_r 0x50000000
setenv xen_path /xen

# use the A7s for dom0 and pin them to it
setenv xen_bootargs sync_console console=dtuart dtuart=/serial@12C20000 dom0_mem=800M dom0_max_vcpus=4 dom0_vcpus_pin

# edid/1280x720.bin
#setenv dom0_bootargs console=hvc0 earlyprintk debug clk_ignore_unused psci=enable root=/dev/mmcblk0p2 rootwait rw drm_kms_helper.edid_firmware=edid/1280x720.bin

# edid/1920x1080.bin
setenv dom0_bootargs console=hvc0 earlyprintk debug clk_ignore_unused psci=enable root=/dev/mmcblk0p2 rootwait rw

## Load the different components
setenv dev "mmc 0:1"

# Load Linux in memory
fatload $dev $kernel_addr_r $kernel_path
setenv kernel_size 0x$filesize

# Load Xen in memory
fatload $dev $xen_addr_r $xen_path

# Load the device tree in memory
fatload $dev $dtb_addr_r $dtb_path

## Fixup the device tree
# Be sure U-boot is using our FDT
fdt addr $dtb_addr_r

# Resize the FDT just in case
fdt resize

# Set Xen arguments based on $xen_bootargs
fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"

# Set Dom0 arguments based on $dom0_bootargs
fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"

# Create modules node
fdt mknode /chosen modules
fdt set /chosen/modules '#address-cells' <1>
fdt set /chosen/modules '#size-cells' <1>

# Create node for the linux located at $kernel_addr_r
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 $kernel_size>
fdt print /chosen

## Boot Xen
bootz $xen_addr_r - $dtb_addr_r 

Xen Hypervisor

Getting the xen soruce code:

$ git clone https://github.com/bkrepo/xen.git
$ cd xen

Build & Installation:

$ make dist-xen CROSS_COMPILE=arm-none-eabi- XEN_TARGET_ARCH=arm32 debug=y CONFIG_EARLY_PRINTK=exynos5250 -j8
$ sudo cp xen/xen /media/boot/
$ sync

Domain 0 Linux kernel

Build & Installation:

$ git clone https://github.com/bkrepo/linux-dom0.git
$ cd linux-dom0
$ make odroidxu3_xen_defconfig ARCH=arm
$ make ARCH=arm CROSS_COMPILE=arm-none-eabi- -j8
$ sudo make modules_install ARCH=arm INSTALL_MOD_PATH=/media/rootfs/
$ cp -f arch/arm/boot/zImage arch/arm/boot/dts/exynos5422-odroidxu3.dtb /media/boot/
$ sync
en/xu4_xen.1444968938.txt.gz · Last modified: 2015/10/16 12:45 by brian.kim
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0