Booting
Upcoming SlideShare
Loading in...5
×
 

Booting

on

  • 1,810 views

 

Statistics

Views

Total Views
1,810
Views on SlideShare
1,810
Embed Views
0

Actions

Likes
3
Downloads
68
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Booting Booting Presentation Transcript

  • Course PresentationCourse PresentationBooting of aBooting of aComputer SystemComputer SystemPresentation By:Presentation By: Shehrevar DavierwalaShehrevar DavierwalaContact:Contact: 96736515469673651546Email:Email: shehrevar@live.comshehrevar@live.com
  • Course PresentationWhy is Booting Required ?Why is Booting Required ?► Hardware doesn’t know where the operatingHardware doesn’t know where the operatingsystem resides and how to load it.system resides and how to load it.► Need a special program to do this job –Need a special program to do this job – BootstrapBootstraploader.loader. E.g. BIOS – Boot Input Output System.E.g. BIOS – Boot Input Output System.► Bootstrap loader locates the kernel, loads it intoBootstrap loader locates the kernel, loads it intomain memory and starts its execution.main memory and starts its execution.► In some systems, a simple bootstrap loaderIn some systems, a simple bootstrap loaderfetches a more complex boot program from disk,fetches a more complex boot program from disk,which in turn loads the kernel.which in turn loads the kernel.
  • Course PresentationHow Boot process occurs ?How Boot process occurs ?►Reset event on CPU (power up, reboot)Reset event on CPU (power up, reboot)causes instruction register to be loaded withcauses instruction register to be loaded witha predefined memory location. It contains aa predefined memory location. It contains ajump instruction that transfers execution tojump instruction that transfers execution tothe location of Bootstrap program.the location of Bootstrap program.►This program is form of ROM, since RAM isThis program is form of ROM, since RAM isin unknown state at system startup. ROM isin unknown state at system startup. ROM isconvenient as it needs no initialization andconvenient as it needs no initialization andcan’t be affected by virus.can’t be affected by virus. View slide
  • Course PresentationBIOS InteractionBIOS Interaction View slide
  • Course PresentationTasks performed at boot upTasks performed at boot up► Run diagnostics to determine the state ofRun diagnostics to determine the state ofmachine. If diagnostics pass, booting continues.machine. If diagnostics pass, booting continues.► Runs aRuns a Power-On Self TestPower-On Self Test ((POSTPOST) to check the) to check thedevices that the computer will rely on, aredevices that the computer will rely on, arefunctioning.functioning.► BIOS goes through a preconfigured list of devicesBIOS goes through a preconfigured list of devicesuntil it finds one that is bootable. If it finds no suchuntil it finds one that is bootable. If it finds no suchdevice, an error is given and the boot processdevice, an error is given and the boot processstops.stops.► Initializes CPU registers, device controllers andInitializes CPU registers, device controllers andcontents of the main memory. After this, it loadscontents of the main memory. After this, it loadsthe OS.the OS.
  • Course PresentationBIOS SetupBIOS Setup
  • Course PresentationBoot ProcedureBoot Procedure
  • Course PresentationTasks performed at boot up (Contd)Tasks performed at boot up (Contd)► On finding a bootable device, the BIOS loads andOn finding a bootable device, the BIOS loads andexecutes itsexecutes its boot sectorboot sector. In the case of a hard. In the case of a harddrive, this is referred to as thedrive, this is referred to as the master boot recordmaster boot record((MBRMBR) and is often not OS specific.) and is often not OS specific.► The MBR code checks theThe MBR code checks the partition tablepartition table for anfor anactive partition. If one is found, the MBR codeactive partition. If one is found, the MBR codeloads that partitionsloads that partitions boot sectorboot sector and executes it.and executes it.► The boot sector is oftenThe boot sector is often operating systemoperating system specific,specific,however in most operating systems its mainhowever in most operating systems its mainfunction is to load and execute afunction is to load and execute a kernelkernel, which, whichcontinues startup.continues startup.
  • Course PresentationSecondary Boot LoadersSecondary Boot Loaders► If there is no active partition or the active partitionsIf there is no active partition or the active partitionsboot sector is invalid, the MBR may load aboot sector is invalid, the MBR may load asecondary boot loader and pass control to it andsecondary boot loader and pass control to it andthis secondary boot loader will select a partitionthis secondary boot loader will select a partition(often via user input) and load its boot sector.(often via user input) and load its boot sector.► Examples of secondary boot loadersExamples of secondary boot loaders GRUB – GRand Unified BootloaderGRUB – GRand Unified Bootloader LILO – LInux LOaderLILO – LInux LOader NTLDR – NT LoaderNTLDR – NT Loader
  • Course PresentationGRUB LoaderGRUB Loader
  • Course PresentationBooting and ROMBooting and ROM►System such as cellular phones, PDAs andSystem such as cellular phones, PDAs andgame consoles stores entire OS on ROM.game consoles stores entire OS on ROM.Done only for small OS, simple supportingDone only for small OS, simple supportinghardware, and rugged operation.hardware, and rugged operation.►Changing bootstrap code would requireChanging bootstrap code would requirechanging ROM chips.changing ROM chips. EPROM – Erasable Programmable ROM.EPROM – Erasable Programmable ROM.►Code execution in ROM is slower. Copied toCode execution in ROM is slower. Copied toRAM for faster execution.RAM for faster execution.
  • Course PresentationExample : DOSExample : DOS► After identifying the location of boot files, BIOS looks at the first sectorAfter identifying the location of boot files, BIOS looks at the first sector(512 bytes) and copies information to specific location in RAM (7C00H)(512 bytes) and copies information to specific location in RAM (7C00H)-- Boot RecordBoot Record..► Control passes from BIOS to a program residing in the boot record.Control passes from BIOS to a program residing in the boot record.► Boot record loads the initial system file into RAM. For DOS, it isBoot record loads the initial system file into RAM. For DOS, it isIO.SYS .IO.SYS .► The initial file, IO.SYS includes a file called SYSINIT which loads theThe initial file, IO.SYS includes a file called SYSINIT which loads theremaining OS into the RAM.remaining OS into the RAM.► SYSINIT loads a system file MSDOS.SYS that knows how to work withSYSINIT loads a system file MSDOS.SYS that knows how to work withBIOS.BIOS.► One of the first OS files that is loaded is the system configuration file,One of the first OS files that is loaded is the system configuration file,CONFIG.SYS in case of DOS. Information in the configuration file tellsCONFIG.SYS in case of DOS. Information in the configuration file tellsloading program which OS files need to be loaded (e.g. drivers)loading program which OS files need to be loaded (e.g. drivers)► Another special file that is loaded is one which tells what specificAnother special file that is loaded is one which tells what specificapplications or commands user wants to be performed as part ofapplications or commands user wants to be performed as part ofbooting process. In DOS, it is AUTOEXEC.BAT. In Windows, it’sbooting process. In DOS, it is AUTOEXEC.BAT. In Windows, it’sWIN.INI .WIN.INI .
  • Course PresentationReferencesReferences►Operating System Principles – Silberchatz,Operating System Principles – Silberchatz,Galvin and Gagne.Galvin and Gagne.► http://en.wikipedia.org/wiki/Bootinghttp://en.wikipedia.org/wiki/Booting► http://computer.howstuffworks.com/bios2.htmhttp://computer.howstuffworks.com/bios2.htm
  • Course PresentationQuestionsQuestions► What is the effect on boot sector and boot loader when you install twoWhat is the effect on boot sector and boot loader when you install twoOS, for e.g. Windows and Linux in two separate partitions ?OS, for e.g. Windows and Linux in two separate partitions ?► Suppose, you install Windows first. The default boot loader installed inSuppose, you install Windows first. The default boot loader installed inMBR is NTLDR and contains information regarding the active partitionMBR is NTLDR and contains information regarding the active partitionof Windows. When you install Linux on this system, the installationof Windows. When you install Linux on this system, the installationprompts to overwrite a new secondary boot loader which identifies bothprompts to overwrite a new secondary boot loader which identifies bothWindows and Linux active partitions and therefore we get a choice ofWindows and Linux active partitions and therefore we get a choice ofbooting the desired OS when the system is started.booting the desired OS when the system is started.In contrast, if Linux is installed first and then Windows, theIn contrast, if Linux is installed first and then Windows, theWindows Installer overwrites the MBR with its own boot loader whichWindows Installer overwrites the MBR with its own boot loader whichdoesn’t recognize the Linux active partition. This creates a problem.doesn’t recognize the Linux active partition. This creates a problem.The problem can be corrected by using a LiveCD or any bootable discThe problem can be corrected by using a LiveCD or any bootable discwhich can be used to reinstall a secondary boot loader which identifieswhich can be used to reinstall a secondary boot loader which identifiesboth the OS and gives true choice.both the OS and gives true choice.
  • Course PresentationQuestionsQuestions► (1) Why is ROM slower than RAM ?(1) Why is ROM slower than RAM ?(2) How is the boot loader copied from ROM to RAM ?(2) How is the boot loader copied from ROM to RAM ?► (1)(1) Semi-conductor Technology used in constructing theseSemi-conductor Technology used in constructing thesetwo type of memories gives the answer. RAM is based ontwo type of memories gives the answer. RAM is based onpositive feedback/capacitive charge for storing thepositive feedback/capacitive charge for storing theinformation while ROM contains permanent and non-information while ROM contains permanent and non-changeable information stored in its structure.changeable information stored in its structure.(2) There is a small routine loaded by the BIOS which does(2) There is a small routine loaded by the BIOS which doesthis task. This routine could also be part of BIOS (thoughthis task. This routine could also be part of BIOS (thoughnot sure).not sure).
  • Course PresentationQuestionsQuestions► Examples of Applications that access the BIOSExamples of Applications that access the BIOSdirectly.directly.► Windows Server 2003 SP1 versions of theWindows Server 2003 SP1 versions of theWindows Preinstallation Environment (WinPE) -Windows Preinstallation Environment (WinPE) -http://www.microsoft.com/technet/prodtechnol/windowhttp://www.microsoft.com/technet/prodtechnol/window► The operating system and application programsThe operating system and application programsboth directly access BIOS routines to provideboth directly access BIOS routines to providebetter compatibility for such functions as screenbetter compatibility for such functions as screendisplay.display.
  • Course PresentationQuestionsQuestions► If I have only a single OS, is there a secondary boot loaderIf I have only a single OS, is there a secondary boot loaderpresent on the system ?present on the system ?► Older machines might not have this feature. But now-a-Older machines might not have this feature. But now-a-days, even Windows is installed with a default secondarydays, even Windows is installed with a default secondaryboot loader (NTLDR). Linux is also installed usually withboot loader (NTLDR). Linux is also installed usually withLILO or GRUB as the default boot loader.LILO or GRUB as the default boot loader.You might have also encountered that your systemYou might have also encountered that your system(Windows) is not able to boot after flashing the BIOS and is(Windows) is not able to boot after flashing the BIOS and isdisplaying the message “NTLDR missing”. This is becausedisplaying the message “NTLDR missing”. This is becausethe primary boot loader transfer to NTLDR which mightthe primary boot loader transfer to NTLDR which mighthave become corrupt or deleted by mistake.have become corrupt or deleted by mistake.
  • Course PresentationQuestionsQuestions► Difference between Boot Loader and BootDifference between Boot Loader and BootManager ?Manager ?► Basically, these two are different but areBasically, these two are different but aresometimes combined into a single program.sometimes combined into a single program.► IBMs Boot Manager, PowerQuests BootMagicIBMs Boot Manager, PowerQuests BootMagicand V Communications System Commander areand V Communications System Commander aresome examples of boot managers.some examples of boot managers.► Dual bootingDual booting is the act of installing multipleis the act of installing multipleoperating systemsoperating systems on aon a computercomputer, and being able, and being ableto choose which one toto choose which one to bootboot when switching onwhen switching onthe computer. The program, which makes dualthe computer. The program, which makes dualbooting possible is called abooting possible is called a boot loaderboot loader..
  • Course PresentationInformationInformation► Dual BootDual Boot► In theIn the OS/2OS/2 world, the termworld, the term dual bootdual boot has a more specific meaning.has a more specific meaning.► In aIn a dual bootdual boot installation, two (or more)installation, two (or more) operating systemsoperating systems areareinstalled in ainstalled in a singlesingle partitionpartition. Selection of which operating system to. Selection of which operating system toboot is performed by running aboot is performed by running a dual bootdual boot utility program, whichutility program, whichswitches around the necessaryswitches around the necessary boot loadersboot loaders programs (by renamingprograms (by renamingfiles and copyingfiles and copying boot sectorsboot sectors) to ensure that the chosen operating) to ensure that the chosen operatingsystem is loaded at the next boot.system is loaded at the next boot.► In aIn a boot managerboot manager installation, by contrast, the two (or more)installation, by contrast, the two (or more)operating systemsoperating systems are installed in their own, separate, individual,are installed in their own, separate, individual,partitionspartitions. Rather than booting directly into an operating system, the. Rather than booting directly into an operating system, themachine boots into a specialised,machine boots into a specialised, operating systemoperating system neutral,neutral,boot loaderboot loader program (such as IBMs eponymousprogram (such as IBMs eponymous Boot ManagerBoot Manager))installed on a floppy disk or in its own partition on a hard disk. Thisinstalled on a floppy disk or in its own partition on a hard disk. Thisboot loader program presents a list of the available bootable partitionsboot loader program presents a list of the available bootable partitionsfrom which the user can choose, and then loads and invokes the bootfrom which the user can choose, and then loads and invokes the bootloader in the boot sector of the chosen partition, to boot the chosenloader in the boot sector of the chosen partition, to boot the chosenoperating system.operating system.
  • Course PresentationInformationInformation► When installing an OS on a computer from scratch, here is how the partitionWhen installing an OS on a computer from scratch, here is how the partitiontable is created.table is created.► The hard disk is denoted as “hda” where hd=hard disk, and the third letterThe hard disk is denoted as “hda” where hd=hard disk, and the third lettercould mean the hard-disk on the system. For e.g. the first hard disk is “hda”,could mean the hard-disk on the system. For e.g. the first hard disk is “hda”,the second is “hdb”.the second is “hdb”.► When the partitioning is done, “hda0” is the place of MBR. “hda1” is the primaryWhen the partitioning is done, “hda0” is the place of MBR. “hda1” is the primarypartition. Then a secondary partition may be created which is further subdividedpartition. Then a secondary partition may be created which is further subdividedinto logical drives. Another OS could be installed on any of these logical drives.into logical drives. Another OS could be installed on any of these logical drives.► hda0 – MBRhda0 – MBRhda1 – Primary Partition e.g. Windows XPhda1 – Primary Partition e.g. Windows XPhda2 – Secondary Partitionhda2 – Secondary Partitionhda3 – Logical Drive 1 (FAT32 or NTFS partition)hda3 – Logical Drive 1 (FAT32 or NTFS partition)hda4 – Logical Drive 2 (FAT32 or NTFS partition)hda4 – Logical Drive 2 (FAT32 or NTFS partition)hda5 – Logical Drive 3 (Swap for Linux Partition)hda5 – Logical Drive 3 (Swap for Linux Partition)hda6 – Logical Drive 4 (Root for Linux Partition)hda6 – Logical Drive 4 (Root for Linux Partition)The above example is a simple example. Specific cases can be different.The above example is a simple example. Specific cases can be different.
  • Course PresentationInformationInformation► When the kernel is being loaded, the control is inWhen the kernel is being loaded, the control is inthe privileged mode. If the user is allowed to loginthe privileged mode. If the user is allowed to loginin the same mode, any user will be “root” orin the same mode, any user will be “root” or“administrator” (super-user). When the booting is“administrator” (super-user). When the booting isalmost complete, which is with the privileged right.almost complete, which is with the privileged right.But this login program, after verifying yourBut this login program, after verifying yourpassword, gives you a shell by creating anotherpassword, gives you a shell by creating anotherprocess which intentionally drops the super-userprocess which intentionally drops the super-userprivileges and assume the privileges of this user.privileges and assume the privileges of this user.Login program is trusted by the kernel. If that isLogin program is trusted by the kernel. If that ishacked or replaced, you can get a root shell fromhacked or replaced, you can get a root shell fromany login.any login.