Xen ARM with Virtualization Extensions/Arndale: Difference between revisions

From Xen
Jump to navigationJump to search
(The MAC address generator is not a good one. Give a shell command line to replace it)
(Update xen/linux tags and branches)
Line 10: Line 10:
First, we will build Linux for dom0 to have a device tree to provide to Xen.
First, we will build Linux for dom0 to have a device tree to provide to Xen.


You can get a tree from [http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git xenbits] which is built on top of Linaro's tree [https://wiki.linaro.org/Boards/Arndale/Setup/EnterpriseUbuntuServer#Build.2C_burn_uImage_and_dtb].
You can get a tree from [http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git xenbits] which is built on top of a linux 3.9-rc4 (last tag is arndale-130508).

'''WARNING''': The previous tree based on linaro's tree (linux 3.7) won't work with the new version of Xen for the arndale board.


Use this [http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git;a=blob;f=arch/arm/configs/xen_dom0_arndale_defconfig;hb=refs/heads/arndale config] file and add anything you need.
Use this [http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git;a=blob;f=arch/arm/configs/xen_dom0_arndale_defconfig;hb=refs/heads/arndale config] file and add anything you need.
Line 22: Line 24:
Use arch/arm/boot/exynos5250-arndale.dtb as a device tree provided to Xen at compile time.
Use arch/arm/boot/exynos5250-arndale.dtb as a device tree provided to Xen at compile time.


To Build, get the source tree from the [http://xenbits.xen.org/gitweb/?p=people/julieng/xen-unstable.git;a=summary repo], which contain branches with patches to get serial and other device working on the board (last tag is arndale-130424).
To Build, get the source tree from the [http://xenbits.xen.org/gitweb/?p=people/julieng/xen-unstable.git;a=summary repo], which contains a common branch with both arndale and versatile express support (last tag is arm-130508)


git clone --branch arndale git://xenbits.xen.org/people/julieng/xen-unstable.git
git clone -b arm-v2 git://xenbits.xen.org/people/julieng/xen-unstable.git


Then, [[Xen_ARMv7_with_Virtualization_Extensions#Building_Xen_on_ARM|Build Xen on ARM]], with CONFIG_DTB_FILE=$linux_tree/arch/arm/boot/exynos5250-arndale.dtb passed to make.
Then, [[Xen_ARMv7_with_Virtualization_Extensions#Building_Xen_on_ARM|Build Xen on ARM]], with CONFIG_DTB_FILE=$linux_tree/arch/arm/boot/exynos5250-arndale.dtb passed to make.

Revision as of 02:10, 8 May 2013

The work for Xen on the Arndale Development board is on his way. So don't expect to have a usable dom0 yet.

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 a linux 3.9-rc4 (last tag is arndale-130508).

WARNING: The previous tree based on linaro's tree (linux 3.7) won't work with the new version of Xen for the arndale board.

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 xen_dom0_arndale_defconfig
 make zImage
 make dtbs

Use arch/arm/boot/exynos5250-arndale.dtb as a device tree provided to Xen at compile time.

To Build, get the source tree from the repo, which contains a common branch with both arndale and versatile express support (last tag is arm-130508)

 git clone -b arm-v2 git://xenbits.xen.org/people/julieng/xen-unstable.git

Then, Build Xen on ARM, with CONFIG_DTB_FILE=$linux_tree/arch/arm/boot/exynos5250-arndale.dtb passed to make.

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.bin" xen-uImage 

where $xen_src is the root directory of your xen git.

Building linux DomU

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

 git clone -b arndale-domU-3.9 http://xenbits.xen.org/gitweb/?p=people/julieng/linux-arm.git linux-domU
 cd linux-domU
 make xen_domU_arndale_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

  • Setup the PXE Server
  • Copy xen-uImage and the zImage (rename in linux-zImage) in /tftpboot/
  • At U-Boot prompt, on your board, you need to set the following variable:
 setenv ipaddr 10.y.y.y
 setenv ipconfig 10.y.y.y
 setenv kernel_addr_r 0x60000000
 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 bootcmd_load_linux 'tftpboot $kernel_addr_r $tftp_path/linux-zImage'
 setenv boot_xen 'run bootcmd_load_linux; tftpboot $xen_addr_r $tftp_path/xen-uImage; bootm $xen_addr_r -'
 setenv bootcmd 'run boot_xen'

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

  • 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