\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage[left=2cm, right=2cm, top=2cm]{geometry}
\usepackage{courier} % monospace font for code listings
\lstset{
    basicstyle=\footnotesize\ttfamily,
        language=c,
}

\title{CS380L: Lab 3}
\author{Chris Rossbach}
\date{April 2019}
\begin{document}
\maketitle
\section{Introduction}
% High-level description of the lab.
% Report how much time you spent on the lab.
% REMEMBER TO SUBMIT:
% - Makefile that generates 3 binaries: apager, dpager, and hpager
% - the code for your pagers and shared library
% - this report

\section{Linux Kernel Loader}
% Describe in pseudo-code the steps that occur in creating the memory image of a new process during execve.

\section{All-at-once Pager}
\subsection{Implementation}
% Describe your implementation and challenges you faced.
\subsection{Questions}
\textbf{What is different between running main and jmping to the entry point?}\\
        It depends!\\
        \textbf{What happens if you try to run ./apager apager?}\\
        Apager loads apager!\\
        \textbf{What happens when the program under test calls malloc?}\\
        We have to skip most of the slides!

        \section{Demand Pager}
        \subsection{Implementation}
        % Describe your implementation and challenges you faced.

        \subsection{Memory Access Errors}
        \begin{lstlisting}
        int main() {
            int *zero = NULL;
            return *zero;
        }
\end{lstlisting}
% What does your demand pager do with this program? 
% What should it do? 
% Describe the method your demand pager used to preserve memory access errors present in the program under test.

\section{Hybrid Pager}
% Explain the heuristics you use to implement the hybrid loader.

\section{Tests}
% Describe the at least two test programs that your loaders will load and execute. 
% Describe what functionality of your loaders your test programs exercise. 
% Hypothesize about their execution time and memory use on the different loaders.

\section{Results}
% Present the execution time and memory usage of the tests when they are run by your loader.
\begin{figure}[h!!!!]
\centering
\includegraphics[width=.65\textwidth]{figures/pager-memory-usage.png}
\caption{Memory usage of the pagers on different tests}
\label{fig:pager-memory-usage}
\end{figure}
\begin{figure}[h!!!!]
\centering
\includegraphics[width=.65\textwidth]{figures/pager-exec-time.png}
\caption{Execution time of the pagers on different tests}
\label{fig:pager-exec-time}
\end{figure} 
\subsection{All-at-once vs. Demand Pager}
% Demonstrate at least one program that runs faster for the all-at-once loader, and one that uses less memory for the demand paging loader.
\subsection{Hybrid Pager}
% Find a workload that runs faster on the hybrid pager with your prediction algorithm than without and explain why.
% Present the results of mapping 3 pages instead of 2 in the hybrid pager and compare to "whatever is most illuminating".

\subsection{Dynamically-Linked Executables}

% How many symbol lookups were made to run hello world? 
% Describe trade-offs of relying on dynamic libraries?

% Describe what LD_PRELOAD does on Linux. Describe why it might be useful and some example uses.

% Describe dlsym and RTLD_NEXT
% Descibe how your shared library works, what compile flags you used, and how you tested it.

\end{document}
