ECE497 Listings for Embedded Linux Primer Chapter 4

From eLinux.org
Jump to: navigation, search


Number Page Caption Listing
4-1 71 Kernel Build Output
$ export OETREE="${HOME}/oe"
$ PATH=${OETREE}/angstrom-dev/staging/i686-linux/usr/bin/:${PATH}
$ PATH=${OETREE}/angstrom-dev/cross/armv7a/bin/:${PATH}
$ make CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage
  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
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC      arch/arm/mach-omap2/io.o
  CC      arch/arm/mach-omap2/devices.o
      .
      .  <lines of output omitted here>
      .
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  OBJCOPY arch/arm/boot/Image
  Kernel: arch/arm/boot/Image is ready
  GZIP    arch/arm/boot/compressed/piggy.gz
  AS      arch/arm/boot/compressed/piggy.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:      Tue Mar  9 12:58:27 2010
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2991236 Bytes = 2921.13 kB = 2.85 MB
Load Address: 0x80008000
Entry Point:  0x80008000
  Image arch/arm/boot/uImage is ready
4-2 73 Link Stage: vmlinux

4-3 77 Kernel Subdirectory
$ ls -ls arch/arm/plat-omap/ | grep -v \\.o
total 776
  8 -rw-r--r-- 1 yoder yoder   7933 Mar  9 12:14 Kconfig
  8 -rw-r--r-- 1 yoder yoder   7799 Mar  9 12:14 Kconfig.backup
  8 -rw-r--r-- 1 yoder yoder   7799 Mar  8 11:28 Kconfig~
  4 -rw-r--r-- 1 yoder yoder    824 Mar  8 11:28 Makefile
  4 -rw-r--r-- 1 yoder yoder   2404 Mar  8 11:18 bootreason.c
 16 -rw-r--r-- 1 yoder yoder  15334 Mar  8 11:18 clock.c
 12 -rw-r--r-- 1 yoder yoder   8210 Mar  8 11:18 common.c
  4 -rw-r--r-- 1 yoder yoder   1593 Mar  8 11:18 component-version.c
  4 -rw-r--r-- 1 yoder yoder   4053 Mar  8 11:18 cpu-omap.c
  4 -rw-r--r-- 1 yoder yoder   1975 Mar  8 11:18 debug-devices.c
  8 -rw-r--r-- 1 yoder yoder   7120 Mar  8 11:18 debug-leds.c
 12 -rw-r--r-- 1 yoder yoder   9975 Mar  8 11:18 devices.c
 60 -rwxr-xr-x 1 yoder yoder  59827 Mar  8 11:26 dma.c
 24 -rw-r--r-- 1 yoder yoder  20791 Mar  8 11:18 dmtimer.c
 12 -rw-r--r-- 1 yoder yoder   9675 Mar  8 11:25 fb.c
 16 -rw-r--r-- 1 yoder yoder  12815 Mar  8 11:18 gpio-switch.c
 48 -rw-r--r-- 1 yoder yoder  47671 Mar  8 11:18 gpio.c
  8 -rw-r--r-- 1 yoder yoder   5841 Mar  8 11:18 i2c.c
  4 drwxr-xr-x 3 yoder yoder   4096 Mar  8 11:18 include
  4 -rw-r--r-- 1 yoder yoder   3749 Mar  8 11:18 io.c
 20 -rw-r--r-- 1 yoder yoder  19782 Mar  8 11:28 iommu.c
 20 -rw-r--r-- 1 yoder yoder  17214 Mar  8 13:42 iommu.ko
  4 -rw-r--r-- 1 yoder yoder   1924 Mar  8 13:40 iommu.mod.c
  4 -rw-r--r-- 1 yoder yoder   2152 Mar  8 11:28 iopgtable.h
 20 -rw-r--r-- 1 yoder yoder  19139 Mar  8 11:28 iovmm.c
 16 -rw-r--r-- 1 yoder yoder  14686 Mar  8 13:42 iovmm.ko
  4 -rw-r--r-- 1 yoder yoder   1764 Mar  8 13:40 iovmm.mod.c
 12 -rw-r--r-- 1 yoder yoder  12069 Mar  8 11:18 mailbox.c
 28 -rw-r--r-- 1 yoder yoder  26560 Mar  8 11:18 mcbsp.c
  4 -rw-r--r-- 1 yoder yoder   2109 Mar  8 11:18 mux.c
  4 -rw-r--r-- 1 yoder yoder   2739 Mar  8 11:18 ocpi.c
 12 -rw-r--r-- 1 yoder yoder  10915 Mar  8 11:18 sram.c
 20 -rw-r--r-- 1 yoder yoder  18290 Mar  8 11:18 usb.c
 16 -rw-r--r-- 1 yoder yoder  13911 Mar  8 11:26 vram.c
  8 -rw-r--r-- 1 yoder yoder   6426 Mar  8 11:26 vrfb.c

