% CVSId: $Id: kernel_src_intro.tex,v 1.2 2003/07/12 22:48:45 mulix Exp $

\documentclass[final, total, pdf, colorBG, slideColor]{prosper}

\title{Introduction to the Linux Kernel Source and Layout}
\subtitle{arch/, mm/, fs/, oh my!}
\author{Muli Ben-Yehuda}
\email{mulix@mulix.org}
\institution{IBM Haifa Research Labs}

\slideCaption{Linux Kernel Development, TAU Linux Workshop, July 2003}

\begin{document}

\maketitle

\begin{slide}{introduction} % 1

\begin{itemize} 

\item The Linux kernel is written in C, and licensed under the GPL
\item A handful of assembly thrown in 
\item Two development trees, stable and experimental 
\item This talk is about the stable branch, currently at 2.4.22-pre5. 
\item Several millions lines of code
\item We will survey the kernel source, what functionality can be
      found where? 

\end{itemize} 

\end{slide}

\begin{slide}{build system and general info} % 2 

\begin{itemize} 

\item Top level Makefile and Rules.Make 
\item Documentation/Configure.help for the configuration documentation
\item README - Read it! 
\item REPORTING-BUGS - because all code sucks

\end{itemize} 

\end{slide}

\begin{slide}{kernel documentation} % 3 

\begin{itemize} 

\item Arguably, the most important directory... contains, as your
      probably guessed, the documentation. 
\item Unfortunately, sometimes out of date. Google is your friend for
      updated documentation. 
\item Important files:
  \begin{itemize} 
  \item 00-INDEX
  \item BUG-HUNTING
  \item CodingStyle
  \item SubmittingBugs / SubmittingPatches
  \item modules.txt
  \item spinlocks.txt 
  \end{itemize} 

\end{itemize} 

\end{slide} 

\begin{slide}{architecture dependant} % 4 

\begin{itemize} 

\item The arch/ directory contains many subdirectories, one for each
architecture Linux supports. 18 for 2.4.22-pre5, not including
sub-architectures. 
\item 90\% of the people only care about i386, which can be found at
arch/i386/
\item boot - assembly files, related to booting Linux 
\item lib - optimized routines for common tasks (e.g. memcpy)
\item mm - i386 specific memory management 
\item kernel - the bulk of the i386 code, including IRQ handling,
processes, signals and pci support, to name a few areas. 

\end{itemize} 

\end{slide}

\begin{slide}{drivers} % 5 

\begin{itemize} 

\item The bulk of the kernel's code 
\item net/, sound/, usb/, atm/, ide/, scsi/, etc, etc
\item character device drivers live in char/, including /dev/null and
/dev/zero 
\item block device drivers live in block/ 
\item drivers are actually one of the more important parts of the
kernel from a user point of view, but some suffer from serious lack of
maintenance

\end{itemize} 

\end{slide}

\begin{slide}{fs} % 6 

\begin{itemize} 

\item fs has filesystem code
\item includes the Linux vfs ``virtual file system'' layer, which is
often held as an example of good kernel code
\item also includes the binary formats for executable file support, in
binfmt\_*
\item the majority of Linux users use ext2 and ext3
\item local file systems, distributed file systems (nfs, intermezzo),
old and grungy file systems (msdos, anyone?)

\end{itemize} 

\end{slide}

\begin{slide}{include} % 7 

\begin{itemize} 

\item header files live here
\item asm-* include architecture specific header files (complement
arch/)
\item the 'asm' symbolic link is created as part of the build process
depending on which architecture we are compiling for 
\item grep here first when looking for an API or a constant
\item most important (relevant) header files live in include/linux

\end{itemize} 

\end{slide}

\begin{slide}{mm} % 8 

In my humble opinion, the most interesting kernel code...  

\begin{itemize} 

\item virtual memory management, including swap in and swap out,
shared memory support, slab caches. 
\item definitely not trivial to understand
\item one of the few places where micro optimizations can be
considered
\item only 15,000 lines of code! 

\end{itemize} 

\end{slide}

\begin{slide}{kernel} % 9 

\begin{itemize} 

\item various files which don't belong elsewhere 
\item scheduler! 
\item various process related system calls: ptrace, exit
\item kernel infrastructure such as softirqs, printk
\item capability (security) support
\item fork - the point where all processes are created

\end{itemize} 

\end{slide}

\begin{slide}{the rest} % 10 

\begin{itemize} 

\item lib - generic library support routines
\item net - networking support, ipv4 and v6, tcp, other esoteric
protocols
\item ipc - SYSV interprocess communications mechanisms
\item init - kernel initialization and startup
\item crypto (new addition) - cryptographic support 
\item scripts - various scripts, some used for the build system 

\end{itemize} 

\end{slide}

\end{document} 
