Xen J6 System Setup

Back to Xen J6 Main Page

Overview
This wiki outlines how to setup your host machine to compile the code necessary to boot on TI's Jacinto 6 (J6) board. It also outlines how to setup the core filesystem and boot options for the system.

Package Dependencies
First, install the ARM cross-compiler, UBoot tools, git, and sbuild:

Environment Setup
Setup environment variables for the GCC compiler:

Create the directory structure. Define where your software directory will be located (this will be referenced in later steps):

Clone Repository Sources
This project is still in progress, so the git repositories with our changes needed to port U-Boot, Xen, and the Linux kernel for a Xen boot are not yet publicly available.

This project is using the 6AL.1.0 release versions of U-Boot and the Linux kernel, with some additional changes, and the master branch of Xen (version 4.6).

To get access to these repositories, contact [mailto:hemanthariyani@ti.com?Subject=%20Getting%20Access%20To%20the%20J6%20Xen%Repositories Hemant Hariyani].

Ubuntu Core Filesystem
Download and untar the Ubuntu Core Filesystem, to be used as the rootfs on the chip:

Setup Serial Console
To enable the serial tty console for the embedded Linux kernel, we need to add a few configuration files to the root filesystem. You can copy them from the listings below. Alternately, they are attached in file form, with a link at the title of each file listing.

Create ${SW_DIR}/filesystems/core_fs/etc/init/serial-auto-detect-console.conf with the following contents:

serial-auto-detect-console.conf

Create ${SW_DIR}/filesystems/core_fs/bin/serial-console with the following contents:

serial-console

Whenever we boot with different setups, we must choose either hvc0.conf or ttyO0.conf to use for our serial console configuration. Since these are both init processes, we must multiplex between them, or else one of them will run endlessly and output failure messages to the console. For the configuration file that we don't choose, simply change the respawn command to stop.

If you're going to boot Linux natively, then choose ttyO0.conf.

If you're going to boot a virtualized Linux kernel with Xen, then choose hvc0.conf.

Create ${SW_DIR}/filesystems/core_fs/etc/init/ttyO0.conf (for native Linux boots) with the following contents:

ttyO0.conf

Create {SW_DIR}/filesystems/core_fs/etc/init/hvc0.conf (for Xen boots) with the following contents:

hvc0.conf

Setup the chroot-full command
The Ubuntu Core Filesystem provides the bare minimum filesystem to run on. In order to get a more usable environment, we're going to need to install some additional packages. These packages can be installed from the J6 board itself with the ethernet connection, but it's easier and a little quicker to do it on your machine. To do this, we're going to need to chroot into the core filesystem.

In order to give chroot a workable environment, we need to provide it with versions of /dev, /proc, /sys, /dev/pts directories to emulate a full running kernel environment. To do this, we need to bind our laptop's corresponding devices to these devices on the core filesystem with the mount command. We need to be careful to make sure we umount these device bindings after exiting chroot; leaving them mounted could lead to system corruption, if, say for example, you decide to remove/replace the core filesystem. This could lead to the removal of key character devices like /dev/null. Thus, it's best if the mounting and unmounting is automatically handled for you by an alias or function to prevent this danger.

Therefore, we're going to define the following function for chrooting into the core filesystem, which we'll refer to chroot-full throughout the remainder of this wiki and related wikis. It's recommended that you put this function into your .bashrc file:

Note that anywhere the chroot-full command is run, you can also run the command directly on the J6 board as the root user to achieve the same effect.

Setup Core Filesystem Environment
There are several convenience packages that we should install, like vim.tiny for editing files.

Enable chroot'ing, by adding in the qemu-user-static binary into the bin directory, add the local host to hosts, so that commands can resolve localhost, and enable apt to work from behind TI's proxy:

Install basic utilities:

Setup Login
To work with the board properly, we need to setup the login so that we can actually login after the kernel boots. We do this by allowing the root user to login without a password. You could alternatively add and configure a user account, but this is simpler for our purposes.

To enable password-less login as the root:

Next Steps
Your system is now fully setup and ready for a native Linux Kernel boot.

If you want to boot the kernel under Xen, then you are also ready for a boot. However, it is recommended that you install the Xen Tools first. Without the Xen Tools, you'll have limited functionality. Namely, you won't be able to create DomU guests.

To boot the kernel natively, see Booting a Linux Kernel Natively on the J6.

To boot the kernel under Xen, see Booting with Xen on the J6.