4-4 79 Snippet from Linux 2.6 .config
...
#
# USB Input Devices
#
CONFIG_USB_HID=y
# CONFIG_HID_PID is not set
# CONFIG_USB_HIDDEV is not set

#
# Special HID drivers
#
CONFIG_HID_COMPAT=y
CONFIG_HID_A4TECH=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
...
4-5 82 Linux autoconf.h
#define CONFIG_USB_SISUSBVGA_MODULE 1
#define CONFIG_USB_PHIDGETMOTORCONTROL_MODULE 1
#define CONFIG_USB_MUSB_HDRC 1
#define CONFIG_USB_LEGOTOWER_MODULE 1
#define CONFIG_USB_SERIAL_IR_MODULE 1
#define CONFIG_USB_GSPCA_T613_MODULE 1
#define CONFIG_USB_SERIAL_TI_MODULE 1
#define CONFIG_USB_ETH_RNDIS 1
#define CONFIG_USB_SERIAL_MODULE 1
#define CONFIG_USB_W9968CF_MODULE 1
#define CONFIG_USB_RTL8150 1
#define CONFIG_USB_SERIAL_WHITEHEAT_MODULE 1
#define CONFIG_USB_GADGET_MUSB_HDRC 1
...
4-6 84-89 Makefile Targets
$ make help 
Cleaning targets:
  clean		  - Remove most generated files but keep the config and
                    enough build support to build external modules
  mrproper	  - Remove all generated files + config + various backup files
  distclean	  - mrproper + remove editor backup and patch files

Configuration targets:
  config	  - Update current config utilising a line-oriented program
  menuconfig	  - Update current config utilising a menu based program
  xconfig	  - Update current config utilising a QT based front-end
  gconfig	  - Update current config utilising a GTK based front-end
  oldconfig	  - Update current config utilising a provided .config as base
  silentoldconfig - Same as oldconfig, but quietly
  randconfig	  - New config with random answer to all options
  defconfig	  - New config with default answer to all options
  allmodconfig	  - New config selecting modules when possible
  allyesconfig	  - New config where all options are accepted with yes
  allnoconfig	  - New config where all options are answered with no

Other generic targets:
  all		  - Build all targets marked with [*]
* vmlinux	  - Build the bare kernel
* modules	  - Build all modules
  modules_install - Install all modules to INSTALL_MOD_PATH (default: /)
  firmware_install- Install all firmware to INSTALL_FW_PATH
                    (default: $(INSTALL_MOD_PATH)/lib/firmware)
  dir/            - Build all files in dir and below
  dir/file.[ois]  - Build specified target only
  dir/file.ko     - Build module including final link
  prepare         - Set up for building external modules
  tags/TAGS	  - Generate tags file for editors
  cscope	  - Generate cscope index
  kernelrelease	  - Output the release version string
  kernelversion	  - Output the version stored in Makefile
  headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH
                    (default: /home/yoder/oe/angstrom-dev/work/beagleboard-angstrom-linux-gnueabi/linux-omap-2.6.29-r46/git/usr)

Static analysers
  checkstack      - Generate a list of stack hogs
  namespacecheck  - Name space analysis on compiled kernel
  versioncheck    - Sanity check on version.h usage
  includecheck    - Check for duplicate included header files
  export_report   - List the usages of all exported symbols
  headers_check   - Sanity check on exported headers
  headerdep       - Detect inclusion cycles in headers

