Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Tracker

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> The Operating System

· Rebuilding Your Kernel
· Installing Your Kernel
· Linux Kernel Source Code
· Modules

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 60 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

Linux Tutorial - The Operating System - Rebuilding Your Kernel - Installing Your Kernel
  Rebuilding Your Kernel ---- Linux Kernel Source Code  

Installing Your Kernel

Once you have rebuilt your kernel, you must install it to be able to boot it. Because it is the simplest to use and available on all current distributions, I am only going to talk about the Linux Loaded (LILO) as a method to install your kernel.

LILO is actually a general-purpose boot manager that can boot almost every OS that you installed on your system. LILO normally is run from the hard disk, but you can configure it to run from a floppy as well. LILO can act as a primary boot loader (that is, it is started from the master boot block) or a secondary loader (started by the primary loader).

There are some problems when you run OS/2 or NT because they have their own boot managers. Therefore you will probably have to use their manager as the primary boot loader and have LILO on the Linux partition to boot Linux.

LILOs configuration is in /etc/lilo.conf, which is a text file that can be edited with any text editor (vi, emacs, etc.). On many systems, there is a configuration program liloconfig, which will prompt you for some basic configuration parameters that are then written to /etc/lilo.conf.

To get a better idea of what this is all about, lets look at the lilo.conf file from one of my systems with a Linux and DOS file system. (Most of this was the default.)

# Modified by YaST2. Last modification on Fri Nov 9 16:27:26 2001 disk=/dev/hda bios=0x80 disk=/dev/hdb bios=0x81 disk=/dev/hdc bios=0x82 disk=/dev/sda bios=0x83 boot = /dev/hda vga = 791 read-only menu-scheme = Wg:kw:Wg:Wg lba32 prompt timeout = 80 message = /boot/message image = /vmlinuz label = linux_vm root = /dev/hda4 initrd = /boot/initrd append = "enableapic vga=0x0317" image = /boot/vmlinuz label = linux2 root = /dev/hda4 initrd = /boot/initrd append = "enableapic vga=0x0317" image = /vmlinuz label = linux3 root = /dev/hdb7 initrd = /boot/initrd append = "enableapic vga=0x0317" image = /boot/vmlinuz.suse label = failsafe root = /dev/hda4 initrd = /boot/initrd.suse append = "disableapic ide=nodma apm=off" optional image = /boot/memtest.bin label = memtest86 other = /dev/hda1 label = windows

The first part of the file are the basic configuration parameters. The boot line defines the device that LILO should install itself onto, in this case, device /dev/hda, which is the master boot block. If you wanted to install lilo on a different partition, maybe to use a commercial boot manager, you might specific /dev/hda2, which is the second partition of the first drive. Note that this is what it is on an IDE drive; on an SCSI drive, the device would be /dev/sda2.

The delay line specifies the number of tenths of seconds LILO should wait before booting the first image. Here we have 80, so this means 8 seconds. The VGA line specifies the text mode the system should use when booting. Normal means to select 80x25 text mode. The ramdisk line specifies the size of the RAM disk to create; in this case, it won't be created because the size is 0.

Next is the section that defines a particular OS to boot. The image line specifies the image to load. In the first case, this is the file vmlinuz in the root file system. Next we define the root file system; here it is the device /dev/hda4, which is the fourth partition on the first disk.

The label is the name you use to specify which OS you want to boot. In the first example, it is called linux_vm (which tells me that this kernel is configured to run VMWare. Also, when the LILO prompt comes, press TAB to display this label, in this case, Linux. The next line says the root file system should be mounted read-only. This seems to contradict logic and experience because the root file system ought to be writable. Actually, this is only used for checking when the system first boots; later, other routines will remount the file system as read-write.

In the last section is the description for the DOS/Windows partition, which is on the first partition on the first drive, /dev/hda1.

When the lilo.conf file is set up as you want, you need to run /sbin/lilo to install it. If you are using Windows NT, which likes to take control and prescribe everything, you will need to configure LILO as a "secondary" boot loader. You can also do this if you don't want LILO to be your boot manager.

If LILO is installed as your master boot record, you can "remove" it by overwriting the MBR. From DOS, you can remove it with

fdisk /mbr

The original boot block is stored in the /boot directory as either boot.3?? for IDE drives or boot.8?? for SCSI devices, where ?? is the device where the master boot block was. You can then use the dd command to copy it back to the hard disk. The syntax of dd follows:

For example:

Although the size of the file in /boot is 512 bytes, only the first 446 contain information. You need to be very careful here. If you make a mistake, for example, count=10, you can overwrite important information on the first partition.

 Previous Page
Rebuilding Your Kernel
  Back to Top
Table of Contents
Next Page 
Linux Kernel Source Code


Test Your Knowledge

User Comments:

You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.

There are several different ways to navigate the tutorial.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.14 Seconds