This page is under construction and will soon be updated with information.

Creating a root file system

# Create the hard disk file

sudo qemu-img create arm-trusty.img 4G
sudo mkfs.ext4 -F arm-trusty.img

# Mount the hard disk file
mkdir mnt
sudo mount -o loop arm-trusty.img mnt

# Bootstrap a trusty armhf root file system
sudo qemu-debootstrap --arch=armhf trusty ./mnt
sudo cp /usr/bin/qemu-arm-static ./mnt/usr/bin/

# Chroot into the root file system

sudo chroot ./mnt

# Create the sources.list files for apt repositories

echo "deb http://ports.ubuntu.com trusty main restricted universe
deb-src http://ports.ubuntu.com trusty main restricted universe" > /etc/apt/sources.list
echo "deb http://ddebs.ubuntu.com trusty main restricted universe multiverse" > /etc/apt/sources.list.d/ddebs.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01
apt-get update

# Create configuration for the serial console

cp /etc/init/tty1.conf /etc/init/ttyAMA0.conf
sed -i "s/tty1/ttyAMA0/" /etc/init/ttyAMA0.conf

# Add a user account

adduser myuser
usermod -aG sudo myuser

# Note: Replace myuser with your desired user name in above two commands.

# Exit and unmount root file system:

exit
sudo umount mnt
rmdir mnt

Croos Compiling linux kernel for debugging

# Setup environment
export  ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-

# Note: Do not dare use a newer arm compiler version (4.6.x.x onwards) it wont work as of 25-12-2014

# Clone a copy of the mainline Linux Git repository
git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux

# Create a .config by editing default versatile express config
make vexpress_defconfig
make menuconfig
# Note: Enable Large files (Block layer -> Support for large (2TB+) block devices and files)

# Compile the kernel
make  -j`getconf _NPROCESSORS_ONLN` all
cd ..

Boot the image using QEMU on cortex A9

sudo qemu-system-arm \
-M vexpress-a9 \
-m 1024 \
-serial stdio \
-no-reboot \
-kernel linux/arch/arm/boot/zImage \
-drive file=arm-trusty.img,if=sd,cache=writeback \
--append "rw console=ttyAMA0,38400n8 console=tty root=/dev/mmcblk0 " \
-dtb linux/arch/arm/boot/dts/vexpress-v2p-ca9.dtb

Boot the image using QEMU on cortex A15

sudo qemu-system-arm \
-M vexpress-a15 \
-m 1024 \
-serial stdio \
-no-reboot \
-kernel linux/arch/arm/boot/zImage \
-drive file=arm-trusty.img,if=sd,cache=writeback \
--append "rw console=ttyAMA0,38400n8 console=tty root=/dev/mmcblk0 " \
-dtb linux/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb

WorkingGroups/ToolChain/GDB/kernelqemugdb (last modified 2014-12-24 22:17:41)