SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
Understanding the PC Boot Process
  How Linux and Windows start their day


           By Dominique Gerald Cimafranca
              dominique.cimafranca@gmail.com




   This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this
   license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street,
   Suite 300, San Francisco, California, 94105, USA.
The PC boot process in a nutshell
1. Executes code from well-known location.
2. Execute first-stage boot loader from MBR.
3. Execute second-stage boot loader.
4. Load the kernel.
5. Load the first user space program.
BIOS
●   BIOS – Basic Input/Output System
●   Located at memory location 0xFFFF0
●   Boot firmware designed to be run at startup
●   POST – Power-on Self-Test
    ●   Identifies, tests, and initializes system devices
●   Run-time services
    ●   Initial configuration
    ●   Selects which device to boot from
●   Alternatively, Extensible Firmware Interface (EFI)
Stage 1 Boot Loader: MBR
●   MBR – Master Boot Record
●   Located on first sector of the boot disk
●   Size: 512 bytes
●   BIOS loads MBR to RAM, relinquishes control
●   Main job: load the second-stage boot loader
Anatomy of the MBR
●   First 446 bytes
    ●   Primary boot loader
    ●   Code and error messages
●   Next 64 bytes
    ●   Partition information
●   Last 2 bytes
    ●   Magic number
    ●   Validation check for MBR



                                   Image from http://www.ibm.com/developerworks/linux/library/l-linuxboot/
Stage 2 Boot Loader
●   Loads the kernel
●   On Linux:
    ●   GRUB – Grand Universal Bootloader
    ●   LILO – Linux Loader
    ●   Others: SysLinux, ISOLinux, PXELinux
●   From Windows NT to Windows XP:
    ●   NTLDR
●   On Windows Vista:
    ●   Windows Boot Manager
A closer look at GRUB
●   GRUB understands ext2 and ext3 file systems
    ●   LILO had to load raw sectors from the hard disk
●   GRUB displays a list of available kernels
    ●   On Ubuntu, defined in /boot/grub/menu.lst
●   More info: http://www.gnu.org/software/grub/
What does GRUB load?
title       Ubuntu 9.04, kernel 2.6.28­13­generic
uuid        0ef7b971
kernel      /boot/vmlinuz­2.6.28­13­generic root=UUID=0ef7b971 ro quiet splash 
initrd      /boot/initrd.img­2.6.28­13­generic



 ●   kernel – a compressed kernel image
     ●   Performs initial minimal hardware setup
     ●   Decompresses the kernel image, puts it in memory
     ●   If present, loads RAM disk (see below)
 ●   initrd – initial RAM disk
     ●   Temporary root file system
     ●   Contains executables and drivers to load the real root
Execution in the kernel
●   arch/i386/boot/head.S
    ●   performs basic hardware setup
    ●   calls startup_32() of ./arch/i386/boot/compressed/head.S
●   arch/i386/boot/compressed/head.S
    ●   set up the basic environment
    ●   clear Block Started by Symbol
    ●   calls decompress_kernel() found in ./arch/i386/boot/compressed/misc.c
    ●   calls startup_32 in ./arch/i386/kernel/head.S
●   arch/i386/kernel/head.S
    ●   also called swapper or process 0
    ●   initializes page tables and enables memory paging
    ●   detects CPU type
●   init/main.c
    ●   calls start_kernel()
    ●   calls kernel_thread to start init (process ID 1)
initrd
●   Initial RAM disk – a small temporary file system
●   During stage 2 boot, initrd is copied into RAM
    and mounted
●   Allows the kernel to fully boot without having to
    mount any physical disks
●   Supports many hardware configurations
    through loadable modules
●   After kernel is booted, the real root file system
    is mounted
init
●   The first user space program -- /sbin/init
●   Typical for desktop Linux systems
●   For Ubuntu, init reads /etc/event.d
    ●   see https://launchpad.net/upstart/
    ●   default run level defined at /etc/event.d/rc-default
    ●   for normal start, Ubuntu is at run level 2
    ●   executes programs from /etc/rc2.d
●   For other Linux systems, init reads /etc/inittab
What about Windows XP?
●   Boot Loader Phase
●   Kernel loading phase
●   Session Manager
●   Winlogon
Windows XP and earlier
●   NTLDR – the actual boot loader
●   boot.ini – booting options
    ●   presents menu options as to what OS to load
    ●   if absent, defaults to Windows directory of first
        partition
What NTLDR does
●   Accesses the file system on boot drive
●   Looks for hiberfil.sys, the hibernation image
●   Reads boot.ini and prompts the user
●   Runs NTDETECT.COM
●   Starts NTOSKRNL.EXE
NTOSKRNL.EXE
●   Kernel image of Windows NT family
●   Contains
    ●   Cache Manager
    ●   Executive
    ●   Kernel
    ●   Security Reference Monitor
    ●   Memory Manager
    ●   Scheduler
