\section{Introduction to Embedded Linux}

\begin{frame}
  \frametitle{Birth of free software}
  \begin{itemize}
  \item 1983, Richard Stallman, {\bf GNU project} and the {\bf free
      software} concept.  Beginning of the development of {\em gcc},
    {\em gdb}, {\em glibc} and other important tools
  \item 1991, Linus Torvalds, {\bf Linux kernel project}, a Unix-like
    operating system kernel. Together with GNU software and many other
    open-source components: a completely free operating system,
    GNU/Linux
  \item ~1995, Linux is more and more popular on server systems
  \item ~2000, Linux is more and more popular on {\bf embedded
      systems}
  \item ~2008, Linux is more and more popular on mobile devices
  \item ~2010, Linux is more and more popular on phones
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Free software ?}
  \begin{itemize}
  \item A program is considered {\bf free} when its license offers to
    all its users the following {\bf four} freedoms
    \begin{itemize}
    \item Freedom to run the software for any purpose
    \item Freedom to study the software and to change it
    \item Freedom to redistribute copies
    \item Freedom to distribute copies of modified versions
    \end{itemize}
  \item Those freedoms are granted for both commercial and
    non-commercial use
  \item They imply the availability of source code, software can be
    modified and distributed to customers
  \item {\bf Good match for embedded systems !}
  \end{itemize}
\end{frame}

\begin{frame}{What is embedded Linux ?}
  \huge
  \begin{center}
    Embedded Linux is the usage of the {\bf Linux kernel} and various
    {\bf open-source} components in embedded systems
  \end{center}
\end{frame}

\subsection[Why embedded Linux ?]{Advantages of Linux and open-source
  for embedded systems}

\begin{frame}
  \frametitle{Re-using components}
  \begin{itemize}
  \item The key advantage of Linux and open-source in embedded systems
    is the {\bf ability} to re-use components
  \item The open-source ecosystem already provides many components for
    standard features, from hardware support to network protocols,
    going through multimedia, graphic, cryptographic libraries, etc.
  \item As soon as a hardware device, or a protocol, or a feature is
    wide-spread enough, high chance of having open-source components
    that support it.
  \item Allows to quickly design and develop complicated products,
    based on existing components.
  \item No-one should re-develop yet another operating system kernel,
    TCP/IP stack, USB stack or another graphical toolkit library.
  \item {\bf Allows to focus on the added value of your product.}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Low cost}
  \begin{itemize}
  \item Free software can be duplicated on as many devices as you
    want, free of charge.
  \item If your embedded system uses only free software, you can
    reduce the cost of software licenses to zero. Even the development
    tools are free, unless you choose a commercial embedded Linux
    edition.
  \item {\bf Allows to have an higher budget for the hardware or to
      increase the company’s skills and knowledge}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Full control}
  \begin{itemize}
  \item With open-source, you have the source code for all components
    in your system
  \item Allows unlimited modifications, changes, tuning, debugging,
    optimization, for an unlimited period of time
  \item Without locking or dependency from a third-party vendor
    \begin{itemize}
    \item To be true, non open-source components must be avoided when
      the system is designed and developed
    \end{itemize}
  \item {\bf Allows to have full control over the software part of
      your system}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Quality}
  \begin{itemize}
  \item Many open-source components are widely used, on millions of
    systems
  \item Usually higher quality than what an in-house development can
    produce, or even proprietary vendors
  \item Of course, not all open-source components are of good quality,
    but most of the widely-used ones are.
  \item {\bf Allows to design your system with high-quality components
      at the foundations}
