User:Collinjc

From eLinux.org
Revision as of 19:01, 18 March 2010 by Collinjc (Talk | contribs) (Chapter 2: listings updated)

Jump to: navigation, search

I am majoring in computer engineering and pursuing a certificate in optical communications. I am currently enrolled in ECE597, hoping to explore the applications of Linux in an embedded environment as well as the necessary considerations that must be made in developing for such an environment. I have a keen interest and a great deal of experience with Linux and am a member of the Rose-Hulman Linux Users' Group.

I am currently working on a script to automate the bitbake process with multiple cores. This is a copy of the script in its current form. Please note that it is a work in progress.

#!/bin/sh
# bitbake automation
# J. Cody Collins

START=$(date +%s)

MAXTRIES=15
COUNT=1

export OETREE="${HOME}/oe"

echo "set environment variables"
. ${OETREE}/sourceme.txt 

echo "Go to the OE tree"
cd ${OETREE}/openembedded 

echo "Make sure it's up to date"
git pull --rebase

echo "Start building"
bitbake $1

while [ $? -ne 0 ]; do
	if [ $COUNT -lt $MAXTRIES ]; then
		((COUNT++))
		echo "re-running bitbake -- trial $COUNT"
		# Give the user a chance to kill the task
		sleep 5
		bitbake $1
	else
		echo "Maximum tries exceeded. Exiting..."
		break
	fi
done

END=$(date +%s)
DIFF=$(( $END - $START ))
echo "Build took $DIFF seconds."
echo "Completed after $COUNT attempts."

Listings

Chapter 2

Number Page Caption Listing
2-1 2-6 Initial Bootloader Serial Output
Texas Instruments X-Loader 1.4.2 (Feb 19 2009 - 12:01:24)
Reading boot sector
Loading u-boot.bin from mmc


U-Boot 2009.11-rc1 (Jan 08 2010 - 21:19:52)

OMAP3530-GP ES3.1, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  256 MB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Board revision C4
Die ID #1e30000400000000040365fa1400400a
Hit any key to stop autoboot:  0
OMAP3 beagleboard.org #
2-2 2-7 Loading the Linux Kernel
2-3 2-9 Linux Final Boot Messages

2-4 2-21 Hello World, Embedded Style
#include <stdio.h>

int bss_var;        /* Uninitialized global variable */

int data_var = 1;   /* Initialized global variable */

int main(int argc, char **argv)
{
  void *stack_var;            /* Local variable on the stack */
  
  stack_var = (void *)main;   /* Don't let the compiler */
                              /* optimize it out */

  printf("Hello, World! Main is executing at %p\n", stack_var);
  printf("This address (%p) is in our stack frame\n", &stack_var);

  /* bss section contains uninitialized data */
  printf("This address (%p) is in our bss section\n", &bss_var);

  /* data section contains initializated data */
  printf("This address (%p) is in our data section\n", &data_var);

  return 0;
}
2-5 2-22 Hello Output for Host Computer
collinjc@collinjc-eee ~ % ./a.out                                                                                     [1021]
Hello, World! Main is executing at 0x80483e4
This address (0xbfe6b58c) is in our stack frame
This address (0x804a020) is in our bss section
This address (0x804a014) is in our data section
2-5 2-22 Hello Output for Beagle
root@beagleboard:~# ./a.out 
Hello, World! Main is executing at 0x8380
This address (0xbea11cd4) is in our stack frame
This address (0x10670) is in our bss section
This address (0x10668) is in our data section

Chapter 4

Number Page Caption Listing
4-1 4-7 Kernel Build Output

4-2 4-9 Link Stage: vmlinux

4-3 4-14 Kernel Subdirectory