%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Offline version of <kernel-project> 			 	%%
%% ------------------------------------------------------------ %%
%% This file was created in contribution with:			%%
%%	http://kernel-project.kickino.org/			%%
%% ------------------------------------------------------------ %%
%% Author: Anton Brondz, Sebastian Wieseler			%%
%% Mail:   programming@kickino.org			 	%%
%% Web:    http://www.kickino.org/				%%
%%	   http://savannah.nongnu.org/projects/kernel-project	%%
%% IRC:    #uscc @ irc.forkbomb.ch:6668 (ssl-only)		%%
%% ------------------------------------------------------------ %%
%% Date:   2005-06-22					 	%%
%% Last Change: 2005-09-11				 	%%
%% (CVS-)Version: 1.2					 	%%
%% ------------------------------------------------------------ %%
%% Copyright (C): 2005 by Anton Brondz, Sebastian Wieseler	%%
%% Licence: GPL						 	%%
%% ------------------------------------------------------------ %%
%% NO WARRANTY!						 	%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
%

\documentclass[a4paper,14pt]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{color}

% Set standard fonts
\usepackage{courier}
\usepackage{helvet}
\usepackage{fancyhdr}
\pagestyle{fancy}

% Footer
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\renewcommand{\headrulewidth}{0.6pt}
\renewcommand{\footrulewidth}{0.6pt}

\lhead{\Large\bf kernel-project.kickino.org}
\chead{}
\rhead{\nouppercase{\rightmark}}
\rfoot{\thepage}
\cfoot{}
\lfoot{Copyright (C) 2005 by Anton Brondz, Sebastian Wieseler [GPL]}

\begin{document}

\begin{titlepage}
	\begin{center}
		{\Huge\bf Offline Version of }
\\		{\Huge\bf KERNEL-PROJECT}.kickino.org
\\		{\includegraphics{Crystalized_tux.eps}}
\\		(CVS-)Revision: 1.2
\\		Date: 2005-09-11
\\		Copyright (C) 2005 by Anton Brondz, Sebastian Wieseler [GPL]
	\end{center}
\end{titlepage}
\newpage

\tableofcontents
\newpage

%% Introduction %%
\section{\Large\bf Introduction}
This short HOWTO is meant for users new to the Linux kernel. It gives
\\ you a short, but good guide to everything from getting the Linux kernel to
\\ building and editing your bootloader's configuration and finally rebooting and
\\ enjoying your new kernel. We have provided good explanations to all the options
\\ and the process of compiling and building. Happy reading!
\\

%% Configuration %%
\section{\Large\bf Configuration}

\subsection{Get Linux}
You can download the current version of Linux from http://kernel.org/. There you
\\ can get almost any version of the Linux kernel.

E.g. for getting the 2.6.XX.YY - you can download
\\	http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.XX.YY.tar.bz2
\\ or
\\	http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.XX.YY.tar.gz
\\ at your choice. You should use 'wget' for doing this or any other download
\\ manager.

\subsection{Untar the tarball}
\fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
	\$ su
\\	\# cd /usr/src/
\\	\# gzip -cd linux-2.4.XX.tar.gz | tar xvf -
\\	\# ln -s linux-2.4.XX linux
\\	\# cd linux}}}
\\
\\ Where XX is the version number of your kernel.
\\ To configure and compile the kernel, you need to use the Makefile
\\ that is distributed with the kernel sources. The figure below shows the possible parameters for the Makefile.
\\ (/usr/src/linux/README)

\subsection{Rules of the makefile}
\begin{tabular}{|l|l|}
	\hline
	\textsc{make rule} & \textsc{Description}
\\	\hline \hline
\\	make psdocs		&
\\	make pdfdoc		&	
\\	make htmldocscreates 	&	documentation in the appropriate format 
\\				&	(PostScript/PDF/HTML)
\\	\hline			&
\\	make mrproper		&	forces delete of old object files and dependencies
\\	\hline			&
\\	make clean 		&	deletes old object files
\\	\hline			&
\\	make config		&	configure kernel (plain ASCII)
\\	\hline			&
\\	make menuconfig 	&	configure kernel (ASCII-menus)
\\	\hline			&
\\	make xconfig 		&	configure kernel (X Window-based)
\\	\hline			&
\\	make oldconfig 		&	takes an existing ./.config as config defaults
\\	\hline			&
\\	make dep 		&	setup all dependencies
\\	\hline			&
\\	make bzImage 		&	create a "bzip2" compressed kernel image
\\	\hline			&
\\	make bzdisk 		&	create a "bzip2" compressed kernel boot disk
\\	\hline			&
\\	make install 		&	installs new kernel 
\\				&	only if you use the LILO boot loader
\\	\hline			&
\\	make modules		&
\\	modules\_install 	&	create and install kernel modules
\\				&	see Documentation/modules.txt
\\	\hline \hline
\end{tabular} 
\\
\\ When configuring, you can choose between make config, make menuconfig, make xconfig, make gconfig and make 
\\ oldconfig.
\\ \begin{tabular}{l l}
\\	This picture shows make xconfig	&	 ... and this one make menuconfig.
\\	\scalebox{0.8}[0.8]{\includegraphics{xconfig.eps}}
	&	\scalebox{0.8}[0.8]{\includegraphics{menuconfig.eps}}
