ke隆系统中关于Windows 硬件抽象层(HAL)的相关原理

来源:互联网 发布:淘宝最低迷产品排行榜 编辑:程序博客网 时间:2024/05/16 08:40

本文参考以下网页资料:
http://support.microsoft.com/?kbid=309283
http://support.microsoft.com/default.aspx?scid=kb;EN-US;299340
http://www.joshie.com/~jlevitsk/blog/archives/000032.html

1. 为什么要在 GHOST 之前,将 ACPI PC 改为 Standard PC ?

Quoted from Unkown:
Microsoft does not support running a HAL other than the HAL that Windows Setup would normally install on the computer. For example, running a PIC HAL on an APIC computer is not supported.

Although this configuration may appear to work, Microsoft does not test this configuration and you may have performance and interrupt issues. Microsoft also does not support swapping out the files that are used by the HAL to manually change HAL types.

When you create a Sysprep image, the image must contain the correct HAL type for the target computer.
Windows 安装时会首先决定硬件抽象层 (HAL) ,并根据此信息安装系统文件,Microsoft 未对安装后的系统在不同硬件抽象层的 PC 上运行作测试,也不保证能正常使用。

当 GHOST 生成的映像文件在不同的系统上使用时,只有 Standard PC 能兼容所有的系统,因此需在 GHOST 之前调整此设置。

2. 已安装的系统如何更改硬件抽象层?

Quoted from Unkown:
The reason Windows would not boot past loading the initial quasi-DOS drivers was because of the HAL being wrong.

Microsoft recommends that you switch HALs for troubleshooting purposes only or to workaround a hardware problem.

Device Manager does not permit the change from a Non-ACPI HAL to an ACPI HAL. You must use a new install of Windows XP or Windows Server 2003 for this type of change. Change from an ACPI HAL to a Non-ACPI HAL only for troubleshooting purposes.
当系统不能正常启动时,需要调整硬件抽象层设置。但 Microsoft 仅在系统设备管理器中提供将 ACPI PC 改为不支持 ACPI (Standard PC) 的途径以供排除故障,却不提供从系统设备管理器中改回 ACPI PC 。

Quoted from Unkown:
To force in a system Hardware Abstraction Layer (HAL) during an upgrade or installation of Windows XP, note that during the Text-mode phase of Setup, you receive the following informational message across the bottom of the screen:

Press F6 if you need to install a third-party SCSI or RAID driver.
When this message appears, press F5. You can now make HAL choices by viewing the different options. Note that if you instead press F7, the Standard PC HAL loads, and the ACPI compliance check is bypassed.
要更改硬件抽象层,你可以使用安装盘启动,当提示按 F6 键安装第三方磁盘驱动时,按 F5 键可以手动选择正确的 HAL 定义,或者按 F7 键强制使用 Stardard PC 。

3. 如何通过更改系统文件的方法实现切换 ACPI 设置?

Quoted from Unkown:
The following list describes the computers that you can deploy a particular Sysprep image to based on the HAL type in the source computer:

You can deploy a Sysprep image created on a computer that uses a Standard PC, Non-ACPI PIC HAL (Hal.dll) to a computer that uses the following HAL types:
Standard PC, Non-ACPI PIC HAL (Hal.dll)

You can deploy a Sysprep image created on a computer that uses an Advanced Configuration and Power Interface (ACPI) PC, ACPI PIC HAL (Halacpi.dll) to a computer that uses the following HAL types:
Advanced Configuration and Power Interface (ACPI) PC, ACPI PIC HAL (Halacpi.dll)

You can deploy a Sysprep image created on a computer that uses a MPS Uniprocessor PC, Non-ACPI APIC UP HAL (Halapic.dll) to a computer that uses the following HAL types:
MPS Uniprocessor PC, Non-ACPI APIC UP HAL (Halapic.dll)
MPS Multiprocessor PC, Non-ACPI APIC MP HAL (Halmps.dll)

You can deploy a Sysprep image created on a computer that uses a MPS Multiprocessor PC, Non-ACPI APIC MP HAL (Halmps.dll) to a computer that uses the following HAL types:
MPS Multiprocessor PC, Non-ACPI APIC MP HAL (Halmps.dll)
MPS Uniprocessor PC, Non-ACPI APIC UP HAL (Halapic.dll)

You can deploy a Sysprep image created on a computer that uses an ACPI Uniprocessor PC, ACPI APIC UP HAL (Halaacpi.dll) to a computer that uses the following HAL types:
ACPI Uniprocessor PC, ACPI APIC UP HAL (Halaacpi.dll)
ACPI Multiprocessor PC, ACPI APIC MP HAL (Halmacpi.dll)

You can deploy a Sysprep image created on a computer that uses an ACPI Multiprocessor PC, ACPI APIC MP HAL (Halmacpi.dll) to a computer that uses the following HAL types:
ACPI Multiprocessor PC, ACPI APIC MP HAL (Halmacpi.dll)
ACPI Uniprocessor PC, ACPI APIC UP HAL (Halaacpi.dll)
安装 Windows 时会根据系统硬件抽象层,将安装盘上的 HAL ACPI 链接库复制到 %windir%system32hal.dll

