Difference between revisions of "User:Collinjc"

From eLinux.org
Jump to: navigation, search
m (More stuff...)
m (Formatting change)
Line 45: Line 45:
 
</pre>
 
</pre>
  
==Listings==
+
= Listings =
 
== Chapter 2 ==
 
== Chapter 2 ==
  
Line 355: Line 355:
 
|}
 
|}
  
==Chapter 5==
+
== Chapter 5 ==
  
 
[[Category:ECE597]]
 
[[Category:ECE597]]

Revision as of 17:16, 25 March 2010

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
2996196 bytes read
## Booting kernel from Legacy Image at 80300000 ...
   Image Name:   Angstrom/2.6.29/beagleboard
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2996132 Bytes =  2.9 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................................................................................. done, booting the kernel.
[    0.000000] Linux version 2.6.29-omap1 (koen@dominion) (gcc version 4.3.3 (GCC) ) #1 PREEMPT Wed Oct 21 13:11:52 CEST 2009
[    0.000000] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c5387f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: OMAP3 Beagle Board
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] OMAP3430 ES3.1
[    0.000000] SRAM: Mapped pa 0x40200000 to va 0xd7000000 size: 0x100000
[    0.000000] Reserving 14680064 bytes SDRAM for VRAM
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootwait
[    0.000000] Clocking rate (Crystal/DPLL/ARM core): 26.0/332/720 MHz
[    0.000000] GPMC revision 5.0
[    0.000000] IRQ: Found an INTC at 0xd8200000 (revision 4.0) with 96 interrupts
[    0.000000] Total of 96 interrupts on 1 active controller
[    0.000000] OMAP34xx GPIO hardware version 2.5
[    0.000000] PID hash table entries: 1024 (order: 10, 4096 bytes)
[    0.000000] OMAP clockevent source: GPTIMER12 at 32768 Hz
[    0.000000] Console: colour dummy device 80x30
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 128MB 128MB = 256MB total
[    0.000000] Memory: 238848KB available (5632K code, 576K data, 204K init)
[    0.000000] Calibrating delay loop... 740.48 BogoMIPS (lpj=2891776)
[    0.000000] Mount-cache hash table entries: 512
[    0.000000] CPU: Testing write buffer coherency: ok
2-3 2-9 Linux Final Boot Messages
Lease of 192.168.1.108 obtained, lease time 86400
run-parts: /etc/udhcpc.d/00avahi-autoipd exited with code 1
adding dns 192.168.1.1
done.
Starting portmap daemon: portmap.
Unknown HZ value! (75) Assume 100.
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
Wed Mar 10 03:00:00 GMT 2010
^MINIT: Entering runlevel: 5^M
Configuring leds:
  beagleboard::usr0: heartbeat
  beagleboard::usr1: mmc0
Starting Dropbear SSH server: dropbear.
Starting advanced power management daemon: No APM support in kernel
(failed.)
Starting Vixie-cron.
Starting system message bus: dbus.
Starting Hardware abstraction layer hald
Starting syslogd/klogd: done
 * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
[ ok ]
Starting Connection Manager
Running ntpdate to synchronize clock.
Starting GPE display manager: gpe-dm

.-------.                                           
|       |                  .-.                      
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution beagleboard ttyS2

Angstrom 2009.X-stable beagleboard ttyS2

beagleboard login: root
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
  LD      init/built-in.o
scripts/kconfig/conf -s arch/arm/Kconfig
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CC      kernel/bounds.s
  GEN     include/linux/bounds.h
  CC      arch/arm/kernel/asm-offsets.s
  GEN     include/asm/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CC      scripts/mod/empty.o
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/modpost.o
.....output removed.....
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  OBJCOPY arch/arm/boot/Image
  Kernel: arch/arm/boot/Image is ready
  AS      arch/arm/boot/compressed/head.o
  GZIP    arch/arm/boot/compressed/piggy.gz
  AS      arch/arm/boot/compressed/piggy.o
  CC      arch/arm/boot/compressed/misc.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-2.6.29-omap1
Created:      Mon Mar 22 18:48:45 2010
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2994248 Bytes = 2924.07 kB = 2.86 MB
Load Address: 80008000
Entry Point:  80008000
  Image arch/arm/boot/uImage is ready

