Embedded Linux for ARM8-Cortex AM3358 - Beagle-Bone Board

Duy-Ky Nguyen                                                                                                                                        2014-09-20

 

1. Introduction

BeagleBone Black has been used in this project

        BeagleBone WhiteBeagleBone Black

1.1. U-Boot : u-boot-2013.10-ti2013.12.01


Config

make am335x_evm_config·      


make -> (1) MLO of 106 KB (2) u-boot.img of 377 KB

The file "MLO" must be copied first to SD Card Bootable FAT section, then "u-boot.img" next

 


 

1.2. Kernel : linux-3.12.10-ti2013.12.01


Config
make tisdk_am335x-evm_defconfig

make xconfig


make -> (1) zImage of 4022 KB (2) am335x-boneblack.dtb of 34 KB

 

2. Minimal Root FileSystem using INIT from BusyBox-1.20.2

 

Config : use STATIC and all keep default, but exclude "print" and "mail"


To complete the RFS tree

mkdir dev

mknod dev/console c 5 1

mkdir dev/pts

mkdir etc

mkdir lib

mkdir mnt

mkdir opt

mkdir proc

mkdir root

mkdir sys

mkdir tmp

mkdir var

mkdir var/log


"/etc/inttab"

::sysinit:/etc/rcS 
 
# /bin/ash
#
# Start an "askfirst" shell on the serial port
console::askfirst:-/bin/ash
 
# Stuff to do when restarting the init process
::restart:/sbin/init
 
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a

 

/etc/fstab

proc            /proc           proc    defaults        0 0
none            /dev/pts        devpts  mode=0622       0 0

 

"etc/rcS"

#!/bin/sh
#   ---------------------------------------------
#   Common settings
#   ---------------------------------------------
HOSTNAME=OMAP3EVM
VERSION=1.0.0
 
hostname $HOSTNAME
 
#   ---------------------------------------------
#   Prints execution status.
#
#   arg1 : Execution status
#   arg2 : Continue (0) or Abort (1) on error
#   ---------------------------------------------
status ()
{
       if [ $1 -eq 0 ] ; then
               echo "[SUCCESS]"
       else
               echo "[FAILED]"
 
               if [ $2 -eq 1 ] ; then
                       echo "... System init aborted."
                       exit 1
               fi
       fi
 
}
 
#   ---------------------------------------------
#   Get verbose
#   ---------------------------------------------
echo ""
echo "    System initialization..."
echo ""
echo "    Hostname       : $HOSTNAME"
echo "    Filesystem     : v$VERSION"
echo ""
echo ""
echo "    Kernel release : `uname -s` `uname -r`"
echo "    Kernel version : `uname -v`"
echo ""
 
 
#   ---------------------------------------------
#   MDEV Support
#   (Requires sysfs support in the kernel)
#   ---------------------------------------------
echo -n " Mounting /proc             : "
mount -n -t proc /proc /proc
status $? 1
 
echo -n " Mounting /sys              : "
mount -n -t sysfs sysfs /sys
status $? 1
 
echo -n " Mounting /dev              : "
mount -n -t tmpfs mdev /dev
status $? 1
 
echo -n " Mounting /dev/pts          : "
mkdir /dev/pts
mount -t devpts devpts /dev/pts
status $? 1
 
echo -n " Enabling hot-plug          : "
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
status $? 0
 
echo -n " Populating /dev            : "
mkdir /dev/input
mkdir /dev/snd
 
mdev -s
status $? 0
 
#   ---------------------------------------------
#   Disable power management
#   (Requires sysfs support in the kernel)
#   ---------------------------------------------
# echo -n " Disabling Power mgmt       : "
# echo -n "1" > /sys/power/cpuidle_deepest_state
# status $? 1
 
#   ---------------------------------------------
#   Turn off LCD after 1 hour of inactivity
#   (Requires sysfs support in the kernel)
#   ---------------------------------------------
# echo -n " Turn off LCD after 1 hour  : "
# echo -n "3600" > /sys/power/fb_timeout_value
# status $? 1
 
 
#   ---------------------------------------------
#   Mount the default file systems
#   ---------------------------------------------
echo -n " Mounting other filesystems : "
mount -a
status $? 0
 
 
#   ---------------------------------------------
#   Set PATH
#   ---------------------------------------------
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
 
 
#   ---------------------------------------------
#   Start other daemons
#   ---------------------------------------------
echo -n " Starting syslogd           : "
/sbin/syslogd
status $? 0
 
echo -n " Starting telnetd           : "
/usr/sbin/telnetd
status $? 0
 
 
#   ---------------------------------------------
#   Done!
#   ---------------------------------------------
echo ""
echo "System initialization complete."
 
 
#   ---------------------------------------------
#   Start demo app
#   ---------------------------------------------
#if [[ -x /etc/init.d/demo_start ]]; then
#       echo " Starting Demo Application..."
#       /etc/init.d/demo_start &
#       sleep 5
#fi

 

 

/etc/profile

PATH=".:/home/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

 

# HOSTNAME=1.55

HOSTNAME=$(ifconfig eth0 | awk -F. '/inet addr:/ {printf "x86_%d", $4;}')

 

ifconfig eth1 11.1.$HOSTNAME

 

route add default gw 11.1.1.1

 

PS1="${HOSTNAME}:\w % "

 

HOME=/home

export PATH PS1 HOME

 

umask 022

 

###############################################################################

# Must be in profile, it won't work if in rcS

# because rcS is too early to invoke this operation

 

# NTP Time

# ntpdate 64.183.55.54 64.183.56.58

 

echo "."

echo "Start NTPD and set time with -s"

echo "."

/usr/sbin/ntpd -s

sleep 1

 

###############################################################################

 

alias ll='ls -als'

alias lnn='ln -s -f'

alias ..='cd ..'

alias ...='cd ../..'

 

export TZ=-8

 

3. BeagleBone Linux Revist - v2 is HERE


The boot log of the existing implementation using Debian sys-init is HERE


The boot log of the new implementation using BusyBox sys-init is HERE