●   Also known as:
    ●   NTOSKRNL.EXE : 1 CPU
    ●   NTKRNLMP.EXE : N CPU SMP
    ●   NTKRNLPA.EXE : 1 CPU, PAE
    ●   NTKRPAMP.EXE : N CPU SMP, PAE
Kernel Loading Phase
●   HAL.DLL -- type of hardware abstraction layer
●   KDCOM.DLL -- Kernel Debugger HW Extension
    DLL
●   BOOTVID.DLL -- for the windows logo and
    side-scrolling bar
●   configsystem registry
Session Manager
●   SMSS.EXE
●   What it does:
    ●   Creates environment variables
    ●   Starts the kernel and user modes of the Win32 subsystem
        –   win32k.sys (kernel-mode)
        –   winsrv.dll (user-mode)
        –   csrss.exe (user-mode)
●   Creates DOS device mappings listed at the
    HKLMSystemCurrentControlSetControlSession
    ManagerDOS Devices registry key.
●   Creates virtual memory paging files.
●   Starts winlogon.exe, the Windows logon manager
Windows Logon
●   Winlogon starts the Local Security Authority
    Subsystem Service (LSASS) and Service
    Control Manager (SCM)
●   Also responsible for responding to the secure
    attention sequence (SAS), loading the user
    profile on logon, and optionally locking the
    computer when a screensaver is running.
What about Windows Vista?
●   Windows Boot Manager (bootmgr)
●   Boot Configuration Data
    ●   replacing boot.ini
    ●   found in BootBcd
●   winload.exe
    ●   operating system boot loader
●   NTOSKRNL.EXE and device drivers
Sources
●   “Inside the Linux Boot Process”, M. Tim Jones, IBM Developerworks
    ●   http://www.ibm.com/developerworks/linux/library/l-linuxboot/
●   “Linux initial RAM disk overview”, M. Tim Jones, IBM Developerworks
    ●   http://www.ibm.com/developerworks/linux/library/l-initrd.html
●   Windows NT Startup Process
    ●   http://en.wikipedia.org/wiki/Windows_NT_Startup_Process
●   Windows Vista Startup Process
    ●   http://en.wikipedia.org/wiki/Windows_Vista_startup_process
    ●   http://www.microsoft.com/whdc/system/platform/firmware/bcd.mspx

Weitere ähnliche Inhalte

Was ist angesagt?

System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overviewRajKumar Rampelli
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013Wave Digitech
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loaderiamumr
 
Booting and Start-up Sequence
Booting and Start-up SequenceBooting and Start-up Sequence
Booting and Start-up SequenceTrinity Dwarka
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Operating system components
Operating system componentsOperating system components
Operating system componentsSyed Zaid Irshad
 
booting steps of a computer
booting steps of a computerbooting steps of a computer
booting steps of a computerAnusha Babooa
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linuxVandana Salve
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System AdministrationSreenatha Reddy K R
 

Was ist angesagt? (20)

Linux boot process
Linux boot processLinux boot process
Linux boot process
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Booting
BootingBooting
Booting
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loader
 
Booting and Start-up Sequence
Booting and Start-up SequenceBooting and Start-up Sequence
Booting and Start-up Sequence
 
Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Operating system components
Operating system componentsOperating system components
Operating system components
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
booting steps of a computer
booting steps of a computerbooting steps of a computer
booting steps of a computer
 
Board support package_on_linux
Board support package_on_linuxBoard support package_on_linux
Board support package_on_linux
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 

Andere mochten auch (12)

Booting & shut down,
Booting & shut down,Booting & shut down,
Booting & shut down,
 
Memory management
Memory managementMemory management
Memory management
 
Spring Boot with Quartz
Spring Boot with QuartzSpring Boot with Quartz
Spring Boot with Quartz
 
Operating systems
Operating systemsOperating systems
Operating systems
 
5. boot process
5. boot process5. boot process
5. boot process
 
Registers
RegistersRegisters
Registers
 
Docker allocating resources
Docker allocating resourcesDocker allocating resources
Docker allocating resources
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
Kernel I/O subsystem
Kernel I/O subsystemKernel I/O subsystem
Kernel I/O subsystem
 
Cpu registers
Cpu registersCpu registers
Cpu registers
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
File organization
File organizationFile organization
File organization
 

Ähnlich wie Understanding The Boot Process

Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut iiplarsen67
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloadingArpita Gupta
 
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theoryEmbedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theoryEmbeddedFest
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explainedLinuxConcept
 
Kernel entrance to-geek-
Kernel entrance to-geek-Kernel entrance to-geek-
Kernel entrance to-geek-mao999
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting ProcessMike Wang
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessHardeep Bhurji
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting ProcessGaurav Sharma
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Peter Martin
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first secondAlison Chaiken
 
