SHATRIX
Skyeye Simulator for ARM
   Skyeye application
   Skyeye testsuite
   Codesourcery Cross Toolchain
   Kernel Compilation
   genext2fs application
   Creating filesystem
   Shared libs
   Creating Devices
   Initial Files
   Busybox
   Putting it all together and running on skysye
Skyeye application

   Download skyeye­1.2.6_rc1.tar.bz2
   Download skyeye­testsuite­1.3.0_rc1.tar.gz
   tar xvf skyeye­1.2.6_rc1.tar.bz2
   cd skyeye­1.2.6_rc1
        ./configure
        make                              (Errors !!!)
        sudo make install
   tar xvfz skyeye­testsuite­1.3.0_rc1.tar.gz
   cd skyeye­testsuite­1.3.0_rc1/linux/s3c2410/s3c2410x­2.6.14
   skyeye ­c skyeye.conf ­e vmlinux
Codesourcery Cross Toolchain

   http://www.codesourcery.com/sgpp/lite/arm/porta
    l/package5383/public/arm­none­linux­
    gnueabi/arm­2009q3­67­arm­none­linux­gnueabi­
    i686­pc­linux­gnu.tar.bz2
   tar xvf arm­2009q3­67­arm­none­linux­gnueabi­
    i686­pc­linux­gnu.tar.bz2
   cd arm­2009q3/bin
   pwd
   copy the result path
   export PATH="<result­path>:$PATH"
       sudo gedit /etc/bash.bashrc
       Put that line at the end of this file
Kernel Compilation
   kernel: linux­2.6.32.tar.bz2
   tar xvf linux­2.6.32.tar.bz2
   cd linux­2.6.32
   modify arch/arm/mach_s3c2410/include/mach/map.h
      # define S3C2410_CS6 (0x30000000)
    to
      # define S3C2410_CS6 (0xC0000000)
   modify arch/arm/mach_s3c2410/include/mach/memory.h
      # define PHYS_OFFSET UL (0x30000000)
    to
      # define PHYS_OFFSET UL (0xC0000000)
Kernel Compilation

   export CROSS_COMPILE=arm­none­linux­gnueabi­
   export ARCH=arm
   make help
   make s3c2410_defconfig
   make menuconfig
Kernel Compilation

   [Boot Options] Default kernel command string = 
    mem=32M console=ttySAC0 root=/dev/ram 
    initrd=0xC0800000,0x00800000 ramdisk_size=10240 rw
   [Kernel Features] → enable Use the ARM EABI to 
    compile the kernel
   [Device Drivers] → [Network device support] → 
    [Ethernet (10 or 100Mbit)] Select EISA, VLB, PCI 
    and on board controllers
   [Device Drivers] → [Network device support] → 
    [Ethernet (10 or 100Mbit)] ensure that “CS89x0 
    support” option is not selected
   [Device Drivers] → [Character Devices] → [Serial 
    Driver] ensure that "8250/16550 and compatible 
    serial support" option is not selected
Kernel Compilation

   make zImage
   ls  ­l  vmlinux
genext2fs application

   http://sourceforge.net/projects/genext2fs/files
    /genext2fs/1.4.1/genext2fs­
    1.4.1.tar.gz/download
   untar
       ./configure
       make
       sudo make install



   Example to create an image with 4MB size:
   genext2fs ­b 4096 ­d <rootfs­dir> ­e 0 initrd.img
Creating filesystem

   mkdir rootfs
   cd rootfs
   mkdir bin dev etc lib proc sbin sys tmp usr var
   chmod 1777 tmp
   mkdir usr/bin usr/lib usr/sbin
   mkdir var/lib var/lock var/log var/run var/tmp
   chmod 1777 var/tmp
Shared libs

   cd ~/arm­2009q3/arm­none­linux­gnueabi/libc/armv4t/lib



   for file in libc libcrypt libdl libm libpthread 
    libresolv libutil
   do
   cp $file­*.so <rootfs­dir>/lib
   cp ­d $file.so.[*0­9] <rootfs­dir>/lib
   done
   cp ­d ld*.so* <rootfs­dir>/lib
   cp ­d libgcc_s.so* <rootfs­dir>/lib
   chmod +x <rootfs­dir>/lib/libgcc_s.so.1
Creating Devices

   cd <rootfs­dir>/dev



   sudo mknod ­m 600 mem c 1 1
   sudo mknod ­m 666 null c 1 3
   sudo mknod ­m 666 zero c 1 5
   sudo mknod ­m 644 random c 1 8
   sudo mknod ­m 600 tty0 c 4 0
   sudo mknod ­m 600 tty1 c 4 1
   sudo mknod ­m 600 ttyS0 c 4 64
   sudo mknod ­m 666 tty c 5 0
   sudo mknod ­m 600 console c 5 1
