Advanced x86: BIOS and System Management Mode Internals Boot Process Xeno Kovah && Corey Kallenberg LegbaCore, LLC.

Slides:



Advertisements
Similar presentations
BIOS Data for OS Booting Outline Necessary Data for OS Booting System Information APM OS ACPI OS DOS Service Routines Conclusions.
Advertisements

Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
9.0 EMBEDDED SOFTWARE DEVELOPMENT TOOLS 9.1 Introduction Application programs are typically developed, compiled, and run on host system Embedded programs.
Computer Organization and Architecture
Basic Input Output System
PC Architecture Fundamentals
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Wednesday, June 07, 2006 “Unix is user friendly … it’s just picky about it’s friends”. - Anonymous.
EET 450 Chapter 2 – How hardware and Software Work Together.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Chapter 4 Computer Memory
WANs and Routers Routers. Router Description Specialized computer Like a general purpose PC, a router has:  CPU  Memory  System Bus Connecting Internal.
INTRODUCTION TO MICROCONTROLLER. What is a Microcontroller A microcontroller is a complete microprocessor system, consisting of microprocessor, limited.
NET+OS 6.1 Training. BSP NET+OS 6.1 BSP Initialization Memory map New features Debugging Porting Issues.
POST code Sephiroth Kwon GRMA Overview What is POST Code Appendix: –AMI Bios Code Definition –Phoenix Bios Code Definition.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Computer Organization
Host and Application Security Lesson 4: The Win32 Boot Process.
hardware and operating systems basics.
Chapter 5 Basic Input/Output System (BIOS)
Basic Input Output System
Interrupts  Interrupt is a process where an external device can get the attention of the microprocessor.  The process starts from the I/O device  The.
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
2006 Chapter-1 L3: "Embedded Systems - Architecture, Programming and Design", Raj Kamal, Publs.: McGraw-Hill, Inc. 1 Hardware Elements in the Embedded.
Laface Operating System Design Booting a PC to run a kernel from Low memory VGA display.
Hardware Boot Sequence. Vocabulary BIOS = Basic Input Output System UEFI = Unified Extensible Firmware Interface POST= Power On Self Test BR = Boot Record.
Making MINT64OS Chan Seok Kang 2013/01/21. 2Computer Systems and Platforms Lab Content Introduction My Approach Encountered Problem Conclusion & Future.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Basic Input/Output System (BIOS). 5.1Introduction to BIOS Basic Input / Output System (BIOS) boot the computer by providing a basic set of instructions.
Advanced x86: BIOS and System Management Mode Internals SPI Flash Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Input/Output
Advanced x86: BIOS and System Management Mode Internals Conclusion Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
1.4 Hardware Review. CPU  Fetch-decode-execute cycle 1. Fetch 2. Bump PC 3. Decode 4. Determine operand addr (if necessary) 5. Fetch operand from memory.
Advanced x86: BIOS and System Management Mode Internals System Management Mode (SMM) Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Introduction
Advanced x86: BIOS and System Management Mode Internals SPI Flash Protection Mechanisms Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Memory Map Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Xeno Kovah && Corey Kallenberg
Advanced x86: BIOS and System Management Mode Internals Flash Descriptor Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Xeno Kovah && Corey Kallenberg
June 16, 2002 SPC Tutorial 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS A Smart Port Card (SPC and SPC-II) Tutorial --- Hardware John DeHart Washington.
Advanced x86: BIOS and System Management Mode Internals SMM & Caching Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
10. Epilogue ENGI 3655 Lab Sessions.  We took control of the computer as early as possible, right after the end of the BIOS  Our multi-stage bootloader.
Computer Maintenance I
Lesson 2 Component Overview Core Hardware Fundamentals.
January 8, 2001 SPC Tutorial 1 Washington WASHINGTON UNIVERSITY IN ST LOUIS Agenda 9:00 SPC Hardware -- John DeHart 9:45 SPC Software -- John DeHart 10:30.
Advanced x86: BIOS and System Management Mode Internals SMI Suppression Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Developing a minimal kernel with testing environment Starting Point Goals Development Results Hüseyin Uslu.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
FIGURE 4.1 SOC System Overview.. FIGURE 4.2 Memory Map Representation for an Intel Platform.
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or enhance.
Homework Reading Machine Projects Labs
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or.
Interfacing with Hardware
Homework Reading Machine Projects Labs
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS)
UNIT – Microcontroller.
Introduction to Microprocessors and Microcontrollers
Xeno Kovah && Corey Kallenberg LegbaCore, LLC
9.0 EMBEDDED SOFTWARE DEVELOPMENT TOOLS
Today’s agenda Hardware architecture and runtime system
BIOS Chapter 6.
Presentation transcript:

Advanced x86: BIOS and System Management Mode Internals Boot Process Xeno Kovah && Corey Kallenberg LegbaCore, LLC

All materials are licensed under a Creative Commons “Share Alike” license. 2 Attribution condition: You must indicate that derivative work "Is derived from John Butterworth & Xeno Kovah’s ’Advanced Intel x86: BIOS and SMM’ class posted at

This covers an example of a minimal BIOS boot process, just to give an idea of what the BIOS does before your operating system starts to load. It doesn’t include everything of course because it’s geared towards minimal- configuration to achieve 100% functionality. 3

Boot Process at a glance* *This list composed from Intel Minimal Architecture Boot Loader 1.Power-up 1.16-bit Real Mode accessing address FFFF_FFF0h 2.Operating mode selection 1.Flat protected mode 3.Preparation for memory initialization 1.CPU microcode update 2.Set up CPU Cache as RAM (CAR) 3.Chipset initialization (MCHBAR, PCIEXBAR, etc.) 4.Memory initialization 1.Configure the memory controller 5.Post memory initialization 1.Memory test 2.Copy firmware from flash to memory for faster execution* 1.In the doc this is listed as firmware shadowing but I’m modifying it somewhat since the BIOS can perform the copying of flash components to memory 2.As a general rule, it’s better to copy things to memory before execution as soon as possible 3.Memory transaction redirection (PAM registers) 4.Setting up the stack (before memory initialization, stack will be in CPU cache) 5.Transfer to DRAM (the BIOS flash that was copied to memory is now executed) 4

Boot Process at a glance* *This list composed from Intel Minimal Architecture Boot Loader 6.Miscellaneous platform enabling 1.Platform dependent: Initialize clocks to operate at N Hz, configure general- purpose I/O, etc. 7.Interrupt enabling - PIC (Programmable Interrupt Controller), LAPIC (Local Advanced PIC), I/O APIC, etc. 8.Interrupt tables 1.Interrupt Vector Table (IVT) 1.Interrupt Service Routine (ISR) – INT 10h, etc… 2.Interrupt Descriptor Table (IDT) 1.Exceptions 9.Setting up timers 1.In ICH: RTC (, HPET, 8254 Programmable Interrupt Timer (PIT), TCO timer (used as watchdog) 2.In CPU: LAPIC timer 10.Memory caching control 11.Processor discovery and initialization 1.CPUID 2.Startup Inter-Processor Interrupts (SIPIs) are written to a processor’s LAPIC telling it to wake up and where to start executing code at (must be a 4KB aligned boundary) 1.Intel SW Programmer’s Guide has more detail on this 3.Each processor will awaken in Real Mode 5

Boot Process at a glance* *This list composed from Intel Minimal Architecture Boot Loader 12.I/O devices 1.Super I/O can control PS/2 keyboard, serial, parallel, etc. interfaces 13.PCI device discovery 1.Enumerate PCI devices 2.Assign address space (port IO, Memory Mapped IO) 3.Detect and execute Expansion ROMs (XROMs) 14.Memory map 1.Region types 1.Memory 2.Reserved 3.ACPI Reclaim 4.ACPI NVS 5.ROM 6.IOAPIC 7.LAPIC 2.Region locations 1.Consult your datasheet for a complete list, but we’ll cover some of the more relevant ones 15.Non-Volatile (NV) storage 1.CMOS 2.NV SPI flash 16.Handoff to boot-loader 6

Only 16 steps? BIOS is simple! *This list composed from Intel Minimal Architecture Boot Loader Easy to summarize, not so easy to implement Very complex implementations Even if it’s only a couple MB, it’s a very DENSE couple of MB That list taken from the Intel Minimal Architecture Boot Loader which provides a pretty good list of functional requirements What is left out is: –Initializing SMM and locking down SMRAM –Locking down the BIOS Flash 7

How do you learn about all that stuff? You could go review open source BIOSes’ code (CoreBoot or UEFI’s TianoCore reference code) Or you can sign an NDA with Intel and read their very large “BIOS Writer’s Guide” and associated documentation for each CPU/chipset At the end of the day, the open source code is more or less just doing what they’re told to do by the Intel documentation 8