\documentclass[total,pdf]{prosper}
\usepackage[toc,highlight,Tycja]{HA-prosper}

\usepackage{alltt,key,xr,cols,rcs,acro,nick,%
  graphicx,varioref,explanation,booktabs,xspace}
\usepackage[nolineno,noindent]{lgrind}

%\definecolor{green}{rgb}{0,1,0}

\RCS $Revision: 1.1 $

% Copyright (c) 2004 by Nick Urbanik <nicku(at)nicku.org>.
% This material may be distributed only subject to the terms and
% conditions set forth in the Open Publication License, v1.0 or later
% (the latest version is presently available at
% http://www.opencontent.org/openpub/).
                                                                                \renewcommand*{\bs}{\texttt{\char '134}} % Backslash `\'
\newcommand*{\labTitle}{Summary of the Subject}
\newcommand*{\subject}{Operating Systems and Systems Integration}
\newcommand*{\emphcolour}[1]{\emph{\red#1}}
\newcommand*{\link}[2]{\href{#2}{#1} \path{#2}}

\providecommand*{\RPM}{\acro{RPM}\xspace}
\providecommand*{\CD}{\acro{CD}\xspace}
\providecommand*{\IPC}{\acro{IPC}\xspace}
\providecommand*{\UID}{\acro{UID}\xspace}
\providecommand*{\GID}{\acro{GID}\xspace}
\providecommand*{\SMP}{\acro{SMP}\xspace}
\providecommand*{\API}{\acro{API}\xspace}
\providecommand*{\OK}{\acro{OK}\xspace}
% Get rid of that horrible hash mark in slide numbers in ppr-prv.cls:
\def\no{}

\title{Summary of the Subject}

%% \author{Nick Urbanik \texttt{<nicku\at{}nicku.org>}\\
%% \footnotesize{}Copyright Conditions: GNU FDL (see
%% \url{http://www.gnu.org/licenses/fdl.html})}
\author{Nick Urbanik\\
  \email{nicku@nicku.org}\\
  \institution{A computing department}\\
  \footnotesize{}Copyright Conditions: Open Publication License\\
  (see \url{http://www.opencontent.org/openpub/})}%

%\institution{A computing department}
\slideCaption{OSSI --- Processes and Threads --- ver. \RCSRevision}
%%%\Logo{\includegraphics[width=15mm]{ict-logo-smaller}}

\DefaultTransition{Wipe}
\TitleSlideNav{FullScreen}
\NormalSlideNav{ShowBookmarks}
\LeftFoot{OSSI --- ver. \RCSRevision}
\RightFoot{Summary of the Subject}
 
\begin{document}
\maketitle

\tsectionandpart{Open Protocols and Open Standards}

\begin{slide}{Open Standards do not limit access}
  \begin{itemize}
  \item Data encoded in a proprietary format may be expensive to
    recover far into the future
  \item Legal restrictions imposed by patents may require additional
    royalties to be paid in addition to the costs of
    reverse-engineering.
  \item See the updated notes on Free Software and Open Standards.
  \end{itemize}
\end{slide}

\tsectionandpart{Operating System Types}

\begin{slide}{Four Structures}
  \begin{itemize}
  \item We covered four \OS structures:
    \begin{itemize}
    \item Monolithic
    \item Layered
    \item Microkernel
    \item Virtual Machine
    \end{itemize}
    \begin{description}
    \item[Monolithic] \OS: examples: Linux, some \UNIX systems.  All
      kernel code executes in the same address space---low
      communication overhead
    \item[Layered] Attempts to isolate parts of \OS from each other to
      make the system more modular; has increased overhead of
      communication between the layers
    \item[Microkernel] tries to make the \OS kernel as small as
      possible.  Overhead of communication between the many simple
      components makes it hard for anyone to understand the system.
    \end{description}
  \item Make sure you know what a \emphcolour{system call} and a
    \texttt{trap} are.
  \end{itemize}
\end{slide}

\begin{slide}{Virtual Machine}
  \begin{itemize}
  \item \IBM sell many mainframes
    \begin{itemize}
    \item very large, reliable, expensive computers with high input,
      output capability
    \item Run many \emphcolour{virtual machines} on the one physical
      machine
    \item Each virtual machine is isolated from the others, so virtual
      machines can be set up on the one mainframe for two companies
      that are competitors
      \begin{itemize}
      \item No company can directly find out what is on the other
        virtual machines
      \end{itemize}
    \item One mainframe {\blue{}can replace many smaller servers in a
        data centre.}
    \end{itemize}
  \end{itemize}
\end{slide}

\begin{slide}{Why mainframe better than servers?}
  \begin{itemize}
  \item A company can choose whether to pay for a single mainframe or
    a number of separate server machines to provide their network
    services
  \item The mainframe may cost less than an equivalent number of
    individual servers because:
    \begin{itemize}
    \item The load can be shared among all the virtual machines, and
      the mainframe \CPU can be used effectively
    \item Individual servers need to have enough \CPU processing power
      to meet peak demand, but normal traffic will be much less than
      the peak.
    \item Because of this, the individual servers will have a lot of
      unused processing power.
    \item The mainframe will use much less floor space, and so save
      money
    \item The mainframe will use much less electricity than the
      individual servers
    \item The mainframe will use much less air conditioning power, and
      save a lot of electricity.
    \end{itemize}
  \end{itemize}
\end{slide}

\tsectionandpart{Shell Programming}% and ssh

\begin{slide}{Shell Programming}
  \begin{itemize}
  \item Make sure you understand what you are doing in the shell
    assignment.
  \item Understand how to use the \texttt{keychain} program with your
    assignment.
  \item \textbf{Note:} I have updated the pages about
  \texttt{keychain} in the notes in Module~13.
  \end{itemize}
\end{slide}

\tsectionandpart[toc=POSIX Commands,bm=POSIX Commands]%
{POSIX Commands}% including diff, cron

\begin{slide}{POSIX}
  \begin{itemize}
  \item \POSIX is a standard, which defines a standard set of system
    calls, a standard set of commands, and a standard shell
    programming language.
  \item Linux aims to be compliant with the \POSIX standards.  Many
    \UNIX systems are \POSIX compliant.
  \end{itemize}
\end{slide}

\begin{slide}{\texttt{diff}}
  \begin{itemize}
  \item Often used like this:
\begin{alltt}
$ \textbf{diff -u \meta{orignal file} \meta{new file}}
\end{alltt}%$
  \item Output of the \texttt{diff} command shows the differences
    between two sets of files.
  \item Output is per line:
    \begin{itemize}
    \item if a line in \meta{original file} is not in \meta{new file},
      the output will have a `\texttt{-}' at the start of the line.
    \item if a line in \meta{original file} is in \meta{new file}, but
      not \meta{original file}, the output will have a `\texttt{+}' at
      the start of the line.
    \item if a line has changed, even by one character, the line
      from \meta{original file} will have a `\texttt{-}' in the output,
      while the line from \meta{new file} will have a `\texttt{+}'.
    \item Two or so lines are shown around the changes, so that it is
      easy to see where the change is.  These \emph{context lines} do
      not have any a `\texttt{+}' or `\texttt{-}' in front, but a
      space \texttt{' '} instead.
    \end{itemize}
  \end{itemize}
\end{slide}

\begin{slide}{\texttt{find}, \texttt{xargs}}
  \begin{itemize}
  \item These two tools often are used go together.
  \item Make sure you understand how \texttt{xargs} works.
    \begin{description}
    \item[find] uses logic expressions to find files that match
      particular requirements.
    \item[grep] used to search for strings in \emph{files} \ldots
    \item and also in standard output.
    \end{description}
  \end{itemize}
\end{slide}

\tsectionandpart{Files and File Permissions}

\begin{slide}{File Permissions and Symbolic Links}
  \begin{itemize}
  \item Make sure that you have worked though and
    \emphcolour{understood} all the problems in the \link{Permissions
      Tutorial}{http://nicku.org/ossi/lab/permissions/permissions.pdf}
  \item We have covered permissions in more detail than in previous
    years, and permissions are a vital topic in managing \POSIX
    systems.
  \item We also spent some time studying \emphcolour{symbolic links}
    \begin{itemize}
    \item Make sure you understand clearly the difference between a
      \emphcolour{relative} symbolic link and an \emphcolour{absolute}
      symbolic link
    \item Make sure you understand how to create them from any
      directory.
    \item Please study the handout about \link{symbolic
    links}{http://nicku.org/ossi/lab/sym-link/sym-link.pdf} 
    \end{itemize}
  \end{itemize}
\end{slide}

\tsectionandpart{Processes}% including Top

\begin{slide}{Processes and Threads}
  \begin{itemize}
  \item Processes have a \emphcolour{Process Control Block }(\PCB)
  \item A \PCB is one entry in the process table
    \begin{itemize}
    \item In Linux, it is called \texttt{task\_struct}.  Some people
      call it a  \emphcolour{task descriptor}
    \end{itemize}
  \item A \PCB holds a lot of information, including:
    \begin{itemize}
    \item The Process \ID, (\PID), \PID of parent (\acro{PPID})
    \item various User \ID{}s, (\UID{}s), group \ID{}s (\GID{}s)
    \item An environment (containing environment variables such as
      \texttt{PATH}
    \item A copy of the \CPU registers the last time the process
      was suspended, including a copy of the program counter.
    \item The process state (see the two diagrams of process state)
    \item Address mapping details
    \item Resources held by the process, such as a list of files the
      process has open
    \end{itemize}
  \end{itemize}
\end{slide}

\tsectionandpart[toc=Signals and IPC,bm=Signals and IPC]%
{Signals and IPC\\[3ex]
  How Processes can Talk to Each Other}

\begin{slide}{Signals and IPC}
  \begin{itemize}
  \item Processes cannot easily share information
  \item Need to use Inter Process Communication (\IPC) for two
    processes to share data.
  \item Examples:
    \begin{itemize}
    \item Pipes --- you used in shell programming
    \item Sockets --- over a network (e.g., for the Internet), and
      through a socket file --- the \texttt{ssh-agent} talks to
      \texttt{ssh}, \texttt{scp} and other \SSH clients through a
      \emph{socket}
    \item Signals --- See the assignment and the \texttt{trapall}
      shell script
    \end{itemize}
  \item Signal is sent by the \texttt{kill()} system call
    \begin{itemize}
    \item The \texttt{kill} shell command also makes the
    \texttt{kill()} system call
    \end{itemize}
  \item A process often terminates when it recieves a signal
  \item A process can \emph{trap} a signal by executing some code when
    it recieves the signal
  \item No process can ignore or trap the \texttt{KILL} signal or the
    \texttt{STOP} signal.
  \item Make sure you understand signals.
  \end{itemize}
\end{slide}

\tsectionandpart{Job Control}
\begin{slide}{Job Control}
  \begin{itemize}
  \item We \emphcolour{stop} a process with \key{Control-Z}
  \item This sends a \texttt{STOP} signal to the process.
  \item A stopped process is forced to stop executing, but is still
    using memory and holding resources and file locks, that it was
    holding when you sent it the \texttt{STOP} signal.
  \item Understand what \texttt{fg}, \texttt{bg}, \texttt{jobs} do.
  \item Read about this again in module~2.
  \end{itemize}
\end{slide}
\end{document}
