没有合适的资源?快使用搜索试试~ 我知道了~
首页理解软件编程基础与ACPI规范
理解软件编程基础与ACPI规范
需积分: 9 0 下载量 147 浏览量
更新于2024-07-24
收藏 7.5MB PDF 举报
"软件编程的基本思想"
在软件编程领域,理解和掌握基本思想是至关重要的,因为这将奠定你成为优秀程序员的基础。软件编程不仅仅是编写代码,它涉及到一系列的设计、实现、测试和维护的过程。以下是对这个主题的深入探讨:
1. **高级配置与电源接口规范(ACPI)**
- ACPI是Advanced Configuration and Power Interface的缩写,由Hewlett-Packard、Intel、Microsoft、Phoenix Technologies和Toshiba等公司共同制定的一个标准,用于管理计算机系统的硬件配置和电源状态。这部分内容可能并不直接涉及编程的基本思想,但它提醒我们,软件开发者需要理解操作系统和其他底层技术的工作原理,以便更好地编写与系统兼容的代码。
2. **问题解决和逻辑思维**
- 软件编程的核心是解决问题。程序员需要具备良好的逻辑思维能力,能够将复杂的问题分解为可管理的小部分,并用代码来实现这些解决方案。这通常涉及到算法设计和数据结构的选择。
3. **编程语言基础**
- 掌握至少一种编程语言是必要的,如C、Java、Python或JavaScript。每种语言都有其特定的语法和特性,理解这些可以帮助你有效地表达和实现程序逻辑。
4. **面向对象编程(OOP)**
- 面向对象编程是一种流行的设计模式,它基于类和对象的概念。理解类和对象的关系,以及封装、继承和多态这三个OOP的基石,能帮助你构建可维护和可扩展的代码。
5. **设计模式**
- 设计模式是解决常见编程问题的模板,如单例模式、工厂模式和装饰器模式。它们是经验的总结,学习和应用设计模式可以提高代码的可读性和复用性。
6. **调试和测试**
- 能够有效地调试和测试代码是编程过程中不可或缺的一部分。了解如何使用调试工具,编写单元测试和集成测试,是确保软件质量的关键。
7. **版本控制**
- 版本控制系统如Git,对于协作开发和代码管理至关重要。学习如何使用版本控制工具,理解分支和合并的概念,可以提高团队效率并防止冲突。
8. **软件工程原则**
- 模块化、抽象、接口分离原则(ISP)、开闭原则(OCP)等软件工程原则,指导着大型项目的组织和开发。遵循这些原则可以提升代码的可读性和可维护性。
9. **持续集成/持续部署(CI/CD)**
- CI/CD是现代软件开发流程的关键组成部分,它自动化了构建、测试和部署的过程,有助于快速迭代和高质量交付。
10. **软件文档**
- 良好的文档是任何项目成功的关键。程序员需要学会编写清晰的注释,创建用户手册和技术文档,以便其他开发者理解和使用代码。
11. **学习和适应新技术**
- 技术日新月异,软件开发者需要保持学习的热情,不断跟进新的编程语言、框架和工具,以保持竞争力。
软件编程的基本思想包括了问题解决的能力、对编程语言的理解、遵循最佳实践以及持续学习的精神。理解并掌握这些,将有助于你在编程的道路上不断进步。
xii Hewlett-Packard/Intel/Microsoft/Phoenix/Toshiba
10.1.1 ACPI Smart Battery Status Change Notification Requirements...................... 492
10.1.2 Smart Battery Objects ..................................................................................... 493
10.1.3 _SBS (Smart Battery Subsystem) .................................................................. 494
10.2 Control Method Batteries ............................................................................................ 496
10.2.1 Battery Events................................................................................................. 497
10.2.2 Battery Control Methods ................................................................................. 497
10.3 AC Adapters and Power Source Objects.................................................................... 510
10.3.1 _PSR (Power Source)..................................................................................... 510
10.3.2 _PCL (Power Consumer List) ......................................................................... 511
10.3.3 _PIF (Power Source Information).................................................................... 511
10.3.4 _PRL (Power Source Redundancy List) ......................................................... 512
10.4 Power Meters.............................................................................................................. 512
10.4.1 _PMC (Power Meter Capabilities)................................................................... 513
10.4.2 _PTP (Power Trip Points) ............................................................................... 514
10.4.3 _PMM (Power Meter Measurement) ............................................................... 515
10.4.4 _PAI (Power Averaging Interval)..................................................................... 515
10.4.5 _GAI (Get Averaging Interval)......................................................................... 516
10.4.8 _PMD (Power Metered Devices)..................................................................... 517
10.5 Example: Power Source and Power Meter Namespace............................................ 517
11
Thermal Management................................................................................. 519
11.1 Thermal Control .......................................................................................................... 519
11.1.1 Active, Passive, and Critical Policies .............................................................. 520
11.1.2 Dynamically Changing Cooling Temperature Trip Points ............................... 521
11.1.3 Detecting Temperature Changes .................................................................... 522
11.1.4 Active Cooling ................................................................................................ 524
11.1.5 Passive Cooling .............................................................................................. 525
11.1.6 Critical Shutdown ............................................................................................ 526
11.2 Cooling Preferences .................................................................................................. 527
11.2.1 Evaluating Thermal Device Lists..................................................................... 528
11.2.2 Evaluating Device Thermal Relationship Information ..................................... 529
11.3 Fan Device.................................................................................................................. 529
11.3.1 Fan Objects..................................................................................................... 530
11.4 Thermal Objects.......................................................................................................... 533
11.4.1 _ACx (Active Cooling) ..................................................................................... 534
11.4.2 _ALx (Active List) ............................................................................................ 534
11.4.3 _ART (Active Cooling Relationship Table)...................................................... 535
11.4.4 _CRT (Critical Temperature)........................................................................... 538
11.4.5 _DTI (Device Temperature Indication) ............................................................ 538
11.4.6 _HOT (Hot Temperature) ................................................................................ 538
11.4.7 _NTT (Notification Temperature Threshold) ................................................... 539
11.4.8 _PSL (Passive List)......................................................................................... 539
11.4.9 _PSV (Passive) ............................................................................................... 539
11.4.10 _RTV (Relative Temperature Values) ........................................................... 540
11.4.11 _SCP (Set Cooling Policy) ............................................................................ 540
11.4.12 _TC1 (Thermal Constant 1) .......................................................................... 543
Advanced Configuration and Power Interface Specification
Hewlett-Packard/Intel/Microsoft/Phoenix/Toshiba xiii
11.4.13 _TC2 (Thermal Constant 2) .......................................................................... 543
11.4.14 _TMP (Temperature)..................................................................................... 544
11.4.15 _TPT (Trip Point Temperature) ..................................................................... 544
11.4.16 _TRT (Thermal Relationship Table).............................................................. 544
11.4.17 _TSP (Thermal Sampling Period) ................................................................. 545
11.4.18 _TST (Temperature Sensor Threshold) ........................................................ 545
11.4.19 _TZD (Thermal Zone Devices)...................................................................... 546
11.4.20 _TZM (Thermal Zone Member)..................................................................... 546
11.4.21 _TZP (Thermal Zone Polling)........................................................................ 546
11.5 Native OS Device Driver Thermal Interfaces .............................................................. 547
11.6 Thermal Zone Interface Requirements ....................................................................... 548
11.7 Thermal Zone Examples............................................................................................. 548
11.7.1 Example: The Basic Thermal Zone................................................................. 548
11.7.2 Example: Multiple-Speed Fans ....................................................................... 550
11.7.3 Example: Thermal Zone with Multiple Devices ............................................... 552
12
ACPI Embedded Controller Interface Specification ................................ 559
12.1 Embedded Controller Interface Description ................................................................ 559
12.2 Embedded Controller Register Descriptions............................................................... 563
12.2.1 Embedded Controller Status, EC_SC (R) ....................................................... 563
12.2.2 Embedded Controller Command, EC_SC (W)................................................ 564
12.2.3 Embedded Controller Data, EC_DATA (R/W)................................................. 564
12.3 Embedded Controller Command Set .......................................................................... 564
12.3.1 Read Embedded Controller, RD_EC (0x80) ................................................... 565
12.3.2 Write Embedded Controller, WR_EC (0x81).................................................. 565
12.3.3 Burst Enable Embedded Controller, BE_EC (0x82)........................................ 565
12.3.4 Burst Disable Embedded Controller, BD_EC (0x83)....................................... 566
12.3.5 Query Embedded Controller, QR_EC (0x84).................................................. 566
12.4 SMBus Host Controller Notification Header (Optional), OS_SMB_EVT ..................... 566
12.5 Embedded Controller Firmware .................................................................................. 566
12.6 Interrupt Model............................................................................................................567
12.6.1 Event Interrupt Model...................................................................................... 567
12.6.2 Command Interrupt Model .............................................................................. 568
12.7 Embedded Controller Interfacing Algorithms .............................................................. 568
12.8 Embedded Controller Description Information ............................................................ 569
12.9 SMBus Host Controller Interface via Embedded Controller....................................... 569
12.9.1 Register Description........................................................................................ 570
12.9.2 Protocol Description ........................................................................................ 574
12.10 SMBus Devices......................................................................................................... 579
12.10.1 SMBus Device Access Restrictions .............................................................. 580
12.10.2 SMBus Device Command Access Restriction .............................................. 580
12.11 Defining an Embedded Controller Device in ACPI Namespace ............................... 580
12.11.1 Example: EC Definition ASL Code ............................................................... 581
12.12 Defining an EC SMBus Host Controller in ACPI Namespace................................... 582
12.12.1 Example: EC SMBus Host Controller ASL-Code .......................................... 582
xiv Hewlett-Packard/Intel/Microsoft/Phoenix/Toshiba
13
ACPI System Management Bus Interface Specification ......................... 585
13.1 SMBus Overview ........................................................................................................ 585
13.1.1 SMBus Slave Addresses................................................................................. 585
13.1.2 SMBus Protocols............................................................................................. 586
13.1.3 SMBus Status Codes ...................................................................................... 587
13.1.4 SMBus Command Values ............................................................................... 587
13.2 Accessing the SMBus from ASL Code ....................................................................... 587
13.2.1 Declaring SMBus Host Controller Objects ...................................................... 587
13.2.2 Declaring SMBus Devices............................................................................... 588
13.2.3 Declaring SMBus Operation Regions ............................................................. 588
13.2.4 Declaring SMBus Fields.................................................................................. 590
13.2.5 Declaring and Using an SMBus Data Buffer ................................................... 592
13.3 Using the SMBus Protocols ........................................................................................ 593
13.3.1 Read/Write Quick (SMBQuick)........................................................................ 593
13.3.2 Send/Receive Byte (SMBSendReceive) ......................................................... 594
13.3.3 Read/Write Byte (SMBByte)............................................................................ 595
13.3.4 Read/Write Word (SMBWord)......................................................................... 596
13.3.5 Read/Write Block (SMBBlock) ........................................................................ 596
13.3.6 Word Process Call (SMBProcessCall) ............................................................ 597
13.3.7 Block Process Call (SMBBlockProcessCall) ................................................... 598
14
Platform Communications Channel (PCC)............................................... 599
14.1 Platform Communications Channel Table .................................................................. 599
14.1.1 Platform Communications Channel Global Flags ........................................... 600
14.1.2 Platform Communications Channel Subspace Structures .............................. 600
14.1.3 Generic Communications Subspace Structure (type 0) .................................. 600
14.2 Generic Communications Channel Shared Memory Region ...................................... 601
14.2.1 Generic Communications Channel Command Field ....................................... 601
14.2.2 Generic Communications Channel Status Field ............................................. 602
14.3 Doorbell Protocol ........................................................................................................ 602
14.4 Platform Notification.................................................................................................... 603
14.5 Referencing the PCC address space.......................................................................... 603
15
System Address Map Interfaces ............................................................... 605
15.1 INT 15H, E820H - Query System Address Map ......................................................... 606
15.2 E820 Assumptions and Limitations............................................................................. 608
15.3 UEFI GetMemoryMap() Boot Services Function........................................................ 608
15.4 UEFI Assumptions and Limitations ............................................................................ 609
15.5 Example Address Map................................................................................................ 610
15.6 Example: Operating System Usage............................................................................ 611
16
Waking and Sleeping ................................................................................. 613
16.1 Sleeping States........................................................................................................... 615
16.1.1 S1 Sleeping State ........................................................................................... 617
Advanced Configuration and Power Interface Specification
Hewlett-Packard/Intel/Microsoft/Phoenix/Toshiba xv
16.1.2 S2 Sleeping State ........................................................................................... 618
16.1.3 S3 Sleeping State ........................................................................................... 618
16.1.4 S4 Sleeping State ........................................................................................... 619
16.1.5 S5 Soft Off State ............................................................................................. 620
16.1.6 Transitioning from the Working to the Sleeping State..................................... 621
16.1.7 Transitioning from the Working to the Soft Off State....................................... 622
16.2 Flushing Caches ......................................................................................................... 622
16.3 Initialization ................................................................................................................. 622
16.3.1 Placing the System in ACPI Mode .................................................................. 625
16.3.2 BIOS Initialization of Memory.......................................................................... 625
16.3.3 OS Loading ..................................................................................................... 627
16.3.4 Exiting ACPI Mode .......................................................................................... 629
17
Non-Uniform Memory Access (NUMA) Architecture Platforms ............. 631
17.1 NUMA Node................................................................................................................ 631
17.2 System Locality........................................................................................................... 631
17.2.1 System Resource Affinity Table Definition ...................................................... 632
17.3 System Locality Distance Information ......................................................................... 632
17.3.1 Online Hot Plug ............................................................................................... 632
17.3.2 Impact to Existing Localities............................................................................ 633
18
ACPI Platform Error Interfaces (APEI)...................................................... 635
18.2 Relationship between OSPM and System Firmware .................................................. 636
18.3 Error Source Discovery............................................................................................... 636
18.3.1 Boot Error Source ........................................................................................... 636
18.3.2 ACPI Error Source .......................................................................................... 638
18.4 Firmware First Error Handling..................................................................................... 650
18.4.1 Example: Firmware First Handling Using NMI Notification ............................. 651
18.5 Error Serialization ....................................................................................................... 651
18.5.1 Serialization Action Table................................................................................ 652
18.5.2 Operations....................................................................................................... 658
18.6 Error Injection.............................................................................................................. 662
18.6.1 Error Injection Table (EINJ)............................................................................. 662
18.6.2 Injection Instruction Entries ............................................................................. 665
18.6.3 Injection Instructions ....................................................................................... 666
18.6.4 Trigger Action Table........................................................................................ 668
19
ACPI Source Language (ASL)Reference.................................................. 671
19.1 ASL Language Grammar ............................................................................................ 671
19.1.1 ASL Grammar Notation................................................................................... 672
19.1.2 ASL Name and Pathname Terms ................................................................... 673
19.1.3 ASL Root and Secondary Terms .................................................................... 673
19.1.4 ASL Data and Constant Terms ....................................................................... 675
19.1.5 ASL Opcode Terms......................................................................................... 677
19.1.6 ASL Primary (Terminal) Terms ....................................................................... 678
xvi Hewlett-Packard/Intel/Microsoft/Phoenix/Toshiba
19.1.7 ASL Parameter Keyword Terms ..................................................................... 689
19.1.8 ASL Resource Template Terms...................................................................... 691
19.2 ASL Concepts ............................................................................................................. 699
19.2.1 ASL Names ..................................................................................................... 699
19.2.2 ASL Literal Constants ..................................................................................... 699
19.2.3 ASL Resource Templates ............................................................................... 701
19.2.4 ASL Macros..................................................................................................... 703
19.2.5 ASL Data Types .............................................................................................. 703
19.3 ASL Operator Summary ............................................................................................. 715
19.4 ASL Operator Summary By Type .............................................................................. 719
19.5 ASL Operator Reference ........................................................................................... 723
19.5.1 AccessAs (Change Field Unit Access)............................................................ 723
19.5.2 Acquire (Acquire a Mutex)............................................................................... 724
19.5.3 Add (Integer Add)............................................................................................ 724
19.5.4 Alias (Declare Name Alias) ............................................................................. 725
19.5.5 And (Integer Bitwise And) ............................................................................... 725
19.5.6 Argx (Method Argument Data Objects) ........................................................... 725
19.5.7 BankField (Declare Bank/Data Field).............................................................. 726
19.5.8 Break (Break from While)................................................................................ 727
19.5.9 BreakPoint (Execution Break Point)................................................................ 727
19.5.10 Buffer (Declare Buffer Object)....................................................................... 727
19.5.11 Case (Expression for Conditional Execution)................................................ 728
19.5.12 Concatenate (Concatenate Data) ................................................................. 728
19.5.13 ConcatenateResTemplate (Concatenate Resource Templates) .................. 729
19.5.14 CondRefOf (Create Object Reference Conditionally) ................................... 729
19.5.15 Connection (Declare Field Connection Attributes) ........................................ 729
19.5.16 Continue (Continue Innermost Enclosing While) .......................................... 730
19.5.17 CopyObject (Copy and Store Object)............................................................ 730
19.5.18 CreateBitField (Create 1-Bit Buffer Field) .................................................... 731
19.5.19 CreateByteField (Create 8-Bit Buffer Field) .................................................. 731
19.5.20 CreateDWordField (Create 32-Bit Buffer Field) ............................................ 731
19.5.21 CreateField (Create Arbitrary Length Buffer Field) ....................................... 732
19.5.22 CreateQWordField (Create 64-Bit Buffer Field) ............................................ 732
19.5.23 CreateWordField (Create 16-Bit Buffer Field) .............................................. 732
19.5.24 DataTableRegion (Create Data Table Operation Region) ............................ 732
19.5.25 Debug (Debugger Output)............................................................................. 733
19.5.26 Decrement (Integer Decrement) ................................................................... 733
19.5.27 Default (Default Execution Path in Switch) .................................................. 734
19.5.28 DefinitionBlock (Declare Definition Block)..................................................... 734
19.5.29 DerefOf (Dereference an Object Reference) ................................................ 735
19.5.30 Device (Declare Bus/Device Package) ......................................................... 735
19.5.31 Divide (Integer Divide)................................................................................... 736
19.5.32 DMA (DMA Resource Descriptor Macro) ...................................................... 737
19.5.33 DWordIO (DWord IO Resource Descriptor Macro) ....................................... 737
19.5.34 DWordMemory (DWord Memory Resource Descriptor Macro)..................... 739
19.5.35 DWordSpace (DWord Space Resource Descriptor Macro) .......................... 741
19.5.36 EISAID (EISA ID String To Integer Conversion Macro) ................................ 742
剩余957页未读,继续阅读
2009-04-03 上传
2023-10-12 上传
2012-10-04 上传
2008-12-15 上传
2010-09-19 上传
2010-03-28 上传
2009-11-25 上传
2010-06-01 上传
2010-11-08 上传
蓝天扬帆
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 黑板风格计算机毕业答辩PPT模板下载
- CodeSandbox实现ListView快速创建指南
- Node.js脚本实现WXR文件到Postgres数据库帖子导入
- 清新简约创意三角毕业论文答辩PPT模板
- DISCORD-JS-CRUD:提升 Discord 机器人开发体验
- Node.js v4.3.2版本Linux ARM64平台运行时环境发布
- SQLight:C++11编写的轻量级MySQL客户端
- 计算机专业毕业论文答辩PPT模板
- Wireshark网络抓包工具的使用与数据包解析
- Wild Match Map: JavaScript中实现通配符映射与事件绑定
- 毕业答辩利器:蝶恋花毕业设计PPT模板
- Node.js深度解析:高性能Web服务器与实时应用构建
- 掌握深度图技术:游戏开发中的绚丽应用案例
- Dart语言的HTTP扩展包功能详解
- MoonMaker: 投资组合加固神器,助力$GME投资者登月
- 计算机毕业设计答辩PPT模板下载
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功