Xen ARM with Virtualization Extensions/Arndale

From Xen
Revision as of 12:17, 27 September 2013 by Julieng (talk | contribs) (Update "building Linux domu")
Jump to navigationJump to search

The Arndale board is now supported in Xen upstream.

Preparing the board

The bootloader provided with the Arndale does not let Xen boot in hypervisor mode, so we will use the u-boot provided by Linaro.

Follow the step on the Linaro wiki, to build and install u-boot.

Building Xen and Linux Dom0

First, we will build Linux for dom0 to have a device tree to provide to Xen.

You can get a tree from xenbits which is built on top of the linaro tree 13.07, ie linux 3.10.1, (last tag is arndale-130927).

Use this config file and add anything you need.

 git clone -b arndale git://xenbits.xen.org/people/julieng/linux-arm.git linux
 cd linux
 make arndale_ubuntu_defconfig
 make zImage
 make dtbs

The device tree used by the Arndale board is located in arch/arm/boot/dts/exynos5250-arndale.dtb

Then, Build Xen on ARM.

For the moment, xen doesn't build uImage for U-Boot. You can create the image with:

 mkimage -A arm -T kernel -a 0x80200000 -e 0x80200000 -C none -d "$xen_src/xen/xen" xen-uImage 

where $xen_src is the root directory of your xen git. Note that before commit 47d1a51 (xen: arm: make zImage the default target which we install) it was necessary to use $xen_src/xen/xen.bin instead.

Building linux DomU

To build linux for domU, get the source tree from the repo, which contains arndale branch (last tag is arndale-130927).

 git clone -b arndale http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git linux-domU
 cd linux-domU
 make xen_domU_defconfig
 make zImage
 make dtbs

Booting Xen and Dom0

To boot Xen and Dom0, you can use:

  • PXE: it's easier for development but you need a computer which act as a server;
  • copy binary on the SD card: when you don't have network on your board.

Once you have chosen the boot method, you can start to follow steps in the next sections. When you have finished to configure your board, you can:

  • Save the U-Boot configuration with saveenv command. The next time you want to reboot your board, you won't have to reconfigure U-Boot.
  • Boot with boot command.

Booting via PXE

The following script allow U-boot to download everything via tftp and boot xen.

  • Setup the PXE Server
  • Copy xen-uImage, the zImage (rename in linux-zImage), exynos5250-arndale.dtb in /tftpboot/
  • Copy the script in /tftpboot
 wget http://xenbits.xen.org/people/julieng/load-xen-tftp.scr.txt
 mkimage -T script -C none -d load-xen-tftp.scr.txt /tftpboot/load-xen-tftp.img
  • At U-Boot prompt, on your board, you need to set the following variable:
 setenv ipaddr 10.y.y.y
 setenv serverip 10.x.x.x
 setenv tftp_path '10.x.x.x:'
 setenv usbethaddr 00:zz:zz:zz:zz:zz
 setenv ethaddr 00:zz:zz:zz:zz:zz
 setenv xen_addr_r 0x50000000
 setenv kernel_addr_r 0x60000000
 setenv dtb_addr_r 0x42000000
 setenv script_addr_r 0x40080000
 setenv xen_path /xen-uImage
 setenv kernel_path /linux-zImage
 setenv dtb_path /exynos5250-arndale.dtb
 setenv bootcmd 'tftpboot $script_addr_r /load-xen-tftp.img; source $script_addr_r'

with:

  • 10.y.y.y the ip addr of the board
  • 10.x.x.x the ip of a tftp server (or PXE server).
  • 00:zz:zz:zz:zz:zz the MAC address of the board. You can generate it with the following
    • shell command:
 bash -c 'printf "00:16:3e:%02x:%02x:%02x\n" $(( $RANDOM % 256 )) $(( $RANDOM % 256 )) $(( $RANDOM % 256 ))'

Booting directly on the SD card

Icon Info.png The instruction are not yet update to support the latest Xen
  • Copy xen-uImage and the zImage the root directory of you SD card.
  • At U-Boot prompt, on your board, you need to set the following variable:
 setenv kernel_addr_r 0x60000000
 setenv xen_addr_r 0x50000000
 setenv bootcmd_load_linux_mmc 'ext2load mmc 1:0 $kernel_addr_r /zImage'
 setenv boot_xen_mmc 'run bootcmd_load_linux_mmc; ext2load mmc 1:0 $xen_addr_r /xen-uImage; bootm $xen_addr_r -'
 setenv bootcmd 'run boot_xen_mmc'

We assume the SD card has only 1 partition with ext2 filesystem.

  • execute the boot command with the following command:
 boot

Resources