ISVT Installation

=================================
Full-System CAVA ================================= = Installation instructions = CAVA_ROOT: Common path to isvt-32, Linux-3.7.1 and uClibc-0.9.33.2, ... ls $CAVA_ROOT busybox-1.20.2 configurations initramfs Linux-3.7.1 uClibc-0.9.33.2 compressed-files docs isvt-32 scripts You should export the path: export CAVA_ROOT=... Tools: - isvt-32: Instruction Set Virtualization Tool This tool allows a user to define an ISA and generates a toolchain accordingly. The toolchains contains a compiler (gcc), binutils, and a standard c library (glibc). Also, it contains a full-system emulator that allows us to boot a linux kernel image for this ISA. - Linux-3.7.1: Linux kernel 3.7.1 This is the kernel that contains the architecture dependent files that are able to run the CAVA architecture. - uClibc-0.9.33.2: uClibc standard c library 0.9.33.2 This is the standard library that contains the architecture dependent files that are able to interact with the CAVA architecture. - busybox-1.20.2: Busybox tools 1.20.2 This is a binary that contains a collection of usefull tools such as ls, cp, mount, top, ps, cat, vi, etc. These tools allow a user to start working with the machine one the kernel is booted on the emulator. Scheme: The following diagram shows how all the tools interact. ============ Applications ============ uClibc ============ Linux ============ ISA ============ Emulator ============ Outline: 1) Install isvt-32 2) Install Linux-3.7.1 3) Install Linux-3.7.1 kernel headers 4) Install uClibc-0.9.33.2 5) Install busybox-1.20.2 6) Generate initramfs 7) Recompile Linux-3.7.1 w/ initramfs 8) Execute vmlinux in caveat ====================== = 1. Install isvt-32 = ====================== Installation prerequisites: 1) sudo apt-get update 2) sudo apt-get install zlib1g zlib1g-dev bison flex texinfo \ libncurses5-dev g++ libgmp3-dev libmpfr-dev libmpc-dev 3) wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz 4) tar -xf gettext-0.17.tar.gz 5) In file gettext-0.17/gettext-tools/src/write-catalog.c, change line 223 from: fd = open (filename, O_WRONLY | O_CREAT); to: fd = open (filename, O_WRONLY | O_CREAT, S_IRWXU); 6) cd gettext-0.17 7) ./configure 8) make 9) sudo make install Building isvt-32: 1) cd CAVA_ROOT/isvt-32 2) ./set_cava_env.sh v2 3) make all ========================== = 2. Install Linux-3.7.1 = ========================== 1) cp CAVA_ROOT/configurations/linux-config CAVA_ROOT/Linux-3.7.1/.config 2) cd CAVA_ROOT/Linux-3.7.1 2) make ARCH=cava * Make sure there is a vmlinux image on CAVA_ROOT/Linux-3.7.1 ========================================= = 3. Install Linux-3.7.1 kernel headers = ========================================= 1) cd $CAVA_ROOT 2) mkdir Linux-3.7.1-headers 3) cd Linux-3.7.1 4) make headers_install ARCH=cava INSTALL_HDR_PATH=$CAVA_ROOT/Linux-3.7.1-headers ============================== = 4. Install uClibc-0.9.33.2 = ============================== 1) cp $CAVA_ROOT_configurations/uclibc-config CAVA_ROOT/uClibc-0.9.33.2/.config 2) mkdir $CAVA_ROOT/libc 3) cd $CAVA_ROOT/uClibc-0.9.33.2 4) make menuconfig 5) On the menu select "Target Architecture Features and Options" 6) Select "Linux kernel header location" 7) Enter the location of the kernel headers: $CAVA_ROOT/Linux-3.7.1-headers/include 8) Exit and save the configuration 9) make CROSS_COMPILE=cava-linux- PREFIX=$CAVA_ROOT/libc 10) make CROSS_COMPILE=cava-linux- PREFIX=$CAVA_ROOT/libc install ============================= = 5. Install busybox-1.20.2 = ============================= 1) cp $CAVA_ROOT_configurations/busybox-config CAVA_ROOT/busybox-1.20.2/.config 2) cd $CAVA_ROOT/busybox-1.20.2 3) make menuconfig 4) On the menu select "Busybox Settings" 5) Select "General Configuration" 6) Deselect the "Enable locale support" option 7) On the "General Configuration" menu, select "Busybox Library Tuning" 8) Deselect the "Use termios to manipulate the screen" option 9) Exit and save the configuration 10) export CFLAGS="-nostdinc -nostdlib" 11) export CPPFLAGS="-I$CAVA_ROOT/isvt-32/build_v2/gcc/gcc/include-fixed -I$CAVA_ROOT/Linux-3.7.1-headers/include -I$CAVA_ROOT/libc/usr/cava-linux-uclibc/usr/include -I$CAVA_ROOT/isvt-32/gcc-4.5.3/src/gcc/ginclude/" 12) vim scripts/trylink 13) Comment line 80 --LDFLAGS="$4" ++#LDFLAGS="$4" 14) Modify like 81 --O_FILES="$5" ++O_FILES="-L$CAVA_ROOT/libc/usr/cava-linux-uclibc/usr/lib $CAVA_ROOT/libc/usr/cava-linux-uclibc/usr/lib/crt1.o -lc -lrt -lm -lcrypt $5" 15) Save the changes and exit 16) make 17) Make sure you have generated "busybox" and "busybox_unstripped" files ========================= = 6. Generate initramfs = ========================= 1) cd $CAVA_ROOT/initramfs 2) ./compile.sh $CAVA_ROOT shell 3) cp shell testfs/init 4) cd testfs 2) cp $CAVA_ROOT/busyboxa-1.20.2/busybox bin/. 3) find . | cpio -H newc -o > ../testfs.cpio 4) cd .. 5) You should see a file with the name "testfs.cpio". This is the initramfs. ========================================= = 7. Recompile Linux-3.7.1 w/ initramfs = ========================================= 1) cd $CAVA_ROOT/Linux-3.7.1 2) cp $CAVA_ROOT/initramfs/testfs.cpio . 3) make ARCH=cava menuconfig 4) On the menu go to "General setup" 5) Select "Initramfs source file(s)" 6) Enter the name of the intiramfs: testfs.cpio 7) Exit and save the configuration 8) make ARCH=cava ================================= = 8. Execute vmlinux in caveat = ================================= 1) cd $CAVA_ROOT/Linux-3.7.1 2) caveat vmlinux Now you have the caveat full-system emulator executing Linux and the initramfs with binaries compiled with the cava toolchain (gcc, binutils) and the uclibc standard c library.