xp booting

Upload: jaishri-krishna

Post on 05-Apr-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 XP Booting

    1/76

    Windows XP Boot Process

    70-270: MCSE Guide toMicrosoft Windows XP Professional

  • 8/2/2019 XP Booting

    2/76

    Booting Windows XP (Page 1)

    Boot processphases:

    Boot phase begins when computer is firstpowered on

    Or begins when Restart is chosen from"Shut Down Windows" dialog box

    Windows XP load phases

    Begins when boot phase is completed Configuration is selected

  • 8/2/2019 XP Booting

    3/76

    Booting Windows XP (Page 2)

    Boot Phase Steps

    Power-on self test(POST)

    Initial startup

    Boot loader

    Select operatingsystem

    Detect hardware

    Select configuration

    Windows XP Load Phase

    Load the kernel

    Initialize the kernel

    Services load

    Windows XP systemstartup

    Log on

  • 8/2/2019 XP Booting

    4/76

    Power-on Self Test (Page 1)

    First step in boot sequence (the POST) forany computer with an operating system

    Determines: Amount of real memory that exists

    Whether or not all necessary hardwarecomponents are present and functioning

    The specific tests vary depending on howthe BIOS (Basic Input/Output System) isconfigured

  • 8/2/2019 XP Booting

    5/76

    Power-on Self Test (Page 2)

    If POST is successful, computer boots itself

    If the tests are unsuccessful, the computer

    reports error by: Emitting a series of beeps (number of beeps

    identifies the errordiffers from one BIOS toanother)

    Also possibly might display error messageand a code on the screen

  • 8/2/2019 XP Booting

    6/76

    Power-on Self Test (Page 3)

    Software that performs POST resides incalled the CMOS (complementary metaloxide semiconductor)

    Battery-powered chip that also can hold

    basic configuration information so POSTcan check installed RAM, number and typeof hard drives, type of keyboard and mouse,the boot sequence (Which drive first?), etc.

    In Windows XP, BIOS no longer storesinformation about devices and drivers

    connected to system (replaced by the HAL)

  • 8/2/2019 XP Booting

    7/76

    Power-on Self Test

    The following screen shows results ofsample successful POST completion

  • 8/2/2019 XP Booting

    8/76

    Power-on Self Test

  • 8/2/2019 XP Booting

    9/76

    Power-on Self Test (Page 4)

    After POST completes, each adapter witha BIOS performs its own self-test (POST),i.e.

    Video card

    SCSI (small computer system interface)cards which are interfaces that provide

    much faster data transmission rates thanstandard parallel and serial ports; used for

    printers, scanners, etc.

    Adapters issue their own reports on monitor

  • 8/2/2019 XP Booting

    10/76

    Power-on Self Test (Page 5)

    At this point there still is no operatingsystem in RAM

    POST application in the BIOS is in control

    Output on screen is in basic, text-only form

  • 8/2/2019 XP Booting

    11/76

    Initial Startup (Page 1)

    The BIOS finds the first sector of the firsthard drive which contains the Master BootRecord (MBR) and transfers control to it:

    It is the job of MBR ultimately to load the

    Ntldr program (the boot loader program)and pass control of the boot process on toit (either directly or indirectly)

  • 8/2/2019 XP Booting

    12/76

    Initial Startup (Page 2)

    The Master Boot Record (con.):

    In FAT partitions, because the boot sectoris only one sector in size, MBR points toanother location on disk which then pointsto the boot loader

    In NTFS partitions, boot sectors may be upto 16 sectors in size so it is large enough tostore the code to find the boot loader

    If booting from a floppy, the first sectorcontains the partition boot sector

  • 8/2/2019 XP Booting

    13/76

    Initial Startup (Page 3)

    BIOS stores information as to the order inwhich drives are checked to see which isthe startup drive (as stored in CMOS)

    If floppy drive is in the sequence, partition

    boot sector is loaded and runs the MBRfrom the floppy

    If the floppy does not have a partition bootsector, the message "Non-system disk or

    disk error " appears

    Remove disk, and turn machine off an then

    ondo not rebootto avoid viruses

  • 8/2/2019 XP Booting

    14/76

    Initial Startup (Page 3)

    Ntldr is stored on the system partition

    This is the partition where the MBRexpects to find the system

    Ultimately its job is to boot the WindowsXP operating system which is stored onthe boot partition

    The system itself actually can be storedon any partition

    The system and boot partitions may ormay not be the same

  • 8/2/2019 XP Booting

    15/76

    Boot Loader (Page 1)

    Collection of files on system partition usedto initiate loading of operating system

    Required files to boot Windows XP areNtldr, Ntdetect.com and Boot.ini

    Other optional boot loader programs areBootsect.dos and Ntbootdd.sys

  • 8/2/2019 XP Booting

    16/76

    Windows XP Startup Files

  • 8/2/2019 XP Booting

    17/76

    Boot Loader (Page 2)

    The boot loader first switches processorinto 32-bit mode

    Previously it had been running in real modeas if it were an 8088 or 8086 machine

    Next it starts the appropriate file system,FAT, FAT32 or NTFS

    The ability to access any of the file systemsis programmed into Ntldr

  • 8/2/2019 XP Booting

    18/76

    Boot Loader (Page 3)

    Primary functions of the boot loader are to:

    1. Select the operating system to load if thereis more than one from which to choose

    2. Detect hardware

    3. Select a configuration

    Ntldr stays in control throughout boot

    loader process until it loads and passescontrol to Windows XP kernel (Ntoskrnl.ext)

  • 8/2/2019 XP Booting

    19/76

    Selecting the Operating System

    Ntldr reads Boot.ini and displays the Bootselection menu (if necessary)

    Contains operating system choices, if morethat one, from which the user may choose

    It also is possible from this screen to press to reach the "Troubleshooting and

    Advanced Startup" screen (more later) Will auto select first option after a specified

    number of seconds

    Change default O/S or time in Boot.ini

  • 8/2/2019 XP Booting

    20/76

    Boot Selection Menu

  • 8/2/2019 XP Booting

    21/76

    Detecting Hardware

    If the user selects Windows XP (or if it isthe only O/S present), Ntldr executesNtdetect.com

    Used to collect a list of hardware currently

    installed in computer

    From hardware list, creates system profile

    Later will be compared to Windows XPRegistry entries for discrepancies thatcould lead to problems

  • 8/2/2019 XP Booting

    22/76

    Selecting a Configuration

    Next boot loader selects a configuration

    Known as the hardware profile

    If there is one hardware profile, it is selected If there is more than one, system tries to

    select one that matches detected hardware

    If system cannot make automatic selection,

    user is prompted for manual selection

  • 8/2/2019 XP Booting

    23/76

    Troubleshooting and Advanced

    Startup Options (Page 1)

    Windows XP combines the boot andrecovery options of Windows NT andWindows 95/98

    Provides several options to restore amalfunctioning system to functional state

    Before timer expires, or Windows XP

    kernel starts to load, press toaccess Windows Advanced Options Menu

  • 8/2/2019 XP Booting

    24/76

    Troubleshooting and Advanced

    Startup Options

  • 8/2/2019 XP Booting

    25/76

    Troubleshooting and Advanced

    Startup Options (Page 2)

    Contents of menu may include:

    Safe Modeboots Windows XP with onlyminimum system files and drivers

    May be able to boot into a functioningsystem when some drivers are corrupted

    Might allow replacing or removing theproblem driver before rebooting

    Safe Mode with Networkingsame as

    above but with networking components

    If network drivers are not the problem

  • 8/2/2019 XP Booting

    26/76

    Troubleshooting and Advanced

    Startup Options (Page 3)

    Contents of menu may include (con.):

    Safe Mode with Command Promptsameas above but not to the GUI environment

    Enable Boot Loggingenables or disables

    boot process, and writes details to log fileNtbtlog.txt in %systemroot% folder

    Records process of steps between bootmenu and logon prompt which couldprovide clues to which driver, system orprocedure is causing the problem

  • 8/2/2019 XP Booting

    27/76

    Troubleshooting and Advanced

    Startup Options (Page 4)

    Contents of menu may include (con.):

    Enable VGA Modenormal boot but withonly basic VGA video driver (in case there

    is a bad video driver)

    Last Known Good Configurationstate ofRegistry during last successful user logon

    Could be useful if a new driver or softwarerecently has been installed, or the Registrywas recently modified

  • 8/2/2019 XP Booting

    28/76

    Troubleshooting and Advanced

    Startup Options (Page 5)

    Contents of menu may include (con.):

    Directory Services Restore Modeonly onWindows XP domain controllers, restores

    Active Directory

  • 8/2/2019 XP Booting

    29/76

    Troubleshooting and Advanced

    Startup Options (Page 6)

    Contents of menu may include (con.):

    Debugging Modenormal boot but sendsdebugging information to another system

    over a serial cable

    If no other option helps in restoring system,may help determine where in boot processthe problem occurs

    Complex information usually used by high-end programmersconsult MicrosoftWindows XP Professional Resource Kit

  • 8/2/2019 XP Booting

    30/76

    *** Activity ***

    Try one or more of following boot options(press function key during boot):

    Safe Mode

    Safe Mode with Command Prompt

    Enable VGA Mode

    Last Known Good Configuration

    Reboot normally when done

  • 8/2/2019 XP Booting

    31/76

    Boot Configuration and Selecting

    an Operating System (Page 1)

    Controlled through configuration of theBoot.inifile

    Located in the root directory of the systempartition (usually drive C:\)

    To view the file, uncheck "Hide Protectedoperating system files" in Folder Options

    Updated from the "System and Recovery"dialog window on the Advanced tab ofControl Panel's System applet

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    32/76

    Boot Configuration and Selecting

    an Operating System (Page 2)

    Used by boot loader to display the list ofavailable operating systems

    Consists of two sections: [boot loader] and[operating systems]

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    33/76

    Sample "Boot.ini"

    Return

  • 8/2/2019 XP Booting

    34/76

    Settings:

    Timeoutnumber of seconds system waitsfor user to select an operating system

    If set to zero (0), the default operating

    system is loaded automatically

    If set to (-1), waits indefinitely (this value

    only can be set in text editoran invalidvalue in System applet in "Control Panel"

    Defaultshows path to default O/S

    [boot loader]

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    35/76

    [operating systems] (Page 1)

    Lists available operating systems asfollows:

    Path to boot partition for operating system

    Text displayed in boot loader screen

    Optional parameters (switches) provideoptions many of which are equivalent to

    "Windows Advanced Options Menus"As well as a few other options

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    36/76

    [operating systems] (Page 2)

    Switches:

    /BASEVIDEOsame as Enable VGA Mode

    /BAUDRATE=nbaud rate for DebuggingMode

    /BOOTLOGsame as Enable Boot Logging

    /CRASHDEBUGstarts Debugging Mode but

    remains inactive until STOP error occurs

  • 8/2/2019 XP Booting

    37/76

    [operating systems] (Page 3)

    Switches (con.):

    /DEBUGstarts Debugging Mode andallows access by the remote computer

    /DEBUGPORT={com1|com2|1394}sets

    port for Debugging Mode

    /FASTDETECT={com1|com2|}specifies

    serial ports to skip during hardware scanAll if no port specified

    Included in every entry by default when theoperating system is installed

  • 8/2/2019 XP Booting

    38/76

    [operating systems] (Page 4)

    Switches (con.):

    /MAXMEM=nsets maximum RAM O/Scan use

    /NOGUIBOOTboots without showing

    splash screen

    /NODEBUGdisables Debugging Mode

    /NUMPROC=nsets maximum number ofprocessors on multiprocessor machine thatO/S may use

  • 8/2/2019 XP Booting

    39/76

    [operating systems] (Page 5)

    Switches (con.):

    /SAFEBOOT:MINIMALboots to Safe Mode

    /SAFEBOOT:NETWORKboots to SafeMode with Networking

    /SAFEBOOT:MINIMAL(ALTERNATESHELL)boots to Safe Mode with Command

    Prompt/SOSdisplays device driver names when

    they are loaded

  • 8/2/2019 XP Booting

    40/76

    Advanced RISC Computing

    Pathnames (Page 1)

    Advanced RISC Computing pathnameis a path naming convention that is usedin the "Boot.ini" file

    Defines the hard disk, partition and folderwhere Windows XP Professional and anyother operating systems reside

    Created automatically when an operatingsystem is installed into a partition

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    41/76

    Advanced RISC Computing

    Pathnames (Page 2)

    The parts of the path are:

    scsi(n) or multi(n)whether the drive typeis SCSI or other (multi) and the adapter

    number

    disk(n)the SCSI bus number

    rdisk(n)which disk contains the O/S

    partition(n)selects partition with the O/S\pathselect path with the O/S

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    42/76

    Editing Boot.ini

    Options for editing (see next slides):

    Use Control Panel to edit indirectly

    Use text editor (i.e. Notepad) to changethe Boot.ini file directly

  • 8/2/2019 XP Booting

    43/76

    Using Control Panel

    Safest way to proceed

    Select System applet in "Control Panel",then select Advanced tab, and the Startupand Recovery button

    Options to modify:

    Choose "Default operating system" (the

    default boot selection) Select "Time to display list of operating

    systems" (delay interval before bootselection starts automatically)

  • 8/2/2019 XP Booting

    44/76

    Startup and Recover Dialog

  • 8/2/2019 XP Booting

    45/76

    Using a Text Editor

    Use Notepad or any other text editor

    The button in the "Startup andRecovery" window launches Notepad

    and opens the Boot.ini file

    Be careful when editing file

    Windows XP might not boot if there is an

    incorrect configuration Create backup copy of the file before

    making changes

  • 8/2/2019 XP Booting

    46/76

    *** Activity ***

    Before starting this activity, you shouldbackup boot.ini

    Modify "timeout" value using Notepad

    Set the "timeout" value back to its originalvalue (30) using Startup and Recoverydialog in System applet in "Control Panel"

    Return to Notepad and open boot.ini toconfirm the change

    S t lid

  • 8/2/2019 XP Booting

    47/76

    *** Activity ***

    Before starting this activity, you shouldbackup boot.ini

    In Notepad, create one or more additionaloperating system entries, i.e.

    An additional Windows XP Professionalentry but booting in VGA Mode

    A fictionalentry for Windows 2000 on analternate partition

    See next slide

  • 8/2/2019 XP Booting

    48/76

    Sample "Boot.ini"

    [boot loader]

    timeout=30

    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

    [operating systems]

    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="MicrosoftWindows XP Professional" /fastdetect

    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft

    Windows XP Pro VGA Mode" /fastdetect/basevideo

    multi(0)disk(0)rdisk(3)partition(2)\WINNT="MicrosoftWindows 2000" /fastdetect

    To Sample"Boot.ini"

  • 8/2/2019 XP Booting

    49/76

    Windows XP Load Phase

    Stages:

    Loading the kernel

    Initializing the kernel

    Services load

    Windows XP system startup

    Logging on

  • 8/2/2019 XP Booting

    50/76

    Loading the Kernel (Page 1)

    Once Windows XP is selected as O/S toboot, a "Starting Windows" text message

    and the XP splash screen are displayed

    During this time the boot loader loads thekernel into memory (consists of):

    Windows XP kernel (Ntoskrnl.exe)

    Hardware abstraction layer (HAL), the filethat is named Hal.dll

  • 8/2/2019 XP Booting

    51/76

    Loading the Kernel (Page 2)

    The kernel is the centralmodule of an operating system:

    Loads first and remains in

    main memory at all times

    Essential that it is as small aspossible while still providingservices required by the O/Sand applications

  • 8/2/2019 XP Booting

    52/76

    Loading the Kernel (Page 3)

    The kernel (con.)

    Communicates between processes andthe hardware

    Responsible for memory management,

    process and task management, and diskmanagement

  • 8/2/2019 XP Booting

    53/76

    Loading the Kernel (Page 4)

    The Hardware Abstraction Layer (HAL)is an O/S programming component

    Functions as an interface between the

    systems hardware and software

    Applications do not access hardwaredirectly but access the abstract layerprovided by the HAL

  • 8/2/2019 XP Booting

    54/76

    Loading the Kernel (Page 5)

    Hardware Abstraction Layer (con.):

    Like APIs, allows applications to be device-independent

    They abstract information from systemssuch as caches, I/O buses and interrupts

    Use this data to give the software a way tointeract with the specific requirementsof

    the hardware on which it is running

  • 8/2/2019 XP Booting

    55/76

    Loading the Kernel (Page 6)

    Before kernel and HAL begin to execute,the boot loader loads the Registry keyHKLM\SYSTEM

    Retrieves configuration based upon Registrysubkey HKLM\SYSTEM\Select data value

    CurrentControlSet is created (not written toRegistry yet) from one of the following:

    ControlSet00x, a per either the Select orLastKnownGoodRecovery(if Last KnownGood Configuration was selected) data

    value, Default, etc.

    See next slide (HKLM\SYSTEM\Select)

  • 8/2/2019 XP Booting

    56/76

    Loading the Kernel

    Return

  • 8/2/2019 XP Booting

    57/76

    Loading the Kernel (Page 7)

    Loads driverslisted in Registry subkey:

    HKLM\SYSTEM\CurrentControlSet\Services

    These drivers are loaded and/or initializedaccording to their Registry settings

    See next slide (HKLM\SYSTEM\CurrentControlSet\Services

  • 8/2/2019 XP Booting

    58/76

  • 8/2/2019 XP Booting

    59/76

    Initializing the Kernel (Page 1)

    Registry key HKLM\HARDWARE createdby kernel using information it receivedfrom boot loader program Ntdetect.com

    Creates CloneControlSet by making acopy of CurrentControlSet

    Never modifiedintended as a backup

    Initializes drivers that were loaded by theboot loader

  • 8/2/2019 XP Booting

    60/76

    Initializing the Kernel (Page 2)

    If the driver experiences an error whileloading, a message with the error levelreported is reported to the kernel:

    Ignoreerror is ignored and no message isdisplayed to user

    Normalboot process continues withmessage displayed to user

  • 8/2/2019 XP Booting

    61/76

    Initializing the Kernel (Page 3)

    Driver error levels (con.):

    Severedisplays message; if Last KnownGood Configuration is not in use, restarts

    using LKGC; if LKGC is in use, bootprocess continuesafter message

    Criticaldisplays message; if Last KnownGood Configuration is not in use, restarts

    using LKGC; if LKGC is in use, bootprocess failsafter message

    All events saved to the System log

  • 8/2/2019 XP Booting

    62/76

    Services Load (Page 1)

    Kernel starts Session Manager

    Starts programs that correspond to keyentries under Registry key:

    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute

    A REG_MULTI_SZ data type, i.e. an array

    The default entry Autocheck makes surethese files are consistent, and tries torepair them if they are not

    See next slide (HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\BootExecute

  • 8/2/2019 XP Booting

    63/76

    Services Load

    Return

  • 8/2/2019 XP Booting

    64/76

    Services Load (Page 2)

    Paging files are set up as per:

    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

    See next slide (HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management

  • 8/2/2019 XP Booting

    65/76

    Services Load

    Return

  • 8/2/2019 XP Booting

    66/76

    Services Load (Page 3)

    Session Manager writes to Registry:

    CurrentControlSet

    CloneControlSet

    Windows (Win32) subsystem loaded asper Registry entry:

    HKLM\SYSTEM\CurrentControlSet\Control\

    Session Manager\Subsystems Default subsystem, and also the subsystem

    in which the user shell always executes

    See next slide (HKLM\SYSTEM\CurrentControlSet\Control\SessionManager\Subsystems

  • 8/2/2019 XP Booting

    67/76

    Services Load

    Return

  • 8/2/2019 XP Booting

    68/76

    Windows XP System Startup

    At this point, Windows is considered fullystarted which is signaled by appearance ofa Windows XP logon screen

    Win32 subsystem starts winlogon.exewhich launches Local Security Authority(Lsass.exe) process

  • 8/2/2019 XP Booting

    69/76

    Logging On

    The user logs on successfully with logonname, as well as a password if required

    Clone control set is copied to the Last

    Known Good control set completing theboot process

  • 8/2/2019 XP Booting

    70/76

    Multiple-boot Systems (Page 1)

    Windows XP operating system can coexistpeacefully with other operating systems

    Operating system uses one or more file

    systems to organize the data withinvolumes, i.e. FAT or NTFS

  • 8/2/2019 XP Booting

    71/76

    Multiple-boot Systems (Page 2)

    Not all file systems and operating systemsare compatible:

    MS-DOS, Windows 95/98, Windows NT,

    Windows 2000, Windows Server 2003 andWindows XP can share files through FATvolumes

    Windows NT, Windows 2000, Windows

    Server 2003 and Windows XP can sharefiles through NTFS volumes

  • 8/2/2019 XP Booting

    72/76

    Multiple-boot Systems (Page 3)

    File system and operating systemcompatibility (con.):

    Windows and UNIX do not have a common

    file system, but Linux can access FATvolumes

    Only Windows 2000, Windows Server 2003and Windows XP support dynamic disks

    When selecting file systems for partitionsin a multiple-boot system, keep thesefactors in mind if you wish to share files

    between the partitions

    Multiple Windows Operating

  • 8/2/2019 XP Booting

    73/76

    Multiple Windows Operating

    Systems (Page 1)

    Different versions of Windows can beinstalled on the same system, i.e.

    Windows 3.1, Windows 3.11, Windows

    95/98, Windows NT, Windows 2000,Windows Server 2003, even Linux/Unix

    Even the same version of Windows XPcan be installed on separate partitions

    Multiple Windows Operating

  • 8/2/2019 XP Booting

    74/76

    Multiple Windows Operating

    Systems (Page 2)

    Why? User needs to run software versionsthat require an older O/S

    Just remember to specify different partitions

    for each installation

    To run an application under two O/Ss, run

    the setup program twice, once while booted

    to each operating system

  • 8/2/2019 XP Booting

    75/76

    Multiple Installation Order

    Order in which you install operatingsystems is important

    Install older operating systems first, i.e.

    MS-DOS, Windows 95/98, Windows2000/2003, etc.

    This really is a warning, not necessarily an

    absolute requirement When installing Windows XP, it recognizes

    the previously installed older O/S andleaves it alone

  • 8/2/2019 XP Booting

    76/76