根据你的系统,会复制不同的文件,但复制到系统后文件名都是 hal.dll。
Standard PC (Hal.dll)
ACPI PC (Halacpi.dll)
ACPI Uniprocessor PC (Halaacpi.dll)
常用的就是以上三种,如果有多处理器的等等,请参照上面原文 (多处理器系统还有个文件不同: NTOSKNRL.EXE)

只要将安装光盘上的 Halacpi.dll 或者 Halaacpi.dll 文件提取,覆盖系统的 hal.dll 文件,即可在下次重启时将 Standard PC 更改为 ACPI PC (这个文件在系统启动后也可以替换) 。

4. 如何知道我的系统现在使用什么 HAL ACPI 文件?

查看 %windir%system32hal.dll 的属性->版本->源文件名。

如果紧急修复过程找不到修复信息或者修复信息无效,请启动“故障恢复控制台”来恢复 Windows 2000 安装: 1. 使用 Windows 2000 安装软盘或 Windows 2000 光盘(如果计算机支持从光盘启动),启动计算机。在“欢迎使用安装程序”屏幕上,按 R 键修复安装,然后按 C 键启动“故障恢复控制台”。

注意:有关使用“故障恢复控制台”的信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
229716 (http://support.microsoft.com/kb/229716/) Windows 2000 故障恢复控制台说明 
2. 在登录到计算机之后,从原始 Windows 2000 安装的 %SystemRoot%/System32 文件夹中,使用命令控制台复制并重命名以下列表中列出的文件。首先使用受支持计算机类型的以下列表来确定您的计算机需要哪些 HAL 和内核文件:

注意:标记有星号字符的是“标准”计算机类型(非 ACPI)。

i386 源文件:i386/driver.cab/halmacpi.dll
计算机类型:ACPI Multiprocessor PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:i386/driver.cab/halaacpi.dll
计算机类型:ACPI Uniprocessor PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:i386/driver.cab/halacpi.dll
计算机类型:Advanced Configuration and Power Interface (ACPI) PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:*i386/driver.cab/halsp.dll
计算机类型:Compaq SystemPro Multiprocessor or 100% Compatible
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:*i386/driver.cab/halapic.dll
计算机类型:MPS Uniprocessor PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:*i386/driver.cab/halmps.dll
计算机类型:MPS Multiprocessor PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:*i386/driver.cab/hal.dll
计算机类型:Standard PC
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

i386 源文件:*i386/driver.cab/halborg.dll
计算机类型:SGI mp
复制到此文件夹:winnt/System32
重命名为此文件名:hal.dll

 
3. 如下表所示,根据您的计算机支持的计算机类型,从 Windows 2000 光盘 (i386/driver.cab) 或已安装的 Service Pack 中将您的系统(单处理器与多处理器)公用的所有相应的内核文件和相应的 HAL 文件复制到下表中列出的原始 Windows 2000 安装下的对应文件夹中,然后将它们分别重命名为 Ntoskrnl.exe 和 Hal.dll(如有必要)。

多处理器公共内核文件 复制到下面的目录 重命名为以下文件名
i386/driver.cab/ntkrnlmp.exe winnt/System32 ntoskrnl.exe
i386/driver.cab/ntkrpamp.exe winnt/System32 ntkrnlpa.exe
i386/driver.cab/kernel32.dll winnt/System32 kernel32.dll
i386/driver.cab/ntdll.dll winnt/System32 ntdll.dll
i386/driver.cab/win32k.sys winnt/System32/drivers win32k.sys
i386/driver.cab/winsrv.dll winnt/System32 winsrv.dll
单处理器公共内核文件 复制到下面的目录 重命名为以下文件名
i386/driver.cab/ntoskrnl.exe winnt/System32 ntoskrnl.exe
i386/driver.cab/ntkrnlpa.exe winnt/System32 ntkrnlpa.exe
i386/driver.cab/kernel32.dll winnt/System32 kernel32.dll
i386/driver.cab/ntdll.dll winnt/System32 ntdll.dll
i386/driver.cab/win32k.sys winnt/System32 win32k.sys
i386/driver.cab/winsrv.dll winnt/System32 winsrv.dll
 
4. 将原始 Windows 2000 光盘 (i386/driver.cab) 或已安装的 Service Pack 中的文件 Ntdll.dll 展开到原始 Windows 2000 安装的 %SystemRoot%/system32 文件夹中。

例如:
drive:/i386/driver.cab /f:ntdll.dll c:/winnt/system32
其中 drive 是包含 Windows 2000 Server 光盘的 CD-ROM 驱动器的驱动器号。
5. 将原始 Windows 2000 光盘 (i386/driver.cab) 或已安装的 Service Pack 中的 Win32k.sys 文件展开到原始 Windows 2000 安装的 %SystemRoot%/system32 文件夹中。
6. 将 Windows 2000 光盘 (i386/driver.cab) 或已安装的 Service Pack 中的 Kernel32.dll 和 Winsrv.dll 文件展开到原始 Windows 2000 安装的 %SystemRoot%/system32 文件夹中。例如,键入以下命令: expand drive:/i386/driver.cab /F:kernel32.dll %systemroot%/system32/kernel32.dll

expand drive:/i386/driver.cab /F:winsrv.dll %systemroot%/system32/winsrv.dll

其中,drive 是 CD-ROM 驱动器号。

 
7. 重新启动计算机。