Kernel packaging:
  rpm-pkg         - Build both source and binary RPM kernel packages
  binrpm-pkg      - Build only the binary kernel package
  deb-pkg         - Build the kernel as an deb package
  tar-pkg         - Build the kernel as an uncompressed tarball
  targz-pkg       - Build the kernel as a gzip compressed tarball
  tarbz2-pkg      - Build the kernel as a bzip2 compressed tarball

Documentation targets:
 Linux kernel internal documentation in different formats:
  htmldocs        - HTML
  installmandocs  - install man pages generated by mandocs
  mandocs         - man pages
  pdfdocs         - PDF
  psdocs          - Postscript
  xmldocs         - XML DocBook

Architecture specific targets (arm):
* zImage        - Compressed kernel image (arch/arm/boot/zImage)
  Image         - Uncompressed kernel image (arch/arm/boot/Image)
* xipImage      - XIP kernel image, if configured (arch/arm/boot/xipImage)
  uImage        - U-Boot wrapped zImage
  bootpImage    - Combined zImage and initial RAM disk
                  (supply initrd image via make variable INITRD=<path>)
  install       - Install uncompressed kernel
  zinstall      - Install compressed kernel
                  Install using (your) ~/bin/installkernel or
                  (distribution) /sbin/installkernel or
                  install to $(INSTALL_PATH) and run lilo

  afeb9260_defconfig       - Build for afeb9260
  am200epdkit_defconfig    - Build for am200epdkit
  ams_delta_defconfig      - Build for ams_delta
  assabet_defconfig        - Build for assabet
  at91cap9adk_defconfig    - Build for at91cap9adk
  at91rm9200dk_defconfig   - Build for at91rm9200dk
  at91rm9200ek_defconfig   - Build for at91rm9200ek
  at91sam9260ek_defconfig  - Build for at91sam9260ek
  at91sam9261ek_defconfig  - Build for at91sam9261ek
  at91sam9263ek_defconfig  - Build for at91sam9263ek
  at91sam9g20ek_defconfig  - Build for at91sam9g20ek
  at91sam9rlek_defconfig   - Build for at91sam9rlek
  ateb9200_defconfig       - Build for ateb9200
  badge4_defconfig         - Build for badge4
  cam60_defconfig          - Build for cam60
  carmeva_defconfig        - Build for carmeva
  cerfcube_defconfig       - Build for cerfcube
  cm_x300_defconfig        - Build for cm_x300
  colibri_defconfig        - Build for colibri
  collie_defconfig         - Build for collie
  corgi_defconfig          - Build for corgi
  csb337_defconfig         - Build for csb337
  csb637_defconfig         - Build for csb637
  dss_omap3_beagle_defconfig - Build for dss_omap3_beagle
  dss_omap_3430sdp_defconfig - Build for dss_omap_3430sdp
  dss_overo_defconfig      - Build for dss_overo
  ebsa110_defconfig        - Build for ebsa110
  ecbat91_defconfig        - Build for ecbat91
  edb7211_defconfig        - Build for edb7211
  ep93xx_defconfig         - Build for ep93xx
  eseries_pxa_defconfig    - Build for eseries_pxa
  ezx_defconfig            - Build for ezx
  footbridge_defconfig     - Build for footbridge
  fortunet_defconfig       - Build for fortunet
  h3600_defconfig          - Build for h3600
  h5000_defconfig          - Build for h5000
  h7201_defconfig          - Build for h7201
  h7202_defconfig          - Build for h7202
  hackkit_defconfig        - Build for hackkit
  imx27ads_defconfig       - Build for imx27ads
  integrator_defconfig     - Build for integrator
  iop13xx_defconfig        - Build for iop13xx
  iop32x_defconfig         - Build for iop32x
  iop33x_defconfig         - Build for iop33x
  ixp2000_defconfig        - Build for ixp2000
  ixp23xx_defconfig        - Build for ixp23xx
  ixp4xx_defconfig         - Build for ixp4xx
  jornada720_defconfig     - Build for jornada720
  kafa_defconfig           - Build for kafa
  kb9202_defconfig         - Build for kb9202
  kirkwood_defconfig       - Build for kirkwood
  ks8695_defconfig         - Build for ks8695
  lart_defconfig           - Build for lart
  littleton_defconfig      - Build for littleton
  loki_defconfig           - Build for loki
  lpd270_defconfig         - Build for lpd270
  lpd7a400_defconfig       - Build for lpd7a400
  lpd7a404_defconfig       - Build for lpd7a404
  lubbock_defconfig        - Build for lubbock
  lusl7200_defconfig       - Build for lusl7200
  magician_defconfig       - Build for magician
  mainstone_defconfig      - Build for mainstone
  msm_defconfig            - Build for msm
  mv78xx0_defconfig        - Build for mv78xx0
  mx1ads_defconfig         - Build for mx1ads
  mx31ads_defconfig        - Build for mx31ads
  mx31litekit_defconfig    - Build for mx31litekit
  mx31moboard_defconfig    - Build for mx31moboard
  mx31pdk_defconfig        - Build for mx31pdk
  n770_defconfig           - Build for n770
  n800_defconfig           - Build for n800
  neocore926_defconfig     - Build for neocore926
  neponset_defconfig       - Build for neponset
  netwinder_defconfig      - Build for netwinder
  netx_defconfig           - Build for netx
  ns9xxx_defconfig         - Build for ns9xxx
  omap2_evm_defconfig      - Build for omap2_evm
  omap3_beagle_defconfig   - Build for omap3_beagle
  omap3_evm_defconfig      - Build for omap3_evm
  omap3_pandora_defconfig  - Build for omap3_pandora
  omap_2430sdp_defconfig   - Build for omap_2430sdp
  omap_3430sdp_defconfig   - Build for omap_3430sdp
  omap_apollon_2420_defconfig - Build for omap_apollon_2420
  omap_generic_1510_defconfig - Build for omap_generic_1510
  omap_generic_1610_defconfig - Build for omap_generic_1610
  omap_generic_1710_defconfig - Build for omap_generic_1710
  omap_generic_2420_defconfig - Build for omap_generic_2420
  omap_h2_1610_defconfig   - Build for omap_h2_1610
  omap_h3_1710_defconfig   - Build for omap_h3_1710
  omap_h4_2420_defconfig   - Build for omap_h4_2420
  omap_innovator_1510_defconfig - Build for omap_innovator_1510
  omap_innovator_1610_defconfig - Build for omap_innovator_1610
  omap_ldp_defconfig       - Build for omap_ldp
  omap_osk_5912_defconfig  - Build for omap_osk_5912
  omap_perseus2_730_defconfig - Build for omap_perseus2_730
  onearm_defconfig         - Build for onearm
  orion5x_defconfig        - Build for orion5x
  overo_defconfig          - Build for overo
  palmte_defconfig         - Build for palmte
  palmtt_defconfig         - Build for palmtt
  palmz71_defconfig        - Build for palmz71
  palmz72_defconfig        - Build for palmz72
  pcm027_defconfig         - Build for pcm027
  pcm037_defconfig         - Build for pcm037
  pcm038_defconfig         - Build for pcm038
  picotux200_defconfig     - Build for picotux200
  pleb_defconfig           - Build for pleb
  pnx4008_defconfig        - Build for pnx4008
  pxa255-idp_defconfig     - Build for pxa255-idp
  qil-a9260_defconfig      - Build for qil-a9260
  realview-smp_defconfig   - Build for realview-smp
  realview_defconfig       - Build for realview
  rpc_defconfig            - Build for rpc
  rx51_defconfig           - Build for rx51
  s3c2410_defconfig        - Build for s3c2410
  s3c6400_defconfig        - Build for s3c6400
  sam9_l9260_defconfig     - Build for sam9_l9260
  shannon_defconfig        - Build for shannon
  shark_defconfig          - Build for shark
  simpad_defconfig         - Build for simpad
  spitz_defconfig          - Build for spitz
  sx1_defconfig            - Build for sx1
  tct_hammer_defconfig     - Build for tct_hammer
  trizeps4_defconfig       - Build for trizeps4
  usb-a9260_defconfig      - Build for usb-a9260
  usb-a9263_defconfig      - Build for usb-a9263
  versatile_defconfig      - Build for versatile
  viper_defconfig          - Build for viper
  w90p910_defconfig        - Build for w90p910
  xm_x2xx_defconfig        - Build for xm_x2xx
  yl9200_defconfig         - Build for yl9200
  zylonite_defconfig       - Build for zylonite

  make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
  make V=2   [targets] 2 => give reason for rebuild of target
  make O=dir [targets] Locate all output files in "dir", including .config
  make C=1   [targets] Check all c source with $CHECK (sparse by default)
  make C=2   [targets] Force check of all c source with $CHECK

