ECE497 Listings for Embedded Linux Primer Chapter 2

From eLinux.org
Revision as of 08:45, 29 December 2011 by Yoder (talk | contribs) (Update listing 2-1)
Jump to: navigation, search


Number Page Caption Listing
2-1 15 Initial Bootloader Serial Output
Texas Instruments X-Loader 1.5.0 (Mar 27 2011 - 17:37:56)
Beagle xM
Reading boot sector
Loading u-boot.bin from mmc


U-Boot 2011.03-rc1-00000-g9a3cc57-dirty (Apr 01 2011 - 17:41:42)

OMAP3630/3730-GP ES2.1, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
OMAP3 Beagle board + LPDDR/NAND
I2C:   ready
DRAM:  512 MiB
NAND:  0 MiB
MMC:   OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment

In:    serial
Out:   serial
Err:   serial
Beagle xM Rev C
Recognized Tincantools Trainer board (rev 0 0)
Die ID #397600029ff80000015f26ad0f01a010
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

2-5 2-22 Hello Output for Beagle