\section{Understanding the Boot Sequence}

\begin{frame}
   {Boot Sequence}

   \begin{multicols}{2}

      \begin{enumerate}
         \item The \textbf{BIOS}/\textbf{UEFI} locates and executes
         the boot program, or boot loader.
         \item The boot loader loads the kernel.
         \item The kernel starts the \textbf{init} process
         (\verb?pid=1?).
         \item \textbf{init} manages system initialization,
         using \textbf{systemd} or the older
         \textbf{Upstart} and \textbf{SysVinit} startup
         scripts.

      \end{enumerate}

      \begin{figure}[H]
         \includegraphics[height=3.4in]{IMAGES/boot_sequence}
         \caption{Boot Sequence}
      \end{figure}

   \end{multicols}
\end{frame}

\cprotect\note{

   When power is applied to the computer, the computer can
   only perform the operations the \textbf{BIOS}
   (\textbf{B}asic \textbf{I}nput \textbf{O}utput
   \textbf{S}ystem) orders it to do.

   First, the \textbf{BIOS} runs the \textbf{POST}
   (\textbf{P}ower \textbf{O}n \textbf{S}elf \textbf{T}est)
   which checks memory and hardware and then searches a
   specific location or device for a boot program.
   Typically, the boot program in found in the device's
   \textbf{MBR} (\textbf{M}aster \textbf{B}oot
   \textbf{R}ecord), or using \textbf{UEFI}.
   Control of the computer is then
   transferred to this boot program (usually
   \textbf{GRUB}).

   The boot program then loads the kernel into memory and
   executes it.  On \textbf{x86} platforms (and many
   others) the kernel first has to decompress itself in
   place.  It then performs hardware checks, gains access
   to important peripheral hardware, and eventually runs
   the \textbf{init} process.  The \textbf{init} process in
   turn continues the system startup, running \textbf{init}
   scripts if \textbf{SysVinit} is being used, or managing
   either \textbf{Upstart} or \textbf{systemd}.

   Newer computers are moving to \textbf{UEFI}, a
   replacement for the \textbf{BIOS}, which performs many
   of the same functions.

}


\begin{frame}
   {BIOS}

   \begin{itemize}
      \item Typically a \textbf{ROM} chip
      \item Contains code to control keyboard, display, disks
      \item During boot up, loads the boot loader
   \end{itemize}

\end{frame}

\cprotect\note{

   On the \textbf{x86} architecture, the \textbf{BIOS}
   contains all the code required to gain initial access to
   the keyboard, display screen, disk drives, serial
   communications, and a number of miscellaneous
   functions. Once the full system is running, most of
   these devices will have enhanced capabilities when
   complete and specialized device drivers can be loaded
   and take over.

   The \textbf{BIOS} is typically placed in a \textbf{ROM}
   chip that comes with the computer (it is often called a
   \textbf{ROM BIOS}). This ensures that the \textbf{BIOS}
   will always be available and will not be damaged by disk
   failures. It also makes it possible for a computer to
   boot itself.

   During the boot process, the \textbf{BIOS} loads the
   boot loader.

}

\section{Boot Loaders}
\begin{frame}
   {Boot Loaders}

   \begin{itemize}
      \item \textbf{GRUB}
      \item \textbf{efibootmgr}
      \item \textbf{LILO}
      \item \textbf{Das U-Boot}
   \end{itemize}

\end{frame}

\cprotect\note{



   Virtually all (non-embedded) modern \textbf{Linux}
   distributions use \textbf{GRUB} (\textbf{GR}and
   \textbf{U}nified \textbf{B}oot Loader).  \textbf{GRUB}'s
   features include the ability to boot multiple operating
   systems, both a graphical and text based interface
   allowing ease of use over a serial cable, a powerful
   command line interface for interactive configuration,
   network-based diskless booting, and other advanced
   features.

   \textbf{efibootmgr} is not actually a boot loader, but
   is a \textbf{boot manager}, used in conjunction with
   \textbf{GRUB} on multi-boot EFI systems.

   The Linux Loader (\textbf{LILO}) is old and obsolete.

   \textbf{Das U-Boot} is in wide usage for embedded systems.
   There are some other boot loaders used, including \textbf{bareboot}.
   However, we are not focused on embedded systems in the present
   course.

}