The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)plarsen67
 

Ähnlich wie Understanding The Boot Process (20)

Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theoryEmbedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
Embedded Fest 2019. Руслан Биловол. Linux Boot: The Big Bang theory
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explained
 
Kernel entrance to-geek-
Kernel entrance to-geek-Kernel entrance to-geek-
Kernel entrance to-geek-
 
Grub2 Booting Process
Grub2 Booting ProcessGrub2 Booting Process
Grub2 Booting Process
 
Linux kernel booting
Linux kernel bootingLinux kernel booting
Linux kernel booting
 
An Insight into the Linux Booting Process
An Insight into the Linux Booting ProcessAn Insight into the Linux Booting Process
An Insight into the Linux Booting Process
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)Basis Linux (aan de hand van LPIC-1)
Basis Linux (aan de hand van LPIC-1)
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Ch04
Ch04Ch04
Ch04
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)The ABC of Linux (Linux for Beginners)
The ABC of Linux (Linux for Beginners)
 

Mehr von Dominique Cimafranca (18)

Welcome Address - CS Cluster Orientation
Welcome Address - CS Cluster OrientationWelcome Address - CS Cluster Orientation
Welcome Address - CS Cluster Orientation
 
Story a meditation
Story a meditationStory a meditation
Story a meditation
 
Video Games as Culture and Experience
Video Games as Culture and ExperienceVideo Games as Culture and Experience
Video Games as Culture and Experience
 
Privacy and how the Internet works
Privacy and how the Internet works Privacy and how the Internet works
Privacy and how the Internet works
 
Why you can't write filipino science fiction
Why you can't write filipino science fictionWhy you can't write filipino science fiction
Why you can't write filipino science fiction
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
Thesis proposal checklist
Thesis proposal checklistThesis proposal checklist
Thesis proposal checklist
 
FOSS and social development
FOSS and social developmentFOSS and social development
FOSS and social development
 
Metadata 101
Metadata 101Metadata 101
Metadata 101
 
Creative nonfiction
Creative nonfictionCreative nonfiction
Creative nonfiction
 
Speculative Fiction
Speculative FictionSpeculative Fiction
Speculative Fiction
 
Online Literature
Online LiteratureOnline Literature
Online Literature
 
Writing Short Fiction
Writing Short FictionWriting Short Fiction
Writing Short Fiction
 
Teaching Open Source In The University
Teaching Open Source In The UniversityTeaching Open Source In The University
Teaching Open Source In The University
 
Poetry
PoetryPoetry
Poetry
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Ubuntu For Intranet Services
Ubuntu For Intranet ServicesUbuntu For Intranet Services
Ubuntu For Intranet Services
 
Open Source In Education
Open Source In EducationOpen Source In Education
Open Source In Education
 

