Booting of Os

Embed Size (px)

Citation preview

  • 8/8/2019 Booting of Os

    1/23

  • 8/8/2019 Booting of Os

    2/23

  • 8/8/2019 Booting of Os

    3/23

  • 8/8/2019 Booting of Os

    4/23

  • 8/8/2019 Booting of Os

    5/23

    HISTORY:

    The computer word boot is short for 'bootstrap' (short for

    'bootstrap load'). The term bootstrap began as a metaphor derived frompull straps sewn onto the backs of leather boots with which a personcould pull on their boots without outside help. In computers in the 1950s,pressing a bootstrap button caused a hardwired program to read abootstrap program from a punched card and then execute the loaded bootprogram which loaded a larger system of programs from punched cardsinto memory, without further help from the human operator. In acomputing context, that word has been used since at least 1958.

    The GE 645 (c. 1965) had a 'BOOT' button it could be that thecontraction started as a way to label the button with fewer letters than thefull word.

    The Multics operating system (c. 1967) had a boot command. Multicsdocuments also refer to 'boot tapes', but it is hard to determine exactlywhen that term was first used.

    In the Unix operating system, the earliest reference for 'boot' is probablyin The Unix Programmer's Manual , first edition 1971.11.03.

    The bootstrap concept was used in the IBM 701 computer (1952-1956)which had a "load button" which initiated reading of the first 36-bit wordfrom a punched card in a card reader, or from a magnetic tape unit, ordrum unit (predecessor of the hard disk drive). The left 18-bit half-wordwas then executed as an instruction which read additional words intomemory.

    4

  • 8/8/2019 Booting of Os

    6/23

    BOOTSTRAPPING:

    Bootstrapping refers to a process where a simple systemactivates another more complicated system that serves the same purpose.

    The term is most often applied to the process of starting up a computer, inwhich a mechanism is needed to execute the software program that isresponsible for executing software programs.

    Booting: - Bootstrapping was shortened to booting, or the process of starting up any computer.

    Software Bootstrapping: - Bootstrapping can also refer to thedevelopment of successively more complex, faster programming

    environments.Compiler Bootstrapping : - In compiler design, a bootstrap orbootstrapping compiler is a compiler that is written in the target language,or a subset of the language, that it compiles.

    5

  • 8/8/2019 Booting of Os

    7/23

    MASTER BOOT RECORD:

    When you turn on your PC, the processor attempts to beginthe process of processing data. But, since the system memory is empty,

    the processor doesn't really have anything to execute, or even begin toknow where to look for it. Every hard disk must have a consistent"starting point" where key information is stored about the disk, such asthe number of partitions and what type they are. There also must besomeplace where the BIOS can load the initial boot program that startsthe process of loading the operating system. The place where thisinformation is stored is called the master boot record (MBR).

    Structure Of Master Boot Record :

    Master Partition Table: This small bit of code that isreferred to as a table contains a complete description of the partitions thatare contained on the hard disk. Master Boot Code: The master bootrecord is the small bit of computer code that the BIOS loads and executesto start the boot process. This code, when fully executed, transfers controlto the boot program stored on the boot (active) partition to load theoperating system.

    6

  • 8/8/2019 Booting of Os

    8/23

    BOOT LOADER:

    The computer's hardware alone cannot perform complexactions such as loading a program from disk, so an apparent paradox

    exists: to load the operating system into memory, Boot Loaders only jobis to load other software for the operating system to start. The boot loaderwould then read the operating system in from an outside storage mediumsuch as paper tape, punched card, or a disk drive.A boot loader loads theoperating system. When your machine loads its operating system, theBIOS reads the first 512 bytes of your bootable media which is known asthe master boot record, or MBR. You can store the boot record of onlyone operating system in a single MBR.

    Types of Boot Loaders :

    i. NTLDRii. LILO(Linux Loader)

    iii. GNU GRUB

    7

  • 8/8/2019 Booting of Os

    9/23

    NTLDR

    Abbreviation of NT Loader Used for Windows NT,including some of itslater versions (2000/XP/Server 2003). NTLDR can be run from eitherportable storage (such as a CD-ROM, USB flash drive), floppy disk, oreven the primary hard disk. NTLDR can also load a non NT-basedoperating system given the appropriate boot sector in a file. NTLDRrequires, at the minimum, the following two files to be on the systemvolume:

    1) NTLDR: which contains the main boot loaderitself.

    2) Boot.ini: which contains configuration optionsfor a boot menu?

    8

  • 8/8/2019 Booting of Os

    10/23

    LILO(LInux LOader):

    A versatile boot manager that supports:

    Choice of operating systems / kernels Boot time kernel parameters Booting non-Linux kernels A variety of configurations

    Characteristics:

    Lives in MBR or partition boot sector Has no knowledge of file system structure so Builds a sector map file (block map) to find kernel

    /sbin/lilo map installer

    Builds map file, boot sector Run after change to kernel or /etc/lilo.conf

    GNU GRUB :

    More recently, the GRand Unified Boot loader (commonlyknown as GRUB) seems to have somewhat taken the boot loaders crownfrom LILO. GNU GRUB is actively developed by the Free SoftwareFoundation and based on the original GRUB program.

    9

  • 8/8/2019 Booting of Os

    11/23

    STEPS IN BOOTING:

    The Boot process occurs in five stages:

    Pre-boot sequenceBoot sequenceKernel loadKernel initializationLogon

    1. Pre-boot sequence:The computer runs power-on self test (POST) routines.The

    POST routines determine the amount of physical memory, the presenceof hardware components, and so on. If the computer has a Plug and PlayBIOS, enumeration and configuration of hardware devices occur at thisstage. The computer BIOS locates the boot device and loads and runs themaster boot record (MBR).

    The MBR:1.Scans the partition table to locate the active partition.2.Loads the boot sector on the active partition into memory .3.Executes the boot sector

    The computer loads and initializes the NTLDR file, which is theoperating system loader.

    The first thing that the BIOS does when it boots the PC is to

    perform what is called thePower-On Self-Test

    , orPOST

    for short. ThePOST is a built-in diagnostic program that checks your hardware toensure that everything is present and functioning properly, before theBIOS begins the actual boot. It later continues with additional tests (suchas the memory test that you see printed on the screen) as the boot processis proceeding.

    The POST runs very quickly, and you will normally not evennoticed that it is happening--unless it finds a problem (amazing howmany things are like that, isn't it?) You may have encountered a PC that,when turned on, made beeping sounds and then stopped without booting

    10

  • 8/8/2019 Booting of Os

    12/23

    up. That is the POST telling you something is wrong with the machine.The speaker is used because this test happens so early on, that the videoisn't even activated yet! These beep patterns can be used to diagnosemany hardware problems with your PC.

    2. Boot Sequence:

    The second stage of the boot process is the boot sequence.After the computer loads NTLDR into memory, the boot sequencegathers information about hardware and drivers to prepare for the loadphases.

    The boot sequence has four phases:

    i. Initial boot loader phaseii. Operating system selection

    iii. Hardware detectioniv. Configuration selectionv. Kernel Load

    NTLDR switches the microprocessor from real mode to 32-bit flat memory mode, which NTLDR requires to carry out anyadditional functions. NTLDR starts the appropriate minifile systemdrivers, which Are built into NTLDR Enable NTLDR to find and loadoperating system from partitions formatted with file allocation table(FAT), FAT32, or NTFS file systems.

    Initial Boot Loader Phase:

    NTLDR switches the microprocessor from real mode to 32-bit flat memory mode, which NTLDR requires to carry out any additionalfunctions.

    NTLDR starts the appropriate minifile system drivers, which Are built into NTLDR Enable NTLDR to find and load Windows XP Professional

    from partitions formatted with file allocation table (FAT),FAT32, or NT file system (NTFS)

    11

  • 8/8/2019 Booting of Os

    13/23

    Operating system selection:

    During the boot sequence, NTLDR reads the BOOT.INI file.If more than one operating system selection is available in BOOT.INI, the

    Please Select The Operating System To Start screen appears. If nooperating system is selected before the timer reaches zero, NTLDR loadsthe operating system specified by the default parameter in BOOT.INI. If there is only one entry in BOOT.INI, the default operating system isautomatically loaded. If BOOT.INI is not present, NTLDR attempts toload Windows XP Professional from the first partition of the first disk,typically C:\.

    Hardware Detection Phase:

    NTDETECT.COM and NTOSKRNL.EXE performhardware detection.NTDETECT.COM executes after you select theoperating system on the Please Select The Operating System To Startscreen (or after the timer times out).NTDETECT.COM collects a list of currently installed hardware components and returns this list to NTLDR.

    NTDETECT.COM detects the following components:

    i. Bus/adapter typeii. Communication ports

    iii. Floating-point coprocessoriv. Floppy disksv. Keyboard

    vi. Mouse/pointing devicevii. Parallel ports

    viii. SCSI adaptersix. Video adapters

    Configuration Selection Phase:

    NTLDR does the following:

    Starts loading the operating system. Collects hardware information. Presents the Hardware Profile/Configuration Recovery

    menu .

    12

  • 8/8/2019 Booting of Os

    14/23

    The first hardware profile on the Hardware Profile/ConfigurationRecovery menu is highlighted.

    Press Enter to select the highlighted hardware profile. Press the down-pointing arrow key to select another

    profile. Press L to invoke the LastKnownGood configuration.

    If there is only a single hardware profile on the menu, NTLDR

    Does not display the Hardware profile/ConfigurationRecovery menu.

    Loads the operating system using the default hardwareprofile configuration.

    Kernel Load Stage

    During the kernel load stage, NTLDR does the following:

    Loads NTOSKRNL.EXE but does not initialize it Loads the hardware abstraction layer file (HAL.DLL)

    Loads the HKEY_LOCAL_MACHINE\SYSTEMregistry key from%systemroot %\System32\Config\System

    Selects the control set it will use to initialize the computer Loads device drivers with a value of 0x0 for the Start

    entry .

    Kernel Initialization Stage

    When the kernel load stage is complete, the kernelinitializes, and NTLDR passes control to the kernel. The system displaysa graphical screen with a status bar indicating load status.

    Four tasks are accomplished during the kernel initialization stage:

    I. The Hardware key is created.II. The Clone control set is created.

    III. Device drivers are loaded and initialized.IV. Services are started.

    13

  • 8/8/2019 Booting of Os

    15/23

    The Hardware Key Is Created:-

    On successful initialization, the kernel uses the datacollected during hardware detection to create the registry key

    HKEY_LOCAL_MACHINE\HARDWAREThe key contains information about

    Hardware components on the system board The interrupts used by specific hardware devices.

    The Clone Control Set Is Created:-

    The kernel creates the Clone control set by copying thecontrol set referenced by the value of the Current entry in theHKEY_LOCAL_MACHINE\SYSTEM\Select sub key of the registry.

    The Clone control set is never modified because it isintended to be an identical copy of the data used to configure thecomputer and should not reflect changes made during the startup process.

    Device Drivers Are Loaded and Initialized:-

    After creating the Clone control set, the kernel initializes thelow-level device drivers that were loaded during the kernel load stage.

    The kernel then scans theHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services subkey of the registry for device drivers with a value of 0x1 for the Startentry. A device drivers value for the Group entry specifies the order inwhich it loads. Device drivers initialize as soon as they load.

    Errors Control Values And Action:

    If an error occurs, the boot process proceeds based on the valuespecified in the ErrorControl entry for the driver.

    ErrorControl Values and Action 0x0 (Ignore): the boot sequence ignores the error and proceeds

    without displaying an error message. 0x1 (Normal): the boot sequence displays an error message but

    ignores the error and proceeds. 0x2 (Severe): the boot sequence fails and then restarts using the

    LastKnownGood control set.

    14

  • 8/8/2019 Booting of Os

    16/23

    If the boot sequence is currently using the LastKnownGood control set, itignores the error and proceeds.

    0x3 (Critical): the boot sequence fails and then restarts using the

    LastKnownGood control set. However, if the LastKnownGood control setis causing the critical error, the boot sequence stops and displays an errormessage. Error Control values appear in the registry under the sub key

    HKEY_LOCAL_MACHINE\ SYSTEM\CurrentControlSet\Services\ name_of_service_or_driver \ErrorControl

    Services Are Started.Session Manager (SMSS.EXE) does thefollowing:

    Reads and executes the commands specified in the BootExecutedata item before it loads any services

    Reads the Memory Management key and creates the paging fileinformation required by the Virtual Memory Manager

    Reads the DOS Devices key and creates symbolic links that directcertain classes of commands to the correct component in the filesystem

    Reads the SubSystems key and starts the Win32 subsystem, whichcontrols all input/output (I/O) and access to the video screen and

    starts the WinLogon process.

    Logon Stage:The logon process begins when kernel initialization ends.

    The Win32 subsystem automatically starts WINLOGON.EXE.WINLOGON.EXE starts the Local Security Authority (LSASS.EXE) anddisplays the Logon dialog box. The Service Controller executes andmakes a final scan of the HKEY_LOCAL_MACHINE\SYSTEM\

    CurrentControlSet\Services sub key and starts the following services:

    All services with a start entry of 0x2 Workstation service Server service

    A operating system startup is not considered good until auser successfully logs on to the system.After a successful logon, thesystem copies the Clone control set to the LastKnownGood control set.

    15

  • 8/8/2019 Booting of Os

    17/23

    FLOW CHART

    16

  • 8/8/2019 Booting of Os

    18/23

    REBOOT:

    Hard reboot: - A hard reboot is when power to a computer is cycled or aspecial reset signal to the processor is triggered. This restarts thecomputer without first performing any shut-down procedure.

    Soft reboot: - A soft reboot is restarting a computer under softwarecontrol, without removing power or triggering a reset line. It usually,though not always, refers to an orderly shutdown and restarting of themachine.

    Random reboot: - Random reboot is a non-technical term referring to anunintended reboot for which the cause is not immediately evident to theuser. Such reboots may occur due to a multitude of software andhardware problems, such as triple faults.

    17

  • 8/8/2019 Booting of Os

    19/23

    SHUTDOWN/BOOTING DOWN:

    Any user issued command to the kernel to shutdownshould result in a graceful termination of services.Prevent any furthercreation of user processes.Flush any pending I/O the kernel may bebuffering.

    Especially key for maintaining file integrity.The kernel process ( idle )sends a terminate signal to all processes in the system.Remember: It is theoverall parent!Hardware oriented shutdowns may not be as gracefulCTRL-ALT-DEL or power switchThis is dependent on how the kernel

    handles the hardware interrupt.CTRL_ALT_DEL is often serviced as a regular shutdown usercommand.Power switch is often a hard shutdown!

    Important to offer both hard and soft shutdown mechanisms to supportuser needs!

    18

  • 8/8/2019 Booting of Os

    20/23

    NETWORK BOOTING:The central idea is that the computer has some bootstrap

    code in non-volatile memory, e.g. a ROM chip, that will allow it tocontact a server and obtain system files over a network link. One goal isto avoid the use of a hard disk for booting. With network booting the filesare held at a central server and can be updated at one location. Anothergoal is to use computers in locations where hard disks are not robustenough. Network booting often co-exists with disk booting. For example,a system could run Windows from disk but sometimes boot Linux fromthe network. In order to boot over the network, the computer must get Anidentity, An operating system image and Usually, a working file system.

    19

  • 8/8/2019 Booting of Os

    21/23

    DUAL BOOTING:Step1: Defrag : -Before you can begin to reallocate the hard drive tomultiply partitions, you have to run Microsoft Defrag to move all of yourfiles to the front of the drive. This is the most important step to not losingfiles during a dual-boot creation.

    Step2 : Restarting in Ranish :- Next, you need a program to edit thepartition table, and that tool is ranish. Ranish does not work when runningin Windows, so you need to make a DOS boot disk to run ranish in DOS.Copy the following to a disk.

    command.com

    IO.sys

    scandisk.exe

    part240.exe

    Step3 : Starting ranish: - Once the computer comes up to the prompt,A:\ , type in part240.exe .The GUI will load, and you can now edit thepartition tables. If you areusing a single partition computer running

    windows, your only partition will be a FAT32 partition.

    Step4 : Resizing: - using your arrow keys, select the partition you wishto resize, most likely its Windows FAT32 LBA. Now move over to theEnding columns, specifically Cyl.

    Step5 : MBR resizing: - If you got an error message at the top of thescreen, then you are doing it right. The error message means that youhave successfully changed one of two partition tables. Now you canalways discard the changes at this point if you messed up by hitting esc afew times.

    Step6 : Done: - Almost. All you have to do is exit out of ranish and makesure it is saved. What about the linux partition? Well, from my ownexperience, it is better to leave unused space so linux can partition it howit likes instead of how you want it.

    Closing : -Once you have finished the process to dual-boot yourcomputer. you have to do is place the linux install disk in your CD drive

    and boot to it. If your computer can not boot from the CD drive, then youwill have to make a boot disk.

    20

  • 8/8/2019 Booting of Os

    22/23

    CHANGING BOOT SEQUENCE:Direct after the power-up sequence, your Com/PC is booting theWindows XP operating system from the internal hard disk drive (HDD).It is also possible to boot a second operating system (e.g. the SSVEmbedded Gateway Linux) from a Compact Flash card in the Com/PCfront panel.

    Step 1 : Restart your Com/PC and enter the BIOS Setup Utility. Thenselect the Boot item from main menu. Change the Boot Device Priority tothe following values:

    1st Boot Device the Compact Flash card

    2nd Boot Device the internal HDD

    Step 2 : Select the Exit item from the main menu and save the currentBIOS setup.

    Step 3 : Turn the Com/PC off and insert a bootable Compact Flash cardinto the Compact Flash socket. After the next power-up sequence, theCom/PC tries to boot an operating system directly from the CompactFlash card.

    21

  • 8/8/2019 Booting of Os

    23/23

    REFERENCES: http://dotnetjunkies.com/WebLog/unknownreference/articles/12284.aspx

    http://www.pctoday.com/Editorial/article.asp?article=articles/ 2004/t0206/06t06/06t06.asp&guid

    http://www.kernelthread.com/mac/osx/arch_boot.html

    http://www.cs.rpi.edu/~gerbal/BootX.pdf

    http://computer.howstuffworks.com/

    http://www. pcworld.com/

    http://www.google.co.in/

    http://www.wikipedia.org/

    THANK YOU!!!

    http://www.kernelthread.com/mac/osx/arch_boot.htmlhttp://www.cs.rpi.edu/~gerbal/BootX.pdfhttp://www.cs.rpi.edu/~gerbal/BootX.pdfhttp://computer.howstuffworks.com/http://www.google.co.in/http://www.wikipedia.org/http://www.wikipedia.org/http://www.google.co.in/http://computer.howstuffworks.com/http://www.cs.rpi.edu/~gerbal/BootX.pdfhttp://www.kernelthread.com/mac/osx/arch_boot.html