\\
\\ \end{tabular}
\\ So as you can see, you can configure Linux comfortably using graphical dialogs. More information on the 
\\ individual kernel configurations can be found under http://www.linuxfibel.de/kconf.htm (German)
\newpage	



%% Compilation %%
\section{\Large\bf Compilation}

After configuring your kernel, you need to compile it with:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\$ su
\\	\# cd /usr/src/linux}}}
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\ 	\# make dep
\\	\# make clean}}}
\\ 
\\ You're now able to choose from one of the following options:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# make bzImage
\\	\# make zImage
\\	\# make bzdisk
\\	\# make install}}} \\
\\
\\ Use {\it bzImage} to create a compressed kernel image
\\ {\it zImage} for a compressed kernel,
\\ {\it bzdisk} to create a boot disk and
\\ {\it install} if you want to use LILO (all further steps then become unneccesary).
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# make modules
\\	\# make modules\_install}}} \\
\\
\\ The time required by your computer to compile Linux is processor and machine dependant. 
\\ Once this process has been completed, you can copy your new kernel to {\it /boot/}.
\\
\\ Please {\bf don't} forget to make a backup of your old kernel though.  The backup commands are as follows:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# cp /boot/vmlinuz /boot/vmlinuz.old
\\	\# cp /boot/System.map /boot/System.map.old
\\
\\	\# cp arch/i386/boot/bzImage /boot/
\\	\# cp System.map /boot/
\\	\# cp .config /boot/}}} \\
\\
\\ After copying the kernel, you still need to test it. 
\\ Depending on your bootloader you still need to set various options in order to boot your new kernel.
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# shutdown -r now}}} \\
\\
\\ In the case where you want to overwrite your existing kernel, you need to use the following commands:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# cp /usr/src/kernel-old-version/.config /usr/src/kernel-new-version/
\\	\# cd /usr/src/kernel-new-version/
\\	\# make oldconfig
\\	\# make dep \&\& make clean bzImage modules modules\_install}}} \\
\newpage


%% Patching %%
\section{\Large\bf Patching}

This chapter shows possibilities to upgrade to follow-up kernel versions without having to download a new kernel 
\\ archive in it's entirety.
\\
\\ Upgrading is done utilizing the small program {\bf patch}, originally developed by Larry Wall.
\\
\\ You will just have to download a rather small file (called "patch")
\\ that contains the differences between the two kernel versions.
\\ You can get it, for instance, from kernel.org.
\\
\\ The following lines show how to backup your current kernel tree and how to apply the patch.
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\$ su
\\	\# cd /usr/src/linux
\\	\# make clean
\\	\# cd ..
\\	\# tar zcvf old-tree.tar.gz linux}}}
\\
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	 \# zcat patch.gz patch -p0}}}
\newpage


%% Bootloader %%
\section{\Large\bf Boodloader}
This section is about LILO and GRUB.

\subsection{LILO} (Linux Loader)
The lilo configuration file is {\it /etc/lilo.conf}.
\\ For your new kernel, it could look like this:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# /etc/lilo.conf - See: `lilo(8)' and `lilo.conf(5)',
\\	\# ---------------       `install-mbr(8)', `/usr/share/doc/lilo/'
\\	\#                       and `/usr/share/doc/mbr/'.
\\	\# +---------------------------------------------------------------+			
\\	\# |                        !! Reminder !!                         |
\\	\# |                                                               |
\\	\# | Don't forget to run `lilo' after you make changes to this     |
\\	\# | conffile, `/boot/bootmess.txt', or install a new kernel.  The |
\\	\# | computer will most likely fail to boot if a kernel-image      |
\\	\# | post-install script or you don't remember to run `lilo'.      |
\\	\# |                                                               |
\\	\# +---------------------------------------------------------------+
\\
\\
\\	\# [...]
\\
\\	\# Boot GNU/Linux per default
\\	\#
\\	default=GNU/Linux
\\
\\	image="/boot/bzImage"
\\	label="GNU/Linux"
\\	restricted
\\	\# append="hdc=ide-scsi"
\\	\# further kernel optionens
\\
\\	image="/boot/bzImage.old"
\\	label="GNU/LinuxOLD"
\\	restricted}}}
\\
\\  Further information on LILO can be found on  lilo.org
\\

