Boot Sequence

44
1 SHRI SANT GAJANAN MAHARAJ COLLEGE OF SHRI SANT GAJANAN MAHARAJ COLLEGE OF ENGINEERING, SHEGAON ENGINEERING, SHEGAON (DEPT. OF CSE) REPORT ON BOOTING SEQUENCE

description

presentation on booting sequence

Transcript of Boot Sequence

Page 1: Boot Sequence

1

SHRI SANT GAJANAN MAHARAJ SHRI SANT GAJANAN MAHARAJ COLLEGE OF ENGINEERING, COLLEGE OF ENGINEERING,

SHEGAONSHEGAON

(DEPT. OF CSE)

REPORT ON

BOOTING SEQUENCE

Page 2: Boot Sequence

Presented By

Abhijit Nimbhorkar (36)

Rajesh Kumar Parmanik (56)

Ravindra Prasad Mahto (58)

Rushikesh V. Sangamkar(60)

Tushar S. Panpaliya(67)

Page 3: Boot Sequence

Objectives… Definition Bootstrapping The Master Boot Record Structure: Master Boot Record Boot Loader Types of Boot Loader

NTLDR LILO GNU GRUB

Steps in Booting Power On Self-Test Boot Sequence

Initial Boot Loader Phase. Operating System Selection Phase. Hardware detection Phase. Configuration Selection Phase.

Page 4: Boot Sequence

Objectives(contd.)

Page 5: Boot Sequence

Definition Each time a computer boots up, it goes

through an initial series of processes. This sequence of events is named as a "boot sequence“.

During the boot sequence, the computer activates the necessary hardware components and loads the appropriate software so that a user can interact with the machine.

The boot sequence starts by accessing the computer's BIOS on Windows PCs or the system ROM on a Macintosh. The BIOS and ROM contain basic instructions that tell the computer how to boot up.

Page 6: Boot Sequence

Bootstrapping

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

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

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

o Software Bootstrapping: - Bootstrapping can also refer to the development of successively more complex, faster programming environments.

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

Page 7: Boot Sequence

The Master Boot Record

o When you turn on your PC, the processor attempts to begin the process of processing data. But, since the system memory is empty, the processor doesn't really have anything to execute, or even begin to know where to look for it.

o Every hard disk must have a consistent "starting point" where key information is stored about the disk, such as the number of partitions and what type they are.

o There also must be someplace where the BIOS can load the initial boot program that starts the process of loading the operating system. The place where this information is stored is called the master boot record (MBR),

Page 8: Boot Sequence

Structure: Master Boot Record

o Master Partition Table: This small bit of code that is referred to as a table contains a complete description of the partitions that are contained on the hard disk.

o Master Boot Code: The master boot record is the small bit of computer code that the BIOS loads and executes to start the boot process. This code, when fully executed, transfers control to the boot program stored on the boot (active) partition to load the operating system.

Page 9: Boot Sequence

Boot loadero The computer's hardware alone cannot perform

complex actions such as loading a program from disk, so an apparent paradox exists: to load the operating system into memory,

o Boot Loader’s only job is to load other software for the operating system to start.

o The boot loader would then read the operating system in from an outside storage medium such as paper tape, punched card, or a disk drive.

o A boot loader loads the operating system. When your machine loads its operating system, the BIOS reads the first 512 bytes of your bootable media which is known as the master boot record, or MBR.

Page 10: Boot Sequence

Type of Boot Loader

Following are the types of boot loader’s: NTLDR LILO( Linux Loader) GNU GRUB( GRand Unified Boot Loader)

Page 11: Boot Sequence

BOOT LOADERS: NTLDR

Page 12: Boot Sequence

BOOT LOADERS: NTLDR

o Abbreviation of NT Loader o Used for Windows NT,including some of its later

versions (2000/XP/Server 2003). o NTLDR can be run from either portable storage (such

as a CD-ROM, USB flash drive), floppy disk, or even the primary hard disk.

o NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.

NTLDR requires, at the minimum, the following two files to be on the system volume:

1)NTLDR:which contains the main boot loader itself.

2)boot.ini:which contains configuration options for a boot menu.

Conti…

Page 13: Boot Sequence

LILO (LInux Loader):1. A versatile boot manager that supports:

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

2. 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

3. /sbin/lilo – “map installer” Builds map file, boot sector Run after change to kernel or /etc/lilo.conf

Page 14: Boot Sequence

GNU GRUB(GRand Unified Boot Loader)

o More recently, the GRand Unified Boot loader (commonly known as GRUB) seems to have somewhat taken the boot loaders crown from LILO.