\end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Eases testing of new features}
  \begin{itemize}
  \item Open-source being freely available, it is easy to get a piece
    of software and evaluate it
  \item Allows to easily study several options while making a choice
  \item Much easier than purchasing and demonstration procedures
    needed with most proprietary products
  \item {\bf Allows to easily explore new possibilities and solutions}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Community support}
  \begin{itemize}
  \item Open-source software components are developed by communities
    of developers and users
  \item This community can provide a high-quality support: you can
    directly contact the main developers of the component you are
    using. The likelyhood of getting an answer doesn't depend what
    company you work for.
  \item Often better than traditional support, but one needs to
    understand how the community works to properly use the community
    support possibilities
  \item {\bf Allows to speed up the resolution of problems when
      developing your system}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Taking part into the community}
  \begin{itemize}
  \item Possibility of taking part into the development community of
    some of the components used in the embedded systems: bug
    reporting, test of new versions or features, patches that fix bugs
    or add new features, etc.
  \item Most of the time the open-source components are not the core
    value of the product: it’s the interest of everybody to contribute
    back.
  \item For the {\em engineers}: a very {\bf motivating} way of being
    recognized outside the company, communication with others in the
    same field, {\bf opening of new possibilities}, etc.
  \item For the {\em managers}: {\bf motivation factor} for engineers,
    allows the company to be {\bf recognized} in the open-source
    community and therefore get support more easily and be {\bf more
      attractive} to open-source developers
\end{itemize}
\end{frame}

\subsection[Systems running Linux]{A few examples of embedded systems
  running Linux}

\begin{frame}
  \frametitle{Personal routers}
  \begin{center}
    \includegraphics[width=0.7\textwidth]{slides/sysdev-intro/freebox.jpg}
  \end{center}
\end{frame}

\begin{frame}
\frametitle{Television}
  \begin{center}
    \includegraphics[width=0.7\textwidth]{slides/sysdev-intro/television.jpg}
  \end{center}
\end{frame}

\begin{frame}
\frametitle{Point of sale terminal}
  \begin{center}
    \includegraphics[width=0.7\textwidth]{slides/sysdev-intro/point-of-sale.jpg}
  \end{center}
\end{frame}

\begin{frame}
\frametitle{Laser cutting machine}
  \begin{center}
    \includegraphics[width=0.7\textwidth]{slides/sysdev-intro/laser-cutting-machine.jpg}
  \end{center}
\end{frame}

\begin{frame}
\frametitle{Viticulture machine}
  \begin{center}
    \includegraphics[width=0.7\textwidth]{slides/sysdev-intro/viticulture-machine.jpg}
  \end{center}
\end{frame}

\subsection{Embedded hardware for Linux systems}

\begin{frame}
  \frametitle{Processor and architecture (1)}
  \begin{itemize}
  \item The Linux kernel and most other architecture-dependent component support a
    wide range of 32 and 64 bits architectures
    \begin{itemize}
    \item x86 and x86-64, as found on PC platforms, but also embedded systems
      (multimedia, industrial)
    \item ARM, with hundreds of different SoC (multimedia, industrial)
    \item PowerPC (mainly real-time, industrial applications)
    \item MIPS (mainly networking applications)
    \item SuperH (mainly set top box and multimedia applications)
    \item Blackfin (DSP architecture)
    \item Microblaze (soft-core for Xilinx FPGA)
    \item Coldfire, SCore, Tile, Xtensa, Cris, FRV, AVR32, M32R
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Processor and architecture (2)}
  \begin{itemize}
  \item Both MMU and no-MMU architectures are supported, even though
    no-MMU architectures have a few limitations.
  \item Linux is not designed for small microcontrollers.
  \item Besides the toolchain, the bootloader and the kernel, all
    other components are generally {\bf architecture-independent}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{RAM and storage}
  \begin{itemize}
  \item {\bf RAM}: a very basic Linux system can work within 8 MB of
    RAM, but a more realistic system will usually require at least 32
    MB of RAM. Depends on the type and size of applications.
  \item {\bf Storage}: a very basic Linux system can work within 4 MB
    of storage, but usually more is needed.
    \begin{itemize}
    \item Flash storage is supported, both NAND and NOR flash, with
      specific filesystems
    \item Block storage including SD/MMC cards and eMMC is supported
    \end{itemize}
  \item Not necessarily interesting to be too restrictive on the
    amount of RAM/storage: having flexibility at this level allows to
    re-use as many existing components as possible.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Communication}
  \begin{itemize}
  \item The Linux kernel has support for many common communication
    busses
    \begin{itemize}
    \item I2C
    \item SPI
    \item CAN
    \item 1-wire
    \item SDIO
    \item USB
    \end{itemize}
  \item And also extensive networking support
    \begin{itemize}
    \item Ethernet, Wifi, Bluetooth, CAN, etc.
    \item IPv4, IPv6, TCP, UDP, SCTP, DCCP, etc.
    \item Firewalling, advanced routing, multicast
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Types of hardware platforms}
  \begin{itemize}
  \item {\bf Evaluation platforms} from the SoC vendor. Usually
    expensive, but many peripherals are built-in. Generally unsuitable
    for real products.
  \item {\bf Component on Module}, a small board with only
    CPU/RAM/flash and a few other core components, with connectors to
    access all other peripherals. Can be used to build end products
    for small to medium quantities.
  \item {\bf Community development platforms}, a new trend to make a
    particular SoC popular and easily available. Those are
    ready-to-use and low cost, but usually have less peripherals than
    evaluation platforms. To some extent, can also be used for real
    products.
  \item {\bf Custom platform}. Schematics for evaluation boards or
    development platforms are more and more commonly freely available,
    making it easier to develop custom platforms.
