Embedded Linux Odp
Upcoming SlideShare
Loading in...5
×
 

Embedded Linux Odp

on

  • 3,038 views

Presentation from the October 2008 meeting of the ColoradoSprings Open Source Users Group.

Presentation from the October 2008 meeting of the ColoradoSprings Open Source Users Group.

Statistics

Views

Total Views
3,038
Views on SlideShare
3,034
Embed Views
4

Actions

Likes
1
Downloads
83
Comments
0

1 Embed 4

http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Embedded Linux Odp Embedded Linux Odp Presentation Transcript

  • Embedded Linux Crash Course Eric Gustafson http://embedded.gustafson-consulting.com ericg@gustafson-consulting.com
  • Agenda ● What is “Embedded”? ● Example Walk Through ● Why Linux as an embedded platform? ● References – Convention: colored names have a reference in the references.
  • What is Embedded? ● Embedded is a very nebulous term. ● My Definition: NOT a General Purpose Computer ● Some Linux Examples: ● TiVo ● PrismIQ ● Google Phone (Android) ● RioReceiver ● Home Routers ● Soekris – ActionTec (Qwest DSL) ● An Old PC
  • Target System “Application” BusyBox C Library (uClibc) (system programs) Linux Kernel Boot syslinux (on disk) BIOS (firmware) Hardware – Intel x86 / PC Architecture
  • System Boot 1. Hardware Reset → Bootloader ● BIOS Executes → syslinux (i.e. DOS format floppy/CF) ● syslinux → loads the Linux Kernel 2. Linux Kernel initializes ● Kernel mounts initrd.gz, the “root” filesystem. 3. Kernel → /sbin/init (from BusyBox) 4. init → /etc/rc (sh script – developer provided) 5. rc script → “Application”
  • The Build Artifacts – What makes up our system – ● Hardware – provided ● BIOS – provided ● syslinux – {download, precompiled} ● Linux Kernel – BUILD ● µclibc (C Library) - BUILD ● BusyBox (core programs) – BUILD ● “Application” – BUILD
  • Cross Compiler Tool Chain – How to build the Artifacts – ● Cross Compilation – Gnu Binutils ● Assembler, linker, etc. – Gnu C Compiler – C Library – uClibc ● Others: Newlib, Gnu C Library – Linux Kernel – just the headers ● Packaging – initrd.gz – cramfs tools ● Alternatives: ext2fs, jffs2, many others
  • End to End Build – Getting our hands a little dirty – ● Buildroot ● http://buildroot.uclibc.org – Menu based configuration – Many options for configuration and architecture – Does everything ● builds cross compiler tool chain ● compiles kernel, C library (μClibc), BusyBox ● packages root filesystem image – Leaves all artifacts, and configuration, in place. – Buildroot is an excellent place to start.
  • From Scratch – Getting our hands really dirty – ● Build Cross Development Tools – Build Binutils – Install Linux Kernel Headers – Build gcc-initial (no C Library dependencies) – Build C library (μClibc) – Build gcc-final (which uses the C library) ● X-Compile Target Artifacts – Configure & Compile Linux Kernel → bzImage (the Kernel) – Configure & Compile BusyBox – Compile “Application”
  • From Scratch (2) – Getting our hands really dirty – ● Package Root Filesystem – Make a temp directory to act as “/”, call it “root_dir” – Place BusyBox, μClibc, and “Application” in directory “root_dir” using a typical root layout. – mkfs -t cramfs root_dir initrd – gzip -9 initrd → “initrd.gz”, the initrd image ● Place Artifacts on boot media. – Create a DOS format floppy (or CF card) – syslinux /dev/fd0 # only needed the first time – Mount /dev/fd0 ● Create and copy syslinux.cfg to /dev/fd0 – This is a small config file w/ kernel boot arguments ● Copy kernel, bzImage, to /dev/fd0 ● Copy the root filesystem, initrd.gz, to /dev/fd0
  • Why Linux? ● Open Source ● Modifications are common, and easy. ● Entire tool chain is freely available – low cost to entry. ● The Kernel has LOTS of configurable drivers. – Common embedded chipset support. – Theres more than just chipset support though. ● File systems, network protocols, and lots more. ● Momentum – Linux's success is feeding on itself.
  • References ● Compiler Tools ● C Libraries – GNU Binutils - – μClibc - http://uclibc.org/ http://www.gnu.org/software/binutils – Newlib - – GNU C Compiler - http://sourceware.org/newlib/ http://gcc.gnu.org – Gnu C Library - ● GCC requires GMP and MPFR http://www.gnu.org/software/libc/ – GMP - http://gmplib.org/ – MPFR - http://www.mpfr.org/ ● Linux Kernel – http://www.kernel.org/ – http://www.linuxdocs.org/ HOWTOs/Kernel-HOWTO.html
  • References ● Boot loaders ● File system creation – syslinux - – cramfs - http://syslinux.zytor.com/wiki/ http://sourceforge.net/projects/cramfs/ ● pxelinux – Ethernet Boot – JFFS2 - ● isolinux – CD Boot http://sourceware.org/jffs2/ – GRUB - – Ext2fs - http://e2fsprogs.sourceforge.net/ext2.html http://www.gnu.org/software/grub/ – LILO ● http://lilo.go.dyndns.org/ ● http://tldp.org/HOWTO/LILO.html
  • References ● Cross Dev Systems ● Embedded Linux Howto – Buildroot - – http://linuxant.hit.bg/Embedded- http://buildroot.uclibc.org/ Linux-Howto.html – crosstools - http://www.kegel.com/crosstool/