Kürzlich hochgeladen

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Kürzlich hochgeladen (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

Understanding The Boot Process

  • 1. Understanding the PC Boot Process How Linux and Windows start their day By Dominique Gerald Cimafranca dominique.cimafranca@gmail.com This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Philippines License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ph/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
  • 2. The PC boot process in a nutshell 1. Executes code from well-known location. 2. Execute first-stage boot loader from MBR. 3. Execute second-stage boot loader. 4. Load the kernel. 5. Load the first user space program.
  • 3. BIOS ● BIOS – Basic Input/Output System ● Located at memory location 0xFFFF0 ● Boot firmware designed to be run at startup ● POST – Power-on Self-Test ● Identifies, tests, and initializes system devices ● Run-time services ● Initial configuration ● Selects which device to boot from ● Alternatively, Extensible Firmware Interface (EFI)
  • 4. Stage 1 Boot Loader: MBR ● MBR – Master Boot Record ● Located on first sector of the boot disk ● Size: 512 bytes ● BIOS loads MBR to RAM, relinquishes control ● Main job: load the second-stage boot loader
  • 5. Anatomy of the MBR ● First 446 bytes ● Primary boot loader ● Code and error messages ● Next 64 bytes ● Partition information ● Last 2 bytes ● Magic number ● Validation check for MBR Image from http://www.ibm.com/developerworks/linux/library/l-linuxboot/
  • 6. Stage 2 Boot Loader ● Loads the kernel ● On Linux: ● GRUB – Grand Universal Bootloader ● LILO – Linux Loader ● Others: SysLinux, ISOLinux, PXELinux ● From Windows NT to Windows XP: ● NTLDR ● On Windows Vista: ● Windows Boot Manager
  • 7. A closer look at GRUB ● GRUB understands ext2 and ext3 file systems ● LILO had to load raw sectors from the hard disk ● GRUB displays a list of available kernels ● On Ubuntu, defined in /boot/grub/menu.lst ● More info: http://www.gnu.org/software/grub/
  • 8. What does GRUB load? title Ubuntu 9.04, kernel 2.6.28­13­generic uuid 0ef7b971 kernel /boot/vmlinuz­2.6.28­13­generic root=UUID=0ef7b971 ro quiet splash  initrd /boot/initrd.img­2.6.28­13­generic ● kernel – a compressed kernel image ● Performs initial minimal hardware setup ● Decompresses the kernel image, puts it in memory ● If present, loads RAM disk (see below) ● initrd – initial RAM disk ● Temporary root file system ● Contains executables and drivers to load the real root
  • 9. Execution in the kernel ● arch/i386/boot/head.S ● performs basic hardware setup ● calls startup_32() of ./arch/i386/boot/compressed/head.S ● arch/i386/boot/compressed/head.S ● set up the basic environment ● clear Block Started by Symbol ● calls decompress_kernel() found in ./arch/i386/boot/compressed/misc.c ● calls startup_32 in ./arch/i386/kernel/head.S ● arch/i386/kernel/head.S ● also called swapper or process 0 ● initializes page tables and enables memory paging ● detects CPU type ● init/main.c ● calls start_kernel() ● calls kernel_thread to start init (process ID 1)
  • 10. initrd ● Initial RAM disk – a small temporary file system ● During stage 2 boot, initrd is copied into RAM and mounted ● Allows the kernel to fully boot without having to mount any physical disks ● Supports many hardware configurations through loadable modules ● After kernel is booted, the real root file system is mounted
  • 11. init ● The first user space program -- /sbin/init ● Typical for desktop Linux systems ● For Ubuntu, init reads /etc/event.d ● see https://launchpad.net/upstart/ ● default run level defined at /etc/event.d/rc-default ● for normal start, Ubuntu is at run level 2 ● executes programs from /etc/rc2.d ● For other Linux systems, init reads /etc/inittab
  • 12. What about Windows XP? ● Boot Loader Phase ● Kernel loading phase ● Session Manager ● Winlogon
  • 13. Windows XP and earlier ● NTLDR – the actual boot loader ● boot.ini – booting options ● presents menu options as to what OS to load ● if absent, defaults to Windows directory of first partition
  • 14. What NTLDR does ● Accesses the file system on boot drive ● Looks for hiberfil.sys, the hibernation image ● Reads boot.ini and prompts the user ● Runs NTDETECT.COM ● Starts NTOSKRNL.EXE
  • 15. NTOSKRNL.EXE ● Kernel image of Windows NT family ● Contains ● Cache Manager ● Executive ● Kernel ● Security Reference Monitor ● Memory Manager ● Scheduler ● Also known as: ● NTOSKRNL.EXE : 1 CPU ● NTKRNLMP.EXE : N CPU SMP ● NTKRNLPA.EXE : 1 CPU, PAE ● NTKRPAMP.EXE : N CPU SMP, PAE
  • 16. Kernel Loading Phase ● HAL.DLL -- type of hardware abstraction layer ● KDCOM.DLL -- Kernel Debugger HW Extension DLL ● BOOTVID.DLL -- for the windows logo and side-scrolling bar ● configsystem registry
  • 17. Session Manager ● SMSS.EXE ● What it does: ● Creates environment variables ● Starts the kernel and user modes of the Win32 subsystem – win32k.sys (kernel-mode) – winsrv.dll (user-mode) – csrss.exe (user-mode) ● Creates DOS device mappings listed at the HKLMSystemCurrentControlSetControlSession ManagerDOS Devices registry key. ● Creates virtual memory paging files. ● Starts winlogon.exe, the Windows logon manager
  • 18. Windows Logon ● Winlogon starts the Local Security Authority Subsystem Service (LSASS) and Service Control Manager (SCM) ● Also responsible for responding to the secure attention sequence (SAS), loading the user profile on logon, and optionally locking the computer when a screensaver is running.
  • 19. What about Windows Vista? ● Windows Boot Manager (bootmgr) ● Boot Configuration Data ● replacing boot.ini ● found in BootBcd ● winload.exe ● operating system boot loader ● NTOSKRNL.EXE and device drivers
  • 20. Sources ● “Inside the Linux Boot Process”, M. Tim Jones, IBM Developerworks ● http://www.ibm.com/developerworks/linux/library/l-linuxboot/ ● “Linux initial RAM disk overview”, M. Tim Jones, IBM Developerworks ● http://www.ibm.com/developerworks/linux/library/l-initrd.html ● Windows NT Startup Process ● http://en.wikipedia.org/wiki/Windows_NT_Startup_Process ● Windows Vista Startup Process ● http://en.wikipedia.org/wiki/Windows_Vista_startup_process ● http://www.microsoft.com/whdc/system/platform/firmware/bcd.mspx