\subsection{Fastboot}
\begin{frame}
  \frametitle{Definition}
  \begin{itemize}
  \item Fastboot is a protocol to communicate with bootloaders over
    USB
  \item It is very simple to implement, making it easy to port on
    both new devices and on host systems
  \item Accessible with the \code{fastboot} command
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The Fastboot protocol}
  \begin{itemize}
  \item It is very restricted, only 10 commands are defined in the
    protocol specifications
  \item It is synchronous and driven by the host
  \item Allows to:
    \begin{itemize}
      \item Transmit data
      \item Flash the various partitions of the device
      \item Get variables from the bootloader
      \item Control the boot sequence
    \end{itemize}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Session example}
  \begin{center}
    \includegraphics[height=0.8\textheight]{slides/android-bootloaders-fastboot/fastboot.pdf}
  \end{center}
\end{frame}

\begin{frame}
  \frametitle{Booting into Fastboot}
  \begin{itemize}
  \item On most devices, it's disabled by default (the bootloader
    won't even implement it)
  \item On devices that support it, such as Google Nexus', you have
    several options:
    \begin{itemize}
    \item Use a combination of keys at boot to start the bootloader
      right away into its fastboot mode
    \item Use the \code{adb reboot bootloader} command on your
      workstation. The device will reboot in fastboot mode, awaiting
      for inputs.
    \end{itemize}
  \item You can then interact with the device through the
    \code{fastboot} command on your workstation
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Major Fastboot Commands}
  \begin{itemize}
  \item You can get all the commands through \code{fastboot -h}
  \item The most widely used commands are:
    \begin{description}
    \item[devices] Lists the fastboot-capable devices
    \item[boot] Downloads a kernel and boots on it
    \item[erase] Erases a given flash partition name
    \item[flash] Writes a given file to a given flash partition
    \item[getvar] Retrieves a variable from the bootloader
    \item[continue] Goes on with a regular boot
    \end{description}
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{\code{getvar} Variables}
  \begin{itemize}
  \item Vendor-specific variables must also begin with a upper-case
    letter. Variables beginning with a lower-case letter are reserved
    for the Fastboot specifications and their evolution.
    \begin{description}
    \item[version] Version of the Fastboot protocol implemented
    \item[version-bootloader] Version of the bootloader
    \item[version-baseband] Version of the baseband firmware
    \item[product] Name of the product
    \item[serialno] Product serial number
    \item[secure] Does the bootloader require signed images?
    \end{description}
  \end{itemize}
\end{frame}