o GNU GRUB is actively developed by the Free Software Foundation and based on the original GRUB program.

Page 15: Boot Sequence

Steps in Booting

The boot process occurs in five stages: Pre-boot sequence Boot sequence Kernel load Kernel initialization Logon

Page 16: Boot Sequence

Pre-Boot Sequence

The computer runs power-on self test (POST) routines. The POST routines determine the amount of physical memory, the

presence of hardware components, and so on. If the computer has a Plug and Play BIOS, enumeration and

configuration of hardware devices occur at this stage. The computer BIOS locates the boot device and loads and

runs the master boot record (MBR). The MBR

Scans the partition table to locate the active partition Loads the boot sector on the active partition into memory Executes the boot sector

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

Page 17: Boot Sequence

Boot Sequence The second stage of the boot process is

the boot sequence. After the computer loads NTLDR into

memory, the boot sequence gathers information about hardware and drivers to prepare for the load phases.

The boot sequence has four phases: Initial boot loader phaseOperating system selectionHardware detectionConfiguration selection

Page 18: Boot Sequence

Initial Boot Loader Phase NTLDR switches the microprocessor

from real mode to 32-bit flat memory mode, which NTLDR requires to carry out any additional functions.

NTLDR starts the appropriate minifile system drivers, which Are built into NTLDREnable NTLDR to find and load operating

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

Page 19: Boot Sequence

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 no operating system is selected before the timer reaches zero, NTLDR loads the operating system specified by the default parameter in BOOT.INI.

If there is only one entry in BOOT.INI, the default operating system is automatically loaded.

If BOOT.INI is not present, NTLDR attempts to load the operating system from the first partition of the first disk, typically C:\.

Page 20: Boot Sequence

Hardware Detection Phase NTDETECT.COM and NTOSKRNL.EXE

perform hardware detection. NTDETECT.COM executes after you

select the operating sysytem on the Please Select The Operating System To Start screen (or after the timer times out).

NTDETECT.COM collects a list of currently installed hardware components and returns this list to NTLDR.

Page 21: Boot Sequence

Hardware Detection Phase(contd.) NTDETECT.COM detects the following

components: Bus/adapter typeCommunication portsFloating-point coprocessorFloppy disksKeyboardMouse/pointing deviceParallel portsSCSI adaptersVideo adapters

Page 22: Boot Sequence

Configuration Selection Phase NTLDR does the following:

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

menu .

The first hardware profile on the Hardware Profile/Configuration Recovery 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.

Page 23: Boot Sequence

Configuration Selection Phase(contd.)

If there is only a single hardware profile on the menu, NTLDR Does not display the Hardware profile/

Configuration Recovery menu.Loads the operating system using

the default hardware profile configuration.

Page 24: Boot Sequence

Kernel Load Stage During the kernel load stage, NTLDR does

the following: Loads NTOSKRNL.EXE but does not initialize itLoads the hardware abstraction layer file

(HAL.DLL)Loads the HKEY_LOCAL_MACHINE\SYSTEM

registry 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

Page 25: Boot Sequence

Kernel Initialization Stage When the kernel load stage is complete,

the kernel initializes, and NTLDR passes control to the kernel.

The system displays a graphical screen with a status bar indicating load status.

Four tasks are accomplished during the kernel initialization stage: The Hardware key is created.The Clone control set is created.Device drivers are loaded and initialized.Services are started.

Page 26: Boot Sequence

The Hardware Key Is Created On successful initialization, the kernel

uses the data collected during hardware detection to create the registry key HKEY_LOCAL_MACHINE\HARDWARE

The key contains information about Hardware components on the system board The interrupts used by specific hardware

devices

Page 27: Boot Sequence

Clone Control Set Is Created

The kernel creates the Clone control set by copying the control set referenced by the value of the Current entry in the HKEY_LOCAL_MACHINE\SYSTEM\Select subkey of the registry.

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

Page 28: Boot Sequence

Device Drivers Are Loaded & Initialized

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

The kernel then scans the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services subkey of the registry for device drivers with a value of 0x1 for the Start entry.

A device driver’s value for the Group entry specifies the order in which it loads.

Device drivers initialize as soon as they load. If an error occurs, the boot process proceeds

based on the value specified in the ErrorControl entry for the driver.

Page 29: Boot Sequence

ErrorControl Value & 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. If the boot sequence is currently using the

LastKnownGood control set, it ignores the error and proceeds.

Page 30: Boot Sequence

ErrorControl Value & Action(contd.)

0x3 (Critical): the boot sequence fails and then restarts using the LastKnownGood control set. However, if the LastKnownGood control set is causing the critical error, the boot sequence stops and displays an error message.