Initial Files
   cd <rootfs­dir>/etc
   gedit inittab
       ::sysinit:/etc/init.d/rcS
       ::askfirst:­/bin/sh
       ::restart:/sbin/init
       ::shutdown:/bin/umount ­a ­r
   mkdir init.d
   gedit init.d/rcS
       /bin/mount ­t proc none /proc
       /bin/echo "Embedded Linux OS !!!!!"
   chmod +x init.d/rcS
Busybox

   http://busybox.net/downloads/busybox­
    1.14.1.tar.bz2
   untar
   make defconfig
   make menuconfig
   [BusyBox Settings] → [Building Options] → Set 
    Cross Compiler Prefix to:
       “arm­none­linux­gnueabi­”
   [BusyBox Settings] → [Building Options] → Set 
    Additional CFLAGS to “­march=armv4t”
   make ARCH=arm CONFIG_PREFIX=<rootfs­dir> 
    install
Configuration file (skyeye.conf)
   gedit skyeye.conf
   Then copy these lines into the file
        # skyeye config file for S3C2410X
        arch:arm
        cpu: arm920t
        mach: s3c2410x
        # physical memory
        mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000
        mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000
        mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000, 
         file=./initrd.img
        mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000
        # all peripherals I/O mapping area
        mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
        mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
        uart:mod=term
Putting it all together and running on
skysye

   Creating a filesystem image file:
   genext2fs ­b 6000 ­d rootfs ­e 0 initrd.img
   Create a directory containing:
       vnlinux           (The compiled kernel)
       initrd.img        (The filesystem)
       skyeye.conf       (Configuration file)
   Then goto this dir and run:
       skyeye ­c skyeye.conf ­e vmlinux
   Wait then you will got a shell running
   try the command ( cat /proc/cpuinfo )
Other commands


    Command to compile a C source file:
   arm­none­linux­gnueabi­gcc ­march=armv4t ­o app app.c
   Now you can just copy the output file into the 
    filesystem dir and rerun genext2fs to make a 
    new image containing your application



   Command to mount the filesystem file as a 
    partition:
   sudo mount ­t ext2 ­o loop initrd.img <any dir>

