MSI MSI Micro-Star International.

Slides:



Advertisements
Similar presentations
Note: Third Party Brands and Trademarks are Property of Their Respective Owners. ACPI Overview.
Advertisements

System Integration and Performance
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Computer System Overview
Computer Organization and Architecture
Chapter 6 Limited Direct Execution
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Introduction to Kernel
1 Computer System Overview OS-1 Course AA
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CSCE 351: Operating System Kernels
OS Spring’03 Introduction Operating Systems Spring 2003.
Computer System Overview
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Computer Organization
Introduction to Embedded Systems
Protection and the Kernel: Mode, Space, and Context.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Device Drivers CPU I/O Interface Device Driver DEVICECONTROL OPERATIONSDATA TRANSFER OPERATIONS Disk Seek to Sector, Track, Cyl. Seek Home Position.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
Advanced x86: BIOS and System Management Mode Internals Boot Process Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Lecture 1: Review of Computer Organization
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Linux kernel TLV meetup, Kfir Gollan. What is hardware probing? Different approaches for detecting hardware Probing in the linux kernel.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Evaluation of Advanced Power Management for ClassCloud based on DRBL Rider Grid Technology Division National Center for High-Performance Computing Research.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Introduction to Operating Systems Concepts
Introduction to Kernel
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Processes and threads.
Process concept.
Operating Systems CMPSC 473
Computer Organization And Assembly Language
Computer System Overview
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Mr. M. D. Jamadar Assistant Professor
Presentation transcript:

MSI MSI Micro-Star International

Advanced Configuration and Power Interface ACPI Advanced Configuration and Power Interface Reporter :Wequalwu

Contents ACPI Overview ASL (ACPI Source Language) ACPI Implementer in AWARD BIOS

History of Power Management SL technology - 1989 First seen on the 386SL and still included in all of today’s Pentium and Pentium II processors Operating system had no idea of what the power management BIOS was up to. Advanced Power Management - 1991 Intel & Microsoft co-developed OS and power management BIOS could now talk to each other No cooperation among system components Add-on components do not participate in power management ACPI (Advanced Configuration and Power Interface) - 1997 Intel, Toshiba and Microsoft Open industry, all encompassing, PC hardware, operating system and peripheral device interface specifications Primary goal is to let O.S. manage all power activity