Execute "make" or "make all" to build all targets marked with [*] 
For further info see the ./README file
4-7 90 Partial Listing of Kconfig for ARM Architecture
source "init/Kconfig"

source "arch/arm/plat-omap/Kconfig"

source "arch/arm/mach-omap1/Kconfig"

source "arch/arm/mach-omap2/Kconfig"

source "net/Kconfig"

source "drivers/pci/Kconfig"

source "lib/Kconfig"

4-8 92 Snippet from .../arch/arm/Kconfig
...
source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "System Type"

choice
	prompt "ARM system type"
	default ARCH_VERSATILE

config ARCH_AAEC2000
	bool "Agilent AAEC-2000 based"
	select CPU_ARM920T
	select ARM_AMBA
	select HAVE_CLK
	help
	  This enables support for systems based on the Agilent AAEC-2000

config ARCH_INTEGRATOR
	bool "ARM Ltd. Integrator family"
...
source "arch/arm/plat-omap/Kconfig"
4-9 92 Snippet from .../arch/arm/plat-omap/Kconfig
if ARCH_OMAP

menu "TI OMAP Implementations"

config ARCH_OMAP_OTG
	bool

choice
	prompt "OMAP System Type"
	default ARCH_OMAP1

config ARCH_OMAP1
	bool "TI OMAP1"