\subsection{GRUB} (Grand Unified Bootloader)
At first, you should ensure there is an already complete installation of GRUB on your hard disk.
\\
\\ To write GRUB to a floppy you want to boot from, please do the following:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\$ su
\\
\\	\# cd /usr/share/grub/i386-pc
\\	{\it or at different distros:}
\\	\# cd /usr/lib/grub/i386-pc
\\
\\	\# dd if=stage1 of=/dev/fd0 bs=512 count=1
\\	1+0 records in
\\	1+0 records out
\\	\# dd if=stage2 of=/dev/fd0 bs=512 seek=1
\\	153+1 records in
\\	153+1 records out}}}
\\
\\ There is a GRUB option that lets you boot from a floppy while the kernel itself is read from hard disk.
\\ This is done like this:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# grub
\\	\tt{grub>} root (hd0,0)
\\	\tt{grub>} setup(fd0)
\\	\tt{grub>} quit}}}
\\
\\ To install GRUB permanently on your hard disk, use this command:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# grub-install /dev/hda
\\	Probing devices to guess BIOS drives. This may take a long time.
\\	Installation finished. No error reported.
\\	This is the contents of the device map /boot/grub/device.map.
\\	Check if this is correct or not. If any of the lines is incorrect,
\\	fix it and re-run the script `grub-install'.
\\
\\	(fd0) /dev/fd0
\\	(hd0) /dev/hda
\\	(hd1) /dev/hdb
\\	\[...\]}}}
\\
\\ Depending on your configuration, you'll have to select the correct hardware type ({\it /dev/hda}).
\\ A warning: Using {\it grub install} to install on several hard disks sometimes leads to problems!
\\ To write GRUB to a partition, you would enter:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\# grub
\\	\tt{grub>} root (hd0,0)
\\	\tt{grub>} find /boot/grub/stage1
\\	\tt{grub>} setup (hd0) (MBR-Installation)
\\	\tt{grub>} setup (hd0,0) (Installation in Bootsektor von '0')}}}
\\
\\ To start GNU/Linux directly, enter the folloing commands at the boot prompt:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\tt{grub>} kernel /bzImage root=/dev/hda1
\\	\tt{grub>} boot}}}
\\
\\ Or create a permanent GRUB configuration that lets you choose from a boot menu.
\\ This file is named menu.lst and should be in your /boot directory ({\it /boot/grub/menu.lst}).
\\ It could look like this:
\\ \fcolorbox{black}{yellow}{\parbox{\textwidth}{\textcolor{black}{
\\	\#
\\	\# Sample boot menu configuration file
\\	\#
\\
\\	\# Per default, boot the first entry
\\	default 0
\\
\\	\# Wait 30 seconds, then boot the default entry
\\	timeout 30
\\
\\	\# If the first entry doesn't work, use the second
\\	fallback 1
\\
\\	\# GNU/Hurd (first harddisc, second partition)
\\	title GNU/Hurd
\\	root (hd0,1)
\\	kernel /boot/gnumach.gz root=hd0s1
\\	module /boot/serverboot.gz
\\
\\	\# GNU/Linux (second harddisc, first partition)
\\	title GNU/Linux
\\	kernel (hd1,0)/bzImage root=/dev/hdb1
\\
\\	\# Windows NT or Windows95 (first harddisc)
\\	title Windows NT / Windows 95 boot menu
\\	root (hd0,0)
\\	makeactive
\\	chainloader +1
\\	\# Because of DOS, if Windows NT was installed
\\	\# chainload /bootsect.dos}}}
\newpage


%% Masthead %%
\section{\Large\bf Masthead}
\subsection{Copyright}
\fcolorbox{black}{blue}{\parbox{\textwidth}{\textcolor{white}{
\\	Offline version of kernel-project
\\	Copyright (c) 2005 Anton Brondz, Sebastian Wieseler
\\
\\	This program is free software; you can redistribute it and/or modify
\\	it under the terms of the GNU General Public License as published by
\\	the Free Software Foundation; either version 2 of the License, or
\\	(at your option) any later version.
\\
\\	This program is distributed in the hope that it will be useful,
\\	but WITHOUT ANY WARRANTY; without even the implied warranty of
\\	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
\\	GNU General Public License for more details.
\\
\\	You should have received a copy of the GNU General Public License
\\	along with this program; if not, write to the Free Software
\\	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
\\
\\	Crystalized Tux by gg3po/Tony (found on http://kde-look.org) available under GPL
\\	All other pictures (C) Sebastian Wieseler 2005 - GPLed }}}
\\
\subsection{Legal}
Linux is a registered trademark of Linus Torvalds.
\\  All other trademarks are property of their respective owners.
\\
\subsection{Powered by}
\fcolorbox{black}{blue}{\parbox{\textwidth}{\textcolor{white}{
\\ \LaTeX\
\\ kernel-project.kickino.org
\\ savannah.nongnu.org}}}

\end{document}

