\documentclass{beamer}
\usetheme{linutronix}
\usepackage{german}
\usepackage[utf8]{inputenc}
\usepackage{pgf}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{listings}

\title{Treiber Modul Grundlagen}
\institute{Linutronix GmbH}

\begin{document}
\lstset{language=[ANSI]C}

\maketitle

% ----- Slide Aufbau ------------------
\begin{frame}[fragile]
\frametitle{Aufbau eines Treiber Moduls}
\pause
\begin{itemize}
\item Header
\pause
\begin{scriptsize}
\begin{lstlisting}[frame=trBL]
#include <linux/init.h>
#include <linux/module.h>
\end{lstlisting}
\end{scriptsize}
\pause
\item Init
\pause
\begin{scriptsize}
\begin{lstlisting}[frame=trBL]
static int __init vain_init(void)
{
        printk(KERN_INFO "vain_init: done\n");
        return 0;
}

module_init(vain_init);
\end{lstlisting}
\end{scriptsize}
\end{itemize}
\end{frame}

% ----- Slide Aufbau (fort.) ------------------
\begin{frame}[fragile]
\frametitle{Aufbau (fort.)}
\begin{itemize}
\item Exit
\pause
\begin{scriptsize}
\begin{lstlisting}[frame=trBL]
static void __exit vain_exit(void)
{
        printk(KERN_INFO "vain_exit: done\n");
}

module_exit(vain_exit);
\end{lstlisting}
\end{scriptsize}
\pause
\item Beschreibung
\pause
\begin{tiny}
\begin{lstlisting}[frame=trBL]
MODULE_AUTHOR("Benedikt Spranger <b.spranger@linutronix.de>");
MODULE_DESCRIPTION("a more or less useless module");
MODULE_LICENSE("GPL v2");
\end{lstlisting}
\end{tiny}
\end{itemize}
\end{frame}

% ----- Slide Rumpf Treiber ------------------
\begin{frame}[fragile]
\frametitle{Rumpf Treiber}
\begin{tiny}
\lstinputlisting{vain/vain.c}
\end{tiny}
\end{frame}

% ----- Slide Makefile ------------------
\begin{frame}[fragile]
\frametitle{Makefile}
\begin{scriptsize}
\lstinputlisting[language=make]{vain/Makefile}
\end{scriptsize}
\end{frame}

% ----- Slide build ------------------
\begin{frame}[fragile]
\frametitle{Bauen, laden und entladen des Moduls}
\begin{itemize}
\item Bauen
\pause
\begin{tiny}
\begin{verbatim}
$ make
make -C /lib/modules/2.6.30/build M=/path/to/vain modules
make[1]: Entering directory `/usr/src/linux-2.6.30'
  CC [M]  /path/to/vain/vain.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /path/to//vain/vain.mod.o
  LD [M]  /path/to//vain/vain.ko
make[1]: Leaving directory `/usr/src/linux-2.6.30'
$
\end{verbatim}
\end{tiny}
\pause
\item Laden
\pause
\begin{tiny}
\begin{verbatim}
# insmod ./vain.ko
vain_init: done
#
\end{verbatim}
\end{tiny}
\item Entladen
\pause
\begin{tiny}
\begin{verbatim}
# rmmod vain
vain_exit: done
#
\end{verbatim}
\end{tiny}
\end{itemize}
\end{frame}

\end{document}