4-2 4-9 Link Stage: vmlinux
??
4-3 4-14 Kernel Subdirectory
collinjc@lug linux-omap-2.6.29-r46/git % ls -ls arch/arm/plat-omap/ | grep -v \\.o
total 764K
8.0K -rw-r--r-- 1 collinjc students 8.0K Mar 19 19:48 Kconfig
4.0K -rw-r--r-- 1 collinjc students  824 Mar 15 02:52 Makefile
4.0K -rw-r--r-- 1 collinjc students 2.4K Mar 11 07:46 bootreason.c
 16K -rw-r--r-- 1 collinjc students  15K Mar 11 07:46 clock.c
 12K -rw-r--r-- 1 collinjc students 8.1K Mar 11 07:46 common.c
4.0K -rw-r--r-- 1 collinjc students 1.6K Mar 11 07:46 component-version.c
4.0K -rw-r--r-- 1 collinjc students 4.0K Mar 11 07:46 cpu-omap.c
4.0K -rw-r--r-- 1 collinjc students 2.0K Mar 11 07:46 debug-devices.c
8.0K -rw-r--r-- 1 collinjc students 7.0K Mar 11 07:46 debug-leds.c
 12K -rw-r--r-- 1 collinjc students 9.8K Mar 11 07:46 devices.c
 60K -rwxr-xr-x 1 collinjc students  59K Mar 15 02:51 dma.c
 24K -rw-r--r-- 1 collinjc students  21K Mar 11 07:46 dmtimer.c
 12K -rw-r--r-- 1 collinjc students 9.5K Mar 15 02:51 fb.c
 16K -rw-r--r-- 1 collinjc students  13K Mar 11 07:46 gpio-switch.c
 48K -rw-r--r-- 1 collinjc students  47K Mar 11 07:46 gpio.c
8.0K -rw-r--r-- 1 collinjc students 5.8K Mar 11 07:46 i2c.c
   0 drwxr-xr-x 3 collinjc students   72 Mar 11 07:46 include
4.0K -rw-r--r-- 1 collinjc students 3.7K Mar 11 07:46 io.c
 20K -rw-r--r-- 1 collinjc students  20K Mar 15 02:52 iommu.c
 20K -rw-r--r-- 1 collinjc students  17K Mar 15 03:17 iommu.ko
4.0K -rw-r--r-- 1 collinjc students 1.9K Mar 15 03:16 iommu.mod.c
4.0K -rw-r--r-- 1 collinjc students 2.2K Mar 15 02:52 iopgtable.h
 20K -rw-r--r-- 1 collinjc students  19K Mar 15 02:52 iovmm.c
 16K -rw-r--r-- 1 collinjc students  15K Mar 15 03:17 iovmm.ko
4.0K -rw-r--r-- 1 collinjc students 1.8K Mar 15 03:16 iovmm.mod.c
 12K -rw-r--r-- 1 collinjc students  12K Mar 11 07:46 mailbox.c
 28K -rw-r--r-- 1 collinjc students  26K Mar 11 07:46 mcbsp.c
4.0K -rw-r--r-- 1 collinjc students 2.1K Mar 11 07:46 mux.c
4.0K -rw-r--r-- 1 collinjc students 2.7K Mar 11 07:46 ocpi.c
 12K -rw-r--r-- 1 collinjc students  11K Mar 11 07:46 sram.c
 20K -rw-r--r-- 1 collinjc students  18K Mar 11 07:46 usb.c
 16K -rw-r--r-- 1 collinjc students  14K Mar 15 02:51 vram.c
8.0K -rw-r--r-- 1 collinjc students 6.3K Mar 15 02:51 vrfb.c
4-4 4-17 Snippet from Linux 2.6 .config
1872 #
1873 # USB Input Devices
1874 #
1875 CONFIG_USB_HID=y
1876 # CONFIG_HID_PID is not set
1877 # CONFIG_USB_HIDDEV is not set
1878 
1879 #
1880 # Special HID drivers
1881 #
1882 CONFIG_HID_COMPAT=y
1883 CONFIG_HID_A4TECH=y
1884 CONFIG_HID_APPLE=y
1885 CONFIG_HID_BELKIN=y
1886 CONFIG_HID_CHERRY=y
1887 CONFIG_HID_CHICONY=y
1888 CONFIG_HID_CYPRESS=y
1889 CONFIG_HID_EZKEY=y
1890 CONFIG_HID_GYRATION=y
1891 CONFIG_HID_LOGITECH=y
1892 # CONFIG_LOGITECH_FF is not set
1893 # CONFIG_LOGIRUMBLEPAD2_FF is not set

Chapter 5