\end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Criteria for choosing the hardware}
  \begin{itemize}
  \item Make sure the hardware you plan to use is already supported by
    the Linux kernel, and has an open-source bootloader, especially
    the SoC you’re targeting.
  \item Having support in the official versions of the projects
    (kernel, bootloader) is a lot better: quality is better, and new
    versions are available.
  \item Some SoC vendors and/or board vendors do not contribute their
    changes back to the mainline Linux kernel. Ask them to do so, or
    use another product if you can. A good measurement is to see the
    delta between their kernel and the official one.
  \item {\bf Between properly supported hardware in the official Linux
      kernel and poorly-supported hardware, there will be huge
      differences in development time and cost.}
  \end{itemize}
\end{frame}

\subsection{Embedded Linux system architecture}

\begin{frame}
  \frametitle{Global architecture}
  \begin{center}
    \includegraphics[width=0.9\textwidth]{slides/sysdev-intro/global-architecture.pdf}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{Software components}
  \begin{itemize}
  \item Cross-compilation toolchain
    \begin{itemize}
    \item Compiler that runs on the development machine, but generates
      code for the target
    \end{itemize}
  \item Bootloader
    \begin{itemize}
    \item Started by the hardware, responsible for basic
      initialization, loading and executing the kernel
    \end{itemize}
  \item Linux Kernel
    \begin{itemize}
    \item Contains the process and memory management, network stack,
      device drivers and provides services to userspace applications
    \end{itemize}
  \item C library
    \begin{itemize}
    \item The interface between the kernel and the userspace
      applications
    \end{itemize}
  \item Libraries and applications
    \begin{itemize}
    \item Third-party or in-house
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Embedded Linux work}

  Several distinct tasks are needed when deploying embedded Linux in a
  product:

  \begin{itemize}
  \item {\bf Board Support Package development}
    \begin{itemize}
    \item A BSP contains a bootloader and kernel with the suitable
      device drivers for the targeted hardware
    \item Purpose of our {\em Kernel Development} training
    \end{itemize}
  \item {\bf System integration}
    \begin{itemize}
    \item Integrate all the components, bootloader, kernel,
      third-party libraries and applications and in-house applications
      into a working system
    \item Purpose of {\em this} training
    \end{itemize}
  \item {\bf Development of applications}
    \begin{itemize}
    \item Normal Linux applications, but using specifically chosen
      libraries
    \end{itemize}
  \end{itemize}
\end{frame}