ACPI Introduction 1. industry common interfaces 2. The key element in Operating System-directed configuration and Power Management (OSPM). 3. stretch the limits of current Plug and Play interfaces. 4. more robust, and potentially more efficient manner. 5. collection of power management BIOS code, Advanced Power Management (APM) application programming interfaces (APIs, PNPBIOS APIs, Multiprocessor Specification (MPS) 6. suitable to all classes of computers including (but not limited to) desktop, mobile, workstation, and server machines

Principal Goals 1. ACPI provides OSPM with direct and exclusive control over the power management and motherboard device configuration functions of a computer. OS plays a central role and uses global information to optimize system behavior. ACPI is the key element in OSPM 2. Enable all computer systems to implement motherboard configuration and power management functions 3. Enhance power management functionality and robustness. 4. Facilitate and accelerate industry-wide implementation of power management. 5. Create a robust interface for configuring motherboard devices.

ACPI Function System power management Device power management Processor power management Plug and Play System Events Battery management Thermal management Embedded Controller SMBus Controller

Seven Operation Region Types 0 – SystemMemory 1 – SystemIO 2 – PCI_Config 3 – EmbeddedControl 4 – SMBus 5 – CMOS 6 – PCIBARTarget

OSPM/ACPI Global System

ACPI run-time components ACPI Tables Describe the interfaces to the hardware. ACPI Registers The constrained part of the hardware interface, described (at least in location) by the ACPI System Description Tables. ACPI BIOS ACPI system firmware.The firmwares boots the machine and compatible with ACPI spec.

ACPI Power States Global System States G0 -- ----Working (System Operational) G1 -------Sleeping - no user threads, system looks off G2/S5 --Soft Off G3 -------Mechanical off (Physical off switch) Device Power States D3 - Off - Power off to device D2 - Less power than D1 (Depends on device) D1 - Less power than D0 (Depends on Device) D0 - Fully-On Processor Power States C0 - Full power, instructions execute C1 - Processor stopped C2 - Processor stopped, less power than C1 C3 - Processor stopped, caches ignore snoops Sleeping States S0 - system Working S1 - Low Latency Sleeping State - Processor Context Maintained S2 - Low Latency Sleeping State - Processor Context Not Maintained S3 - Low Latency Sleeping State - DRAM still maintained S4 - Lowest power longest wake-up - DRAM not maintained S5 - Soft Off State

System Power States

OSPM Implementations 1.Use system address map reporting interfaces. (int15h,e820h) 2.Find and consume the ACPI System Description Tables. 3.Interpret ACPI machine language (AML). 4.Enumerate and configure motherboard devices described in the ACPI Namespace. 5.Interface with the power management timer. 6.Interface with the real-time clock wake alarm. 7.Enter ACPI mode (on legacy hardware systems). 8.Implement device power management policy. 9.Implement power resource management. 10.Implement processor power states in the scheduler idle handlers. 11.Control processor and device performance states. 12.Implement the ACPI thermal model. 13.Support the ACPI Event programming model including handling SCI interrupts, managing fixed events, general-purpose events, embedded controller interrupts, and dynamic device support. 14.Support acquisition and release of the Global Lock. 15.Use the reset register to reset the system. 16.Provide APIs to influence power management policy. 17.Implement driver support for ACPI-defined devices. 18.Implement APIs supporting the system indicators. 19.Support all system states S1–S5.

ACPI Hardware Fixed Hardware Programming Model Performance sensitive features Features that drivers require during wake Features that enable catastrophic OS software failure recovery CPU clock control Power management timer Fixed hardware registers Generic Hardware Programming Model OEM-provided AML code

Generic Hardware Feature Model

Global States and Their Transitions

Register model Fixed hardware registers and Generic hardware registers System I/O System memory PCI configuration SMBus Embedded controller Functional Fixed Hardware

Example: PM1

ACPI Software ACPI uses tables to describe system information, features, and methods for controlling features. RSDT--Root System Description Table. XSDT--Extended System Description Table. FADT--Fixed ACPI Description Table. DSDT--Differentiated System Description Table. FACS--Firmware ACPI Control Structure. SSDT--Secondary System Description Table. ……

System Description Table Architecture F000:xxxx Top Memory RSD PTR RSDT(XSDT) FACS RSD PTR:Root System Description Pointer RSDT:Root System Description Table FADT:Fixed ACPI Description Table FACS:Fimware ACPI Control Structure DSDT:Differentiated System Description table SSDT:Secondary System Description Table FADT DSDT DBGP APIC MP(APIC) BOOT Simple boot flag SSDT

RSD_PTR: db "RSD PTR “ ;RSD PTR Signature W6555 Acpi.asm ;Build RSD PTR table ALIGN 16 Public RSD_PTR RSD_PTR: db "RSD PTR “ ;RSD PTR Signature RSD_CKSM: db 0 ;Checksum, fill in at POST …… RSDT_Ptr: db 4 dup (?) ;RSDT physical address, fill in at POST RSDPTRLength EQU ($-RSD_PTR)

……

db "RSDT" ;Signaturedb 4 dup (?) …… W6555 Acpitbl.asm ;RSDT table RSDTtable: db "RSDT" ;Signaturedb 4 dup (?) …… db 4 dup (?) ;Pointer of FACP table ifdef SIMPLE_BOOT_SUPPORT db 4 dup (?) ; Pointer of BOOT table endif ;SIMPLE_BOOT_SUPPORT ifdef Debug_port_table ;R09 db 4 dup (?) ;R09 Pointer of DBGP table endif ;Debug_port_table ;R09

Fixed ACPI Description Table (FADT) FADT defines various fixed hardware ACPI information vital to an ACPI-compatible OS, such as the base address for the following hardware registers blocks: PM1a_EVT_BLK, PM1b_EVT_BLK, PM1a_CNT_BLK, PM1b_CNT_BLK……

…… …… ……

db 4 dup (?) ;Pointer of FACS table W6555 Acpitbl.asm FACPtable: db "FACP" ;Signature …… db 4 dup (?) ;Pointer of FACS table db 4 dup (?) ;Pointer of DSDT table dd PM1a_EVT_BLK dd PM1b_EVT_BLK dd GPE0_BLK dd GPE1_BLK db PM1_EVT_LEN

Firmware ACPI Control Structure (FACS) FACS is a structure in read/write memory that the BIOS reserves for ACPI usage. Hardware Signature Used in waking from S4 state Firmware_waking_Vector Physical memory address of an OS wake function Global_lock

dd 0 ;Hardware Signature dd 0 ;Firmware Waking Vector Acpitbl.asm ;FACS Table FACStable: db "FACS" ;Signature dd FACSLength ;Length dd 0 ;Hardware Signature dd 0 ;Firmware Waking Vector dd 0 ;Global Lock dd FACSFlag db 40 dup (0) ;Reserved FACSLength EQU ($-FACStable)

Differentiated System Description Table (DSDT) DSDT is part of the system fixed description. Table header Data in Definition Block

ASL (ACPI Source Language) ASL Name define All name are a fixed 32 bits. First byte is ‘A’-’Z’,’_’ Inclusive of ‘A’-’Z’,’0’-’9’,’_’ Name begin with ’_’ are reserved Name proceeded with ‘\’ refer to the root Name proceeded with ‘^’ refer to the parent

ASL Language Grammer Multiple blanks are the same as one. Blank, (, ), ‘,’ and newline are all token separators. // marks the beginning of a comment, which continues from the // to the end of the line. /* marks the beginning of a comment, which continues from the /* to the next */. “” surround an ASCII string. Single quotes (‘ ’)Indicate constant characters.‘A’ Numeric constants can be written in three ways: ordinary decimal, octal (using 0ddd) or hexadecimal, using the notation 0xdd. Nothing indicates an empty item. For example, { Nothing } is equivalent to {}.

ASL Data Type Description [Uninitialized] No assigned type or value. This is the type of all control method LocalX variables and unused ArgX variables at the beginning of method execution, as well as all uninitialized Package elements. Uninitialized objects must be initialized (via Store or CopyObject) before they may be used as source operands in ASL expressions. Buffer An array of bytes. Uninitialized elements are zero by default. Buffer Field Portion of a buffer created using CreateBitField, CreateByteField, CreateWordField, CreateQWordField, CreateField, or returned by the Index operator. DDB Handle Definition block handle returned by the Load operator Debug Object Debug output object. Formats an object and prints it to the system debug port. Has no effect if debugging is not active. Device Device or bus object Event Event synchronization object Field Unit (within an Operation Region) Portion of an address space, bit-aligned and of one-bit granularity. Created using Field, BankField, or IndexField. Integer An n-bit little-endian unsigned integer. In ACPI 1.0 this was at least 32-bits. In ACPI 2.0 this is at least 64.bits. Integer Constant Created by the ASL terms “Zero”, “One”, “Ones”, and “Revision”. Method Control Method (Executable AML function) Mutex Mutex synchronization object Object Reference Reference to an object created using the RefOf operator Operation Region Operation Region (A region within an Address Space) Package Collection of ASL objects with a fixed number of elements (up to 255). Power Resource Power Resource description object Processor Processor description object String Null-terminated ASCII string with up to 200 characters. Thermal Zone Thermal Zone description object

ASL Language and Terms DefinitionBlock( AMLFileName, //StringData TableSignature, //StringData ComplianceRevision, //ByteConst OEMID, //StringData TableID, //StringData OEMRevision //DWordConst ) { ObjectList }

HEAD BODY W6555 Dsdt.asl DefinitionBlock ( "DSDT.AML", "DSDT", 0x01, "INTELR", //OEMID "AWRDACPI", 0x1000 ) { // Start of ASL File Scope(\_PR) { Processor(\_PR.CPU0, 1, //processor number 0x4010, //System IO address of Pblk Registers 0x06 //length in bytes of PBlk ) {} } …… Name(\_S0,Package(){0,0,0,0}) //R36 HEAD BODY

Example // Define a control method power button Device(\_SB.PWRB){ //_SB System bus scope Name(_HID, EISAID(“PNP0C0C”)) //_HID hardware ID Name(_PRW,Package(){0, 0x4}) //_PRW power resource for wake } OperationRegion(\Pho, SystemIO, 0x200, 0x1) Field(\Pho, ByteAcc, NoLock, WriteAsZeros){ PBP, 1, // sleep/off request PBW, 1 // wakeup request } // end of power button device object //_Lxx /_Exx Control method executed as a result of a GPE Scope(\_GPE){ // Root level event handlers //general-purpose event. Method(_L00){ // uses bit 0 of GP0_STS register If(PBP){ Store(One, PBP) // clear power button status Notify(\_SB.PWRB, 0x80) // Notify OS of event IF(PBW){ Store(One, PBW) Notify(\_SB.PWRB, 0x2) } // end of _L00 handler } // end of \_GPE scope

Wake Sleep _PTS _GTS _WAK _BFS Prepare To Sleep Going To Sleep System Wake Back From Sleep

ACPI In BIOS

Relative files in source code *.asx*.asl*.aml ACPITBL.EXEACPITBL.BIN ACPI.ASM ACPI.EQU ACPI.INC ACPI_CT.INC ACPI_IO.EQU ACPIPOST.ASM ACPITBL.ASM ACPILED.ASXACPILED.ASL

ACPI Name space A hierarchical tree structure in OS-controlled memory that contains named objects. These objects may be data objects, control method objects, bus/device package objects, and so on. The OS dynamically changes the contents of the namespace at run-time by loading and/or unloading definition blocks from the ACPI Tables that reside in the ACPI BIOS. All the information in the ACPI Namespace comes from the Differentiated System Description Table (DSDT), which contains the Differentiated Definition Block, and one or more other definition blocks. For all Definition Blocks, the system maintains a single hierarchical namespace that it uses to refer to objects. All Definition Blocks load into the same namespace.

Example ACPI NameSpace

W6555 Dsdt.asx \_PR \_S0 \_S1 \_S4 \_S5 \_PTS \_WAK \_SI _MSG _SST \_SB PWRB _HID _STA SLPB _PRW PCI0 _ADR _UID _S3D _CRS PICM APIC _PRT PX40 USB0 USB1 USB2 USB3 PX43 SMBB MODM PMIO W6555 Dsdt.asx \_PR \_S0 \_S1 \_S4 \_S5 \_PTS \_WAK \_SI _MSG _SST \_GPE _L05 _L03 _L04 _L0B _L08 _L1B _L0C _L0D \_SB

BIOS Initialization Non-Volatile-Sleeping Memory(NVS) Boot Vector Yes SLP_TYP=S3 ? No Initialize CPU Init memory controller Enable Memory Init chipset Initialize CPU Enable Memory Yes Restore Memory Image S4BIOS ? No POST … ACPI NVS ACPI Reclaim ACPI Tables Call Waking Vector Boot OS Loader Non-Volatile-Sleeping Memory(NVS)

SETUP ACPI TABLE ACPI memory range type: ACPI Reclaim Memory Be free when finish using ACPI table ACPI Non-Volatile-Sleeping Memory(NVS) Reserved by BIOS

Process of Setup ACPI Table Determine the size and address of the physical memory. Allocate the ACPI Reserved area at top of memory for ACPI NVS and ACPI Reclaim memory areas. Fix up the ACPI table pointers with address values. Copy FACS into NVS;copy RSET,RACP,DSDT into ACPI Reclaim memory area;copy RSD pointer into E000:F000 memory segment.

cmp dword ptr ACPI_TABLE_FLAG[bp],0 jz short No_ACPI_table E8post.asm ifdef ACPI_Support cmp dword ptr ACPI_TABLE_FLAG[bp],0 jz short No_ACPI_table mov di,(ACPITBL_Expand_Address+1)*4 call POST_decompress extrn SetupACPI:near call SetupACPI ;call to setup ACPI table No_ACPI_table: endif; ACPI_Support

call SetRealModeLimit ;Enter big real mode W6555 acpi.asm call SetRealModeLimit ;Enter big real mode F000_Call F000_Shadow_W ;Set F000 shadow to writeable call GetACPIReclaimArea ;Return EAX=physical address of reclaim memory area call MoveACPIToReclaim ;Move RSDT, FACP, DSDT tables to reclaim area call GetACPINVSArea ;Return EAX=physical address of ACPI NVS area call MoveACPItoNVS ;Move FACS table to NVS area. call FillACPIAddress ;Fill in the pointers for all tables call FillACPIChecksum ;Fill in check sum for all tables call SetRealModelimit ;Leave big real mode

BOOTROM.ASM ACPI.ASM ACPITBL.ASM Detected system sleep resume state Enable ACPI I/O space Turn_On_ACPI_IO(chiprun.asm) ACPI.ASM Move codes to the top of memory,filled in all pointers,checksum. ACPI Patch (Ct_parse_AML) Replacesuspendtype PROC ModifySuspendType PROC ReplaceAML_String PROC ACPITBL.ASM All ACPI Tables puts here.

E0post.ASM E8post.ASM Setup INT15h function E820h – memory report POST code 067h Setup INT15h function E820h – memory report ACPI table address & size E8post.ASM POST code 089h - SetupACPI ACPI Table initialize AML initialize Dynamically modify ACPI tables and AML

Enable SCI to transfer to ACPI mode. ACPI_ENABLE (0A1h) out SMI_CMD,0A1H Enable SCI to transfer to ACPI mode. Save some chipset configuration. ACPI_DISABLE (0A0h) out SMI_CMD,0A0H Disable SCI to transfer to Legacy mode. Restore original chipset configuration. S4BIOS_REQ (0A4h) out SMI_CMD,0A4H Save system context to heardisk and put system state to S4.

Questions How does OS get SCI information? Is ACPI table dynamical created by BIOS Post? Can modify ACPI table in OS?

THE END Thank you