ErrorControl values appear in the registry under the subkey HKEY_LOCAL_MACHINE\

SYSTEM\CurrentControlSet\Services\name_of_service_or_driver\ErrorControl.

Page 31: Boot Sequence

Services Are Started Session Manager (SMSS.EXE) does the

following: Reads and executes the commands specified in the

BootExecute data item before it loads any servicesReads the Memory Management key and creates

the paging file information required by the Virtual Memory Manager

Reads the DOS Devices key and creates symbolic links that direct certain classes of commands to the correct component in the file system

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

Page 32: Boot Sequence

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) and displays the Logon dialog box. The Service Controller executes and makes a final

scan of the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services subkey and starts the following services: All services with a start entry of 0x2 Workstation service Server service

Page 33: Boot Sequence

Logon Stage (Cont.)

A Windows XP Professional startup is not considered good until a user successfully logs on to the system.

After a successful logon, the system copies the Clone control set to the LastKnownGood control set.

Page 34: Boot Sequence

Flow Chart

Page 35: Boot Sequence

Reboot

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

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

o Random reboot: - Random reboot is a non-technical term referring to an unintended reboot for which the cause is not immediately evident to the user. Such reboots may occur due to a multitude of software and hardware problems, such as triple faults.

Page 36: Boot Sequence

Shutdown / Booting Downo Any user issued command to the

kernel to shutdown should result in a “graceful” termination of services.o Prevent any further creation of user

processes.o Flush any pending I/O the kernel may be

buffering. Especially key for maintaining file integrity.

o The kernel process (idle) sends a terminate signal to all processes in the system.

o Remember: It is the overall parent!

Page 37: Boot Sequence

Shutdown(contd.) o Hardware oriented shutdowns may

not be as gracefulo CTRL-ALT-DEL or power switch

o This is dependent on how the kernel handles the hardware interrupt.o CTRL_ALT_DEL is often serviced as a

regular shutdown user command.o Power switch is often a “hard” shutdown!

o Important to offer both hard and soft shutdown mechanisms to support user needs!

Page 38: Boot Sequence

Network Bootingo The central idea is that the computer has some bootstrap

code in non-volatile memory, e.g. a ROM chip, that will allow it to contact a server and obtain system files over a network link.

o One goal is to avoid the use of a hard disk for booting. o With network booting the files are held at a central server

and can be updated at one location. o Another goal is to use computers in locations where hard

disks are not robust enough. o Network booting often co-exists with disk booting. For

example, a system could run Windows from disk but sometimes boot Linux from the network.

o In order to boot over the network, the computer must get o An identity, o An operating system image and o Usually, a working file system.

Page 39: Boot Sequence

Dual Bootingo Step1: Defrag : -Before you can begin to reallocate the

hard drive to multiply partitions, you have to run Microsoft Defrag to move all of your files to the front of the drive. This is the most important step to not losing files during a dual-boot creation.

o Step2 : Restarting in Ranish :- Next, you need a program to edit the partition table, and that tool is ranish. Ranish does not work when running in 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* *find these part240.exe in C:\windows\command\

o 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 the partition tables. If you areusing a single partition computer running windows, your only partition will be a FAT32 partition.

Page 40: Boot Sequence

Dual Booting(contd.)o Step4 : Resizing: - using your arrow keys, select the partition

you wish to resize, most likely it’s “Windows FAT32 LBA”. Now move over to the Ending columns, specifically “Cyl”.

o Step5 : MBR resizing: - If you got an error message at the top of the screen, then you are doing it right. The error message means that you have successfully changed one of two partition tables. Now you can always discard the changes at this point if you messed up by hitting esc a few times.

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

o Closing : -Once you have finished the process to dual-boot your computer. 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 you will have to make a boot disk.

Page 41: Boot Sequence

Changing Boot Sequenceo Direct after the power-up sequence, your Com/PC is booting

the Windows XP operating system from the internal hard disk drive (HDD). It is also possible to boot a second operating system (e.g. the SSV Embedded Gateway Linux) from a Compact Flash card in the Com/PC front panel.

Step 1: Restart your Com/PC and enter the BIOS Setup Utility. Then select the Boot item from

main menu. Change the Boot Device Priority to the 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 current BIOS setup.

Page 42: Boot Sequence

Changing Boot Sequence(contd.)o Step 3: Turn the Com/PC off and insert a bootable

Compact Flash card into the Compact Flash socket. After the next power-up sequence, the Com/PC tries to boot an operating system directly from the Compact Flash card.

Page 43: Boot Sequence

Reference:

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

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

• For the Macintosh OS-X

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

Page 44: Boot Sequence

.