\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{rpolyano} \pdfinfo{ /Title (operating-system-basics.pdf) /Creator (Cheatography) /Author (rpolyano) /Subject (Operating System Basics Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Operating System Basics Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{rpolyano} via \textcolor{DarkBackground}{\uline{cheatography.com/24960/cs/6373/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}rpolyano \\ \uline{cheatography.com/rpolyano} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 13th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Address Translation}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{VA -\textgreater{} Page Table (entry) -\textgreater{} Physical memory or swap} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Temporal Locality - recently referenced pages that might be again} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Spatial Locality - referenced addresses will probably be near other recently referenced} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Mappings cached in TLB (Translation Lookaside Buffer)} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Page Tables}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Entry looks like `| M\textasciicircum{}1\textasciicircum{} | R\textasciicircum{}1\textasciicircum{} | V\textasciicircum{}1\textasciicircum{} | Prot\textasciicircum{}3\textasciicircum{} | PFN\textasciicircum{}26\textasciicircum{} |`} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{M}}odify Bit - whether or not a page has been written (set on write)} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{R}}eference Bit - page has been accessed (set on read/write)} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{V}}alid bit - PTE can be used} \tn % Row Count 7 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Prot}}ection bits - R/W/X permissions} \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{PFN}} - Page Frame Number - physical page} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Other Page Tables}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Hashed - Hash function maps virtual page to bucket of LList of (VPN, PTE)} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Inverted - Table of PFNs - \textgreater{} PID, PTE} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Fetch Policies}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Demand Paging}} - Swap in the pages you need when you need them} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Prepaging}} - Predict next page that will get loaded and load it now} \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Replacement Policies}} \tn % Row 0 \SetRowColor{LightBackground} OPT & Swap out page that will not be used for the longest time \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} FIFO & Swap out oldest page \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} & Suffers Belady's Anomaly - Fault rate {\bf{may}} increase with memory size \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} LRU & Swap out page that has not been accessed for longest time \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} CLOCK & Approximation of LRU - Go through candidates in a circle. If Ref bit set, clear it, move on. If not set, then swap out. \tn % Row Count 12 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\bf{Page Buffering}} - Maintain a pool of free (uncleared/rescuable) frames. Run replacement when pools gets too empty, run it until pull is full enough. On fault grab frame from pool.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Address Space}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/rpolyano_1449866286_asd.PNG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Deadlock}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Definition}} & Set of processes that compete for resources or communicate with each other permanently blocked \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} {\bf{Conditions}} & Mutual Exclusion* - only one process uses resource at once \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} & Hold and wait* - A process may hold resource while waiting for other resource \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} & No preemption* - No resource can be forcefully removed from a process \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} & Circular wait** - A closed chain of processes, where one needs 1+ resources held by the next. \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{\emph{Necessary for deadlock. \newline }}* Necessary and sufficient.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Memory partitioning (Fixed vs Dynamic)}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{- {\bf{{\emph{Fixed partitioning:}}}} Every process gets a fixed amount of memory in one of the following ways:} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{- {\bf{Equal size.}} Every process gets the same amount of memory. Internal fragmentation when process too small. Overlay when process too big. No external fragmentation.} \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{- {\bf{Unequal size.}} Every process gets a chunk that has minimum memory required available. Internal fragmentation. Holes} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{- {\bf{{\emph{Dynamic partitioning:}}}} Size and number of partitions varies} \tn % Row Count 12 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{- {\bf{Every process}} gets as much as needed on start. Need to know size beforehand. Holes. Need relocatable processes.} \tn % Row Count 15 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{- {\bf{{\emph{PAGING}}}}: Split both virtual and physical memory in same chunks called {\bf{Pages}}} \tn % Row Count 17 (+ 2) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{- Every process gets its own {\bf{Page Table}} which maps its virtual addresses into physical pages (offset is the same, only need to translate frames)} \tn % Row Count 20 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CPU Scheduling}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{FCFS}} & NP, First Come First Serve \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{SJF}} & NP or P, Choose thread with shortest (remaining) processing time. Optimal avg wait time \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} {\bf{RR}} & P, Circular Q, good for time sharing systems \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} {\bf{Priority Scheduling}} & NP or P, Highest priority job selected from ready Q \tn % Row Count 11 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{NP - Nor Preemptive Preemptive \newline Priority Inversion - Low priority blocks resource, high priority doesn't run.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Log FS Mapping and GC}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{Mappings}} to inodes are stored in imaps, placed in chunks after new information. Fixed location on disk called Checkpoint Region contains pointers to latest pieces of imap. Keep 2 CRs at opposite ends of the disk for redundancy. \newline % Row Count 5 (+ 5) {\bf{Garbage Collection}} periodically goes through segment by segment and frees up files, since new versions of files are written to new places on disk. (LOG FS is circular)% Row Count 9 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.84609 cm} x{4.13091 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Disk Performance}} \tn % Row 0 \SetRowColor{LightBackground} Seek & Moving disk arm to cylinder (1 - 15ms, \textasciitilde{}5ms avg, improving slowly) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Rotation} & Wait for sector to rotate to head (4ms avg, not improving) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{Transfer} & Moving data from platter to controller (\textasciitilde{}100MB/s, sector \textasciitilde{}5microseconds, Improving quickly) \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{FS - Caching Writes}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Writes can be buffered. This allows} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Multiple writes in one (e.x. flip many bits of a bitmap)} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Scheduling to allow for better disk access} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Avoid writes entirely (e.x. set bit to 1, set bit to 0)} \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{File Buffer Cache}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Locality when reading/writing files} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Cache blocks/inodes/dir entries that are "hot"} \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Can use static or dynamic partitioning. \newline {\bf{Static}} - allocate n\% at boot. Wasteful. \newline {\bf{Dynamic}} - VM and FS pages into unified cache. Pages of memory can be dynamically allocated between RAM and FS cache} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Fast File System}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Used cylinder (block) groups.} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Data blocks in same file allocated in same group} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Entries in same directory allocated in same group} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Inodes for files are allocated in same group as file data} \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Large files get broken up into chunks and allocated in different cylinder groups} \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Groups reduce number of long seeks. \newline Must have free space in cylinder groups (10\% of disk reserved free)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Disk Scheduling Policies}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{FCFS}} - First Come First Serve (i.e. no scheduling) - Good under small load} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{SSTF}} (Shortest Seek Time First) - Minimize arm movement, maximize request rate, favor middle blocks} \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{SCAN}} (elevator) - Order requests by direction (do all in direction one, then all in reverse)} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{C-SCAN}} (Typewriter) - Like SCAN, but only in one direction.} \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{LOOK/C-LOOK}} - Same as SCAN/C-SCAN but only move as far as last request in each direction.} \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Journaling}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Log TxBegin , log inode bitmap, log block bitmap, log block data. Once done, log txend (transaction committed)} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Write data (checkpoint step). Make sure TxEnd scheduled last.} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Avoid writing data to journal by writing data first, then journal, then actual metadata} \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Log FS}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Like FFS but everything gets logged in order.} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Superblock | summary | inode | data | data | inode | data | superblock | summary etc} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Summary has pointer to next summary or next super block.} \tn % Row Count 5 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{RAID (Redundant Array of Independent Disks}} \tn % Row 0 \SetRowColor{LightBackground} RAID1 (Data duplication) & mirror images, redundant full copy. Wastes space \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Parity Information & XOR each bit from2 drives, store checksum on 3rd \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} RAID 0 & Write half of data on one drive and one on the other \tn % Row Count 7 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.44333 cm} x{3.53367 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Filesystem consistency}} \tn % Row 0 \SetRowColor{LightBackground} Superblock & Sanity checks. Use another copy if corrupted \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Free blocks & Ensure inodes in use are marked in bitmap. Trust inodes. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Inode state & Must have valid mode. Remove if can't fix \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Inode links & Verify links. Traverse tree and count links. Move unlinked inodes to lost+found \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} Duplicates & Two inodes refer to same block \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} Bad blocks & bad pointers. Remove from inode \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} Directory checks & Make sure . and .. are first. Each inode in dir is allocated. No dir linked more than once. \tn % Row Count 17 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.54287 cm} x{3.43413 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{CPU Scheduling Goals}} \tn % Row 0 \SetRowColor{LightBackground} All Systems & Fairness, Avoid starvation, Policy enforcement, Best use of resources \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Batch System & Throughput (jobs/hour), Turnaround (min time between submit and complete), CPU Util (keep CPU busy) \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} Interactive System & Response time (min time from submit to start), Proportionality (simple tasks finish faster) \tn % Row Count 11 (+ 4) % Row 3 \SetRowColor{white} Real Time System & Meet deadlines, predictability \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Threads}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Kernel}} - Less state to alloc and init than process =\textgreater{} cheaper concurrency} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{User}} - Managed by runtime systems. Small, fast, has PC, registers, stack, small TCB. Creating, switching, sync done by procedures (no kernel). (Disadv.) - Not well integrated with OS, Scheduling.} \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{Hybrid}} - Can have many kernel threads associated with many user threads, or many user threads associated with a few kernel threads.} \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}