005 skyeye

  • 1.
    SHATRIX Skyeye Simulator forARM  Skyeye application  Skyeye testsuite  Codesourcery Cross Toolchain  Kernel Compilation  genext2fs application  Creating filesystem  Shared libs  Creating Devices  Initial Files  Busybox  Putting it all together and running on skysye
  • 2.
    Skyeye application  Download skyeye­1.2.6_rc1.tar.bz2  Download skyeye­testsuite­1.3.0_rc1.tar.gz  tar xvf skyeye­1.2.6_rc1.tar.bz2  cd skyeye­1.2.6_rc1  ./configure  make (Errors !!!)  sudo make install  tar xvfz skyeye­testsuite­1.3.0_rc1.tar.gz  cd skyeye­testsuite­1.3.0_rc1/linux/s3c2410/s3c2410x­2.6.14  skyeye ­c skyeye.conf ­e vmlinux
  • 3.
    Codesourcery Cross Toolchain  http://www.codesourcery.com/sgpp/lite/arm/porta l/package5383/public/arm­none­linux­ gnueabi/arm­2009q3­67­arm­none­linux­gnueabi­ i686­pc­linux­gnu.tar.bz2  tar xvf arm­2009q3­67­arm­none­linux­gnueabi­ i686­pc­linux­gnu.tar.bz2  cd arm­2009q3/bin  pwd  copy the result path  export PATH="<result­path>:$PATH"  sudo gedit /etc/bash.bashrc  Put that line at the end of this file
  • 4.
    Kernel Compilation  kernel: linux­2.6.32.tar.bz2  tar xvf linux­2.6.32.tar.bz2  cd linux­2.6.32  modify arch/arm/mach_s3c2410/include/mach/map.h     # define S3C2410_CS6 (0x30000000)   to     # define S3C2410_CS6 (0xC0000000)  modify arch/arm/mach_s3c2410/include/mach/memory.h     # define PHYS_OFFSET UL (0x30000000)   to     # define PHYS_OFFSET UL (0xC0000000)
  • 5.
    Kernel Compilation  export CROSS_COMPILE=arm­none­linux­gnueabi­  export ARCH=arm  make help  make s3c2410_defconfig  make menuconfig
  • 6.
    Kernel Compilation  [Boot Options] Default kernel command string =  mem=32M console=ttySAC0 root=/dev/ram  initrd=0xC0800000,0x00800000 ramdisk_size=10240 rw  [Kernel Features] → enable Use the ARM EABI to  compile the kernel  [Device Drivers] → [Network device support] →  [Ethernet (10 or 100Mbit)] Select EISA, VLB, PCI  and on board controllers  [Device Drivers] → [Network device support] →  [Ethernet (10 or 100Mbit)] ensure that “CS89x0  support” option is not selected  [Device Drivers] → [Character Devices] → [Serial  Driver] ensure that "8250/16550 and compatible  serial support" option is not selected
  • 7.
    Kernel Compilation  make zImage  ls  ­l  vmlinux
  • 8.
    genext2fs application  http://sourceforge.net/projects/genext2fs/files /genext2fs/1.4.1/genext2fs­ 1.4.1.tar.gz/download  untar  ./configure  make  sudo make install   Example to create an image with 4MB size:  genext2fs ­b 4096 ­d <rootfs­dir> ­e 0 initrd.img
  • 9.
    Creating filesystem  mkdir rootfs  cd rootfs  mkdir bin dev etc lib proc sbin sys tmp usr var  chmod 1777 tmp  mkdir usr/bin usr/lib usr/sbin  mkdir var/lib var/lock var/log var/run var/tmp  chmod 1777 var/tmp
  • 10.
    Shared libs  cd ~/arm­2009q3/arm­none­linux­gnueabi/libc/armv4t/lib   for file in libc libcrypt libdl libm libpthread  libresolv libutil  do  cp $file­*.so <rootfs­dir>/lib  cp ­d $file.so.[*0­9] <rootfs­dir>/lib  done  cp ­d ld*.so* <rootfs­dir>/lib  cp ­d libgcc_s.so* <rootfs­dir>/lib  chmod +x <rootfs­dir>/lib/libgcc_s.so.1
  • 11.
    Creating Devices  cd <rootfs­dir>/dev   sudo mknod ­m 600 mem c 1 1  sudo mknod ­m 666 null c 1 3  sudo mknod ­m 666 zero c 1 5  sudo mknod ­m 644 random c 1 8  sudo mknod ­m 600 tty0 c 4 0  sudo mknod ­m 600 tty1 c 4 1  sudo mknod ­m 600 ttyS0 c 4 64  sudo mknod ­m 666 tty c 5 0  sudo mknod ­m 600 console c 5 1
  • 12.
    Initial Files  cd <rootfs­dir>/etc  gedit inittab  ::sysinit:/etc/init.d/rcS  ::askfirst:­/bin/sh  ::restart:/sbin/init  ::shutdown:/bin/umount ­a ­r  mkdir init.d  gedit init.d/rcS  /bin/mount ­t proc none /proc  /bin/echo "Embedded Linux OS !!!!!"  chmod +x init.d/rcS
  • 13.
    Busybox  http://busybox.net/downloads/busybox­ 1.14.1.tar.bz2  untar  make defconfig  make menuconfig  [BusyBox Settings] → [Building Options] → Set  Cross Compiler Prefix to:  “arm­none­linux­gnueabi­”  [BusyBox Settings] → [Building Options] → Set  Additional CFLAGS to “­march=armv4t”  make ARCH=arm CONFIG_PREFIX=<rootfs­dir>  install
  • 14.
    Configuration file (skyeye.conf)  gedit skyeye.conf  Then copy these lines into the file  # skyeye config file for S3C2410X  arch:arm  cpu: arm920t  mach: s3c2410x  # physical memory  mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000  mem_bank: map=M, type=RW, addr=0xc0000000, size=0x00800000  mem_bank: map=M, type=RW, addr=0xc0800000, size=0x00800000,  file=./initrd.img  mem_bank: map=M, type=RW, addr=0xc1000000, size=0x01000000  # all peripherals I/O mapping area  mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000  mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020  uart:mod=term
  • 15.
    Putting it alltogether and running on skysye  Creating a filesystem image file:  genext2fs ­b 6000 ­d rootfs ­e 0 initrd.img  Create a directory containing:  vnlinux (The compiled kernel)  initrd.img (The filesystem)  skyeye.conf (Configuration file)  Then goto this dir and run:  skyeye ­c skyeye.conf ­e vmlinux  Wait then you will got a shell running  try the command ( cat /proc/cpuinfo )
  • 16.
    Other commands  Command to compile a C source file:  arm­none­linux­gnueabi­gcc ­march=armv4t ­o app app.c  Now you can just copy the output file into the  filesystem dir and rerun genext2fs to make a  new image containing your application   Command to mount the filesystem file as a  partition:  sudo mount ­t ext2 ­o loop initrd.img <any dir>