Nos Term Paper

download Nos Term Paper

of 15

Transcript of Nos Term Paper

  • 8/8/2019 Nos Term Paper

    1/15

    Term

    paperOf

    Network

    Operating

    System

  • 8/8/2019 Nos Term Paper

    2/15

    Topic- Boot

    loadersSUBMITTED TO: SUBMITTED BY:

    Miss. Cherry khosla Prashant negi

    Lect in INT-406 B.Tech-IT

    L.P.U Roll no-30

    Phagwara . RD2701A30

    Reg.No-1070070124

    ACKNOWLEDGEMENT

    I am extremely grateful and remain indebted to my guide Miss Cherry khosla for

    being a source of inspiration and for her constant support in the Design,

    Implementation and Evaluation of the project. I am thankful to her for her constant

    valuable suggestions, which benefited me a lot while developing the report on

    Boot Loaders. She has been a constant source of inspiration and motivation for

    hard work. She has been very co-operative throughout this project work. Through

    this column, it would be my utmost pleasure to express my warm thanks to her for

    her encouragement, co-operation and consent without which I mightnt be able to

    accomplish this project.

  • 8/8/2019 Nos Term Paper

    3/15

    PRASHANT NEGI

    Contents

    Abstract

    Introduction

    What is a Boot Loader

    Boot Loader Concepts

    Parts of a Boot Loader

    Boot sector Prrogramme

    Second Storage of Boot Loader

    Boot Loader installer

  • 8/8/2019 Nos Term Paper

    4/15

    How to develop a boot loader

    Boot Loader Design

    Some Examples of Boot loaders

    LILO

    Ouputs

    Errors

    GNU GRUB

    o Features

    o Boot Process

    References

    Abstract

    A computer's central processor can only execute program code found in Read-Only

    Memory (ROM) and Random Access Memory (RAM). Modern operating systems and

    application program code and data are stored on nonvolatile data storage devices, such

    as hard disk drives, CD, DVD, USB flash drive, and floppy disk. When a computer is

    first powered on, it does not have an operating system in ROM or RAM. The computer

    must initially execute a small program stored in ROM along with the bare minimum ofdata needed to access the nonvolatile devices from which the operating system programs

    and data are loaded into RAM.

    The small program that starts this sequence of loading into RAM, is known as a bootstrap

    loader, bootstrap or boot loader. This small boot loader program's only job is to load

  • 8/8/2019 Nos Term Paper

    5/15

    other data and programs which are then executed from RAM. Often, multiple-stage boot

    loaders are used, during which several programs of increasing complexity sequentially

    load one after the other in a process of chain loading.

    Introduction

    Boot loaders are the software that start-up operating systems when the power of the

    computer is switched on. Normally, boot loaders do their job without being aware of

    them. However, when we install two or more operating systems on computer we need to

    configure the boot loader so we can choose which operating system to load. This is often

    called dual- booting when we have two operating systems installed. Even if we're only

    running one operating system, a boot loader gives an opportunity to pass information tothe operating system when it boots up.

    Boot loaders run before any operating system is loaded, so they're independent of

    operating systems. Any boot loader should be able to boot any operating systems.

    Regardless of whether we're running Windows, Linux, UNIX, etc. we should be able to

    use the boot loader of our choice.

    What is boot loader?

    A boot loader, also called a boot manager, is a small program that places the operating

    system (OS) of a computer into memory. When a computer is powered-up or restarted,

    the basic input/output system (BIOS) performs some initial tests, and then transfers

    control to the Master Boot Record (MBR) where the boot loader resides. Most new

    computers are shipped with boot loaders for some version of Microsoft Windows or theMac OS. If a computer is to be used with Linux, a special boot loader must be installed.

    Boot loader Concepts

  • 8/8/2019 Nos Term Paper

    6/15

    The simplest boot loader concept involves only one machine with one operating system..

    The same boot concept can be used for a Linux-only machine. In this case we would not

    be able to pass additional parameters to the kernel at boot time. For a machine with

    multiple operating systems, the following boot concepts are possible:

    One operating system is booted from the hard disk. Other operating systems can be

    booted from the floppy disk drive.

    Requirements: bootable floppy disk drive .

    Example: installation of Linux alongside Windows; booting of Linux from a boot

    disk

    Advantage: no boot loader needs to be installed

    Disadvantage: requires working boot disks and the boot process takes longer

    Depending on the purpose of the computer, it is an advantage or disadvantage that

    Linux cannot be booted without a disk.

    Parts of a boot loader

    A boot loader typically consists of three programs:

    1. The boot sector program is directly loaded by the BIOS at boot time and isonly 512 bytes in size.

    2. The second stage program is loaded by the boot sector program and it

    does everything you expect the boot loader to do.

    3. The boot loader installer is not run when the system is booted, but it is

    used to install the boot loader and the second stage program onto the boot disk.

    These have to be stored in special locations, so they cannot be copied with cp.

    Boot sector program

    The boot sector program can only be 512 bytes in size and not all 512 bytes are even

    available in all cases. If the boot sector program must exist on a DOS partition or on a

    DOS diskette, there must be a parameter block at the start of the boot sector.

  • 8/8/2019 Nos Term Paper

    7/15

    Usually a boot sector program does one of the following things (not all three in one

    program):

    Load another boot sector. This is typical for a boot sector program that lives in the

    master boot record of a hard disk. It can find the first sector of the selected active

    partition and chain load that. The MBR program that came traditionally with MS-

    DOS has no ability to change the active partition at boot time. There are other boot

    sector programs that let you select a partition by pressing a key, such as the MBR

    program of LILO.

    Load a second stage boot loader. It is generally not possible for a boot sector

    program to look into the directory for a file with a specific name and load that into

    memory, but exceptions exist, at least for DOS file systems. Most boot sectorprograms find the second stage by sector number rather than by name. The sector

    numbers have to be put into the boot sector by the boot loader installer.

    Load the kernel directly. A kernel is typically much larger than a second stage

    boot loader.

    The boot sector program in the Linux kernel loads the kernel directly into

    memory without the need for a second stage boot loader. As the kernel is located

    in contiguous sectors on a diskette, there is no need to traverse file system data

    structures.

    Second stage of boot loader

    This is the real boot program. It contains the user interface and the kernel loader. It

    can be anywhere from 6.5 kilobytes (LILO) to over 100 kilobytes (GRUB) in size. It

    contains the following functions:

    User interface. It is either a simple command line (old versions of LILO), a menu

    or both. It allows you to select any number of operating systems and to specify

    additional parameters to the operating system. The available options are specified by

  • 8/8/2019 Nos Term Paper

    8/15

    a configuration file. Modern versions of boot loaders can show their menu in a

    bitmap picture.

    Operating system loader. loads the operating system into memory and runs it.

    Alternatively we can load another boot loader specific to another operating system

    and let it run. This is called chain loading.

    Boot loader installer

    The third part of the boot loader is only run when the boot loader is installed on a

    disk. As opposed to the boot sector program and second stage, this is a normal

    Linux program. In the case of LILO the installer must be rerun each time the

    configuration is changed or any file has been updated. It performs the following

    tasks:

    Install the boot sector. If the boot sector will be installed in the MBR of a hard

    disk or on a DOS file system, not all 512 bytes may be overwritten, but the

    partition table or theDOS parameter blockmust be preserved.

    Tell the boot sector where the second stage boot loader is. Usually it writes one or

    more sector addresses into the boot loader.

    Tell the second stage boot loader where all relevant information is (configuration,

    kernels). This is the case with LILO. LILO creates a map file that contains all

    relevant sector addresses and puts pointers to the map file in the boot sector

    and/or second stage boot loader.

    How to Develop a Boot Loader

    A boot loader manages the boot process of the target device by initializing the target

    device, downloading the run-time image, and booting the run-time image on the target

    device.

  • 8/8/2019 Nos Term Paper

    9/15

    After you develop a boot loader, we can use the boot management

    capabilities of your boot loader to save time during the OS development process.

    Without a boot loader, you must transfer a run-time image to the target

    device through a slow, manual process.

    With a boot loader, you can quickly download a new development run-

    time image to our target device.

    Boot Loader Design

    Early CPU initialization.

    Enter supervisor mode.

    Clear the instruction and data caches.

    Clear the translation look-aside buffers (TLBs).

    Drain the write and fill buffers.

    Configure and enable the RAM controller.

    Ensure that interrupts are cleared and masked.

    Initialize any required phase-locked loops (PLLs) or time bases such as RTC and

    tick counter. Optionally relocate the run-time image to RAM. The boot loader

    may initially run in flash memory after reset.

    Optionally enable the MMU and caches.

    Obtain various user settings from Platform Builder, such as boot clean and

    whether to establish a passive KITL connection, as well as IP and port address

    information for various Platform Builder service connections.

    Execute the downloaded .bin file by ensuring the system state is configured

    appropriately and then jumping to the run-time image's start-up address.

    Some examples of Boot Loaders

    LILO

    LILO does not depend on a specific file system, and can boot an operating system

    (e.g., Linux kernel images) from floppy disks and hard disks. One of up to sixteen

    different images can be selected at boot time. Various parameters, such as the root

    device, can be set independently for each kernel. LILO can be placed either in the

  • 8/8/2019 Nos Term Paper

    10/15

    master boot record (MBR) or the boot sector of a partition. In the latter case

    something else must be placed in the MBR to load LILO.

    At system start, only the BIOS drivers are available for LILO to access

    hard disks. For this reason, with very old BIOS, the accessible area is limited to

    cylinders 0 to 1023 of the first two hard disks. For later BIOS, LILO can use 32-

    bit "logical block addressing" (LBA) to access practically the entire storage of all

    the hard disks that the BIOS allows access to.

    LILO was the default boot loader for most Linux distributions in the years

    after the popularity of loadlin.

    Output:

    When LILO loads itself it displays the word LILO. Each letter is printed before or after

    some specific action. If LILO fails at some point, the letters printed so far can be used to

    identify the problem.

    (nothing)

  • 8/8/2019 Nos Term Paper

    11/15

    No part of LILO has been loaded. LILO either isn't installed or the partition on

    which its boot sector is located isn't active. You have probably not booted from

    the correct device or the media you've booted from is faulty.

    L

    The first stage boot loader has been loaded and started, but it can't load the second

    stage boot loader. The two-digit error codes indicate the type of problem. This

    condition usually indicates a media failure or bad disk parameters in the BIOS.

    LI

    The first stage boot loader was able to load the second stage boot loader, but has

    failed to execute it. This can be caused by bad disk parameters in the BIOS.

    LIL

    The second stage boot loader has been started, but it can't load the descriptor table

    from the map file. This is typically caused by a media failure or by bad diskparameters in the BIOS.

    LIL?

    The second stage boot loader has been loaded at an incorrect address. This is

    typically caused by bad disk parameters in the BIOS.

    LIL-

    The descriptor table is corrupt. This can be caused by bad disk parameters in the

    BIOS.

    LILO

    All parts of LILO have been successfully loaded.

  • 8/8/2019 Nos Term Paper

    12/15

    GNU GRUB

    GNU GRUB (short for GNU Grand Unified Boot loader) is a boot loader package

    from the GNU Project. GRUB (shortened form of GNU GRUB) is the reference

    implementation of the Multi boot Specification, which enables a user to have

    multiple operating systems on their computer, and choose which one to run when

    the computer starts. GRUB can be used to select from different kernel

    images available on a particular operating system's partitions, as well as pass

    boot-time parameters to such kernels. GRUB can download operating system

    images from a network, and thus can support diskless systems. GRUB supports

    automatic decompression of OS images prior to booting from them.

    GNU GRUB was developed from a package called the Grand Unified

    Bootloader (a play on grand unified theory). It is predominantly used on Unix-

    like systems. The GNU operating system uses GNU GRUB as its boot loader, as

    do most Linux distributions. Solaris has used GRUB as its boot loader on x86

    systems starting with the Solaris 10 1/06 release.

    Features:

    GRUB is dynamically configurable. It loads its configuration at startup, allowing

    boot-time changes such as selecting different kernels or initial RAM disks. To this

    end, GRUB provides a simple, bash-like, command line interface which lets users

    write new boot sequences.

    It supports multiple executable formats, and is geometry translation independent.

    Although Multiboot compliant, GRUB supports non-multiboot operating systems

    such as Microsoft Windows and OS/2 via chain loading. GRUB supports allcommonly used Unix file systems, VFAT and NTFS used by Windows, as well

    as Logical Block Address (LBA) mode. GRUB allows users to view the contents of

    files on any supported file system.

  • 8/8/2019 Nos Term Paper

    13/15

    GRUB differs from other boot loaders by being able to communicate with a user

    directly via a GRUB prompt. A GRUB prompt is the stage before GRUB loads an

    operating system and can be triggered at a text-mode GRUB booting screen by

    pressing the "c" key. A prompt (similar to bash) can also be obtained by booting

    GRUB without an operating system attached, or in a GRUB installation with an

    operating system where the file "menu.lst" is absent. From the GRUB prompt a user

    can manually select and control booting from any installed operating system by using

    bash-like commands. To boot an operating system automatically, the appropriate

    commands are placed in a configuration file named "menu.lst" in a designated

    subdirectory.

    Boot Process of GRUB

    When a computer is turned on, the computer's BIOS finds the primary bootable

    device (usually the computer's hard disk) and loads the initial bootstrap program

    from the master boot record(MBR), the first 512 bytes of the hard disk, then

    transfers control to this code.

    The MBR contains GRUB stage 1. Given the small size of the MBR, Stage 1 does

    little more than load the next stage of GRUB (which may reside physically

    elsewhere on the disk). Stage 1 can load Stage 2 directly, or it can load stage 1.5.

    GRUB Stage 1.5 is located in the first 30 kilobytes of hard disk immediately

    following the MBR. Stage 1.5 loads Stage 2.

    When GRUB Stage 2 receives control, it presents an interface where the user can

    select which operating system to boot. This normally takes the form of a graphical

    menu. If this is not available, or the user wishes direct control, GRUB has its own

    command prompt. The user can then manually specify the boot parameters.

    GRUB can be set to automatically load a specified kernel after a user defined

    timeout.

    Once boot options have been selected, GRUB loads the selected kernel into

    memory and passes control to the kernel. Alternatively, GRUB can pass control

  • 8/8/2019 Nos Term Paper

    14/15

    of the boot process to another loader, using chain loading. This is the method used

    to load operating systems such as Windows, that do not support the Multiboot

    standard. In this case, copies of the other system's boot programs have been saved

    by GRUB. Instead of a kernel, the other system is loaded as though it had been

    started from the MBR. This could be another boot manager, such as the Microsoft

    boot menu, allowing further selection of non-Multiboot operating systems. (This

    behavior is often automatic when modern Linux distributions are installed "on top

    of" an existing Windows installation. This enables retention of the original

    operating system without modification, including systems that contain multiple

    versions of Windows.)

    References

    Search engine

    www.google.com

    www.Lycos.com

    http://en.wikipedia.org/wiki/GNU_GRUB

    http://en.wikipedia.org/wiki/Booting#Boot_loader

    http://en.wikipedia.org/wiki/Booting#Boot_sequence_on_standard_PC_.28IBM-

    PC_compatible.29

    http://www.xs4all.nl/~lennartb/bootloaders/node3.html

    http://en.wikipedia.org/wiki/LILO_(boot_loader)

    http://www.google.com/http://www.lycos.com/http://www.google.com/http://www.lycos.com/
  • 8/8/2019 Nos Term Paper

    15/15