如何使用

本主題描述如何使用進階設定和 Power Interface (ACPI) 來源語言 (ASL) 中的 _OSI 方法來識別主機作系統。 使用此方法,ASL 寫入器可以建立支持未來作系統版本的韌體,並讓作系統根據要求的介面層級來變更行為。

此資訊適用於下列作業系統:

Windows 11 版本 22H2

Windows 11

Windows 10 (版本 2004)

Windows 10 版本 1903

Windows 10 版本 1809

Windows 10 版本 1803

Windows 10 版本 1709

Windows 10 版本 1703

Windows 10 (版本 1607)

Windows Server 技術預覽

Windows 10

Windows Server 2012 R2

Windows 8.1

Windows Server 2012

Windows 8

Windows Server 2008 R2

Windows 7

Windows Server 2008

Windows Vista

Windows Server 2003

Windows XP

_OSI 方法

所有最新版本的 Windows作系統都支援 進階設定和電源介面 (ACPI) 規格的元件。 ACPI 規格會定義解譯的語言 ACPI 來源語言 (ASL),讓作系統能夠執行韌體提供的電源管理和組態控制方法。 為了改善 ASL 寫入器識別主機作業系統版本的能力,ASL 提供作業系統介面層級(_OSI)。

使用 _OSI 方法,ASL 寫入器可以輕鬆地判斷主機作系統支援的 ACPI 介面版本。 這個版本控制方法提供一個解決方案,可用來建立可支持未來作系統的韌體,並讓作系統根據要求的介面層級來變更行為。

已定義OSI

_OSI方法有一個自變數和一個傳回值。 參數是一個由每個作業系統定義的字串。 若介面不支援,則傳回值為 0x00000000;若介面支援,則傳回值為 0xFFFFFFFF。

最新版的 ACPI 規格已將 _OSI 方法的使用案例延伸至主機作系統版本識別之外。

不過,Windows 僅支援_OSI用於識別系統上執行的 Windows 主機版本。

_OSI方法的定義如下:

_OSI - 作業系統介面

論點

由每個操作系統自行定義的字串。 例如:

適用於 Windows 8.1 和 Windows Server 2012 R2 的“Windows 2013”

適用於 Windows 8 和 Windows Server 2012 的“Windows 2012”

適用於 Windows 7 和 Windows Server 2008 R2 的“Windows 2009”

適用於 Windows XP 的 “Windows 2001”

適用於 Windows Server 2003 的 “Windows 2001.1”

返回值

傳回值如下所示:

如果作業系統不支援自變數中的版本,則為 0x00000000。

如果作業系統支援參數中的版本,則結果為 0xFFFFFFFF。

_OSI 命令行參數的詳細資訊(Windows)

下表列出 ASL 可以使用對應的_OSI字串來識別的 Windows 版本。

如果_OSI方法的參數指定舊版 Windows,Windows 作業系統會傳回0xFFFFFFFF。 例如,Windows 7 會針對 “Windows 2009” (Windows 7) 和 “Windows 2006” (Windows Vista) 傳回0xFFFFFFFF。

適用於 Windows 系統的 _OSI 字串

OSI 字串

目標作業系統

Windows 2000

Windows 2000

Windows 2001

Windows XP

Windows 2001 SP1

Windows XP SP1

Windows 2001.1

Windows Server 2003

Windows 2001 SP2

Windows XP SP2

Windows 2001.1 SP1

Windows Server 2003 SP1

Windows 2006

Windows Vista

Windows 2006 SP1

Windows Vista SP1

Windows 2006.1

Windows Server 2008

Windows 2009

Windows 7、Win Server 2008 R2

Windows 2012

Windows 8,Win Server 2012

Windows 2013

Windows 8.1

Windows 2015

Windows 10

Windows 2016

Windows 10 (版本 1607)

Windows 2017

Windows 10 版本 1703

Windows 2017.2

Windows 10 版本 1709

Windows 2018

Windows 10 版本 1803

Windows 2018.2

Windows 10 版本 1809

Windows 2019

Windows 10 版本 1903

Windows 2020

Windows 10 (版本 2004)

Windows 2021

Windows 11

Windows 2022

Windows 11 版本 22H2

實作注意事項

將識別作業系統的例程放在 _SB 範圍下的 _INI 方法中,以便儘快執行 _OSI。

這個位置很重要,因為作業系統會根據_OSI方法的字串參數提供功能。

其他資源

進階設定和電源介面規格