\subsection{Dalvik and Zygote}
\begin{frame}
  \frametitle{Dalvik}
  \begin{itemize}
  \item Dalvik is the virtual machine, executing Android applications
  \item It is an interpreter written in C/C++, and is designed to be portable,
    lightweight and run well on mobile devices
  \item It is also designed to allow several instances of it to be run
    at the same time while consuming as little memory as possible
  \item Two execution modes
    \begin{itemize}
    \item \code{portable}: the interpreter is written in C, quite
      slow, but should work on all platforms
    \item \code{fast}: Uses the \emph{mterp} mechanism, to define
      routines either in assembly or in C optimized for a specific
      platform. Instruction dispatching is also done by computing the
      handler address from the opcode number
    \end{itemize}
  \item It uses the \emph{Apache Harmony} Java framework for its core
    libraries
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Zygote}
  \begin{itemize}
    \item Dalvik is started by \code{Zygote}
    \item \code{frameworks/base/cmds/app_process}
    \item At boot, Zygote is started by init, it then
      \begin{itemize}
      \item Initializes a virtual machine in its address space
      \item Loads all the basic Java classes in memory
      \item Starts the system server
      \item Waits for connections on a UNIX socket
      \end{itemize}
    \item When a new application should be started:
      \begin{itemize}
      \item Android connects to Zygote through the socket to request
        the start of a new application
      \item Zygote forks
      \item The child process loads the new application and start
        executing it
      \end{itemize}
  \end{itemize}
\end{frame}