config ARCH_OMAP2
	bool "TI OMAP2"
	select CPU_V6

config ARCH_OMAP3
	bool "TI OMAP3"
	select CPU_V7

endchoice
...
config OMAP_GPIO_SWITCH
	bool "GPIO switch support"
        default n
        help
          Say Y, if you want to have support for reporting of GPIO
          switches (e.g. cover switches) via sysfs. Your bootloader has
          to provide information about the switches to the kernel via the
          ATAG_BOARD mechanism if they're not defined by the board config.
4-10 94 Customized .config File Snippet
#
# OMAP Feature Selections
#
# CONFIG_OMAP_DEBUG_POWERDOMAIN is not set
# CONFIG_OMAP_DEBUG_CLOCKDOMAIN is not set
# CONFIG_OMAP_SMARTREFLEX is not set
CONFIG_OMAP_RESET_CLOCKS=y
CONFIG_OMAP_BOOT_TAG=y
CONFIG_OMAP_BOOT_REASON=y
# CONFIG_OMAP_COMPONENT_VERSION is not set
CONFIG_OMAP_GPIO_SWITCH=y
CONFIG_OMAP_GPIO_SWITCH2=y
# CONFIG_OMAP_MUX is not set
CONFIG_OMAP_MCBSP=y
4-11 95 Makefile from .../arch/arm/plat-omap/ Kernel Subdirectory
#
# Makefile for the linux kernel.
#

# Common support
obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
	 usb.o fb.o vram.o vrfb.o io.o
obj-m :=
obj-n :=
obj-  :=

# OCPI interconnect support for 1710, 1610 and 5912
obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o

obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o

obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
obj-$(CONFIG_OMAP_BOOT_REASON) += bootreason.o
obj-$(CONFIG_OMAP_COMPONENT_VERSION) += component-version.o
obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o
obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
obj-y += $(i2c-omap-m) $(i2c-omap-y)

# OMAP mailbox framework
obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o