文档:在 QEMU 中安装早期基于 ARMv7 的 Windows RT 内部版本:修订间差异

无编辑摘要
无编辑摘要
无编辑摘要
第 3 行: 第 3 行:
* [https://github.com/Wack0/tegra2_qemu_woa QEMU v6.1.0 Tegra 2 WoA分支] 用于模拟 [[wikipedia:Nvidia_Tegra_250|Nvidia Tegra 250]]开发环境, 已经针对早期ARMv7 Windows构建进行了专门的修改
* [https://github.com/Wack0/tegra2_qemu_woa QEMU v6.1.0 Tegra 2 WoA分支] 用于模拟 [[wikipedia:Nvidia_Tegra_250|Nvidia Tegra 250]]开发环境, 已经针对早期ARMv7 Windows构建进行了专门的修改
** 截至2025年,持续集成(CI)目前仅设置为编译Windows版本。必须使用其他操作系统(例如macOS或者Linux)从源代码手动编译该分支.
** 截至2025年,持续集成(CI)目前仅设置为编译Windows版本。必须使用其他操作系统(例如macOS或者Linux)从源代码手动编译该分支.
* 所需的[https://github.com/Wack0/tegra2_qemu_woa/releases/download/20240909/woa_t2_patched_uefi.zip 已修补 EFI 固件] (最初来自于 [https://wiki.win-story.cn/wiki/Windows_8_Build_7822.0.fbl_core1_kernel_npc_ext.100930-1700][[Windows 8 Build 7822.0.fbl core1 kernel npc ext.100930-1700|7822.0.fbl_core1_kernel_npc_ext.100930-1700]]泄漏压缩包), 将放置在 QEMU 安装目录中名为 <code>fw</code>
* 所需的[https://github.com/Wack0/tegra2_qemu_woa/releases/download/20240909/woa_t2_patched_uefi.zip 已修补 EFI 固件] (最初来自于 [[Windows 8 Build 7822.0.fbl core1 kernel npc ext.100930-1700|7822.0.fbl_core1_kernel_npc_ext.100930-1700]]泄漏压缩包), 将放置在 QEMU 安装目录中名为 <code>fw</code>
* 两个虚拟磁盘(用于存储安装介质以及系统安装)
* 两个虚拟磁盘(用于存储安装介质以及系统安装)
<references group="如果不希望等待安装过程(可能会出现安装失败),可以选择离线使用ARM64系统stage ARM32系统或者是选择下载已经stage完毕的系统进行安装" />
<references group="如果不希望等待安装过程(可能会出现安装失败),可以选择离线使用ARM64系统stage ARM32系统或者是选择下载已经stage完毕的系统进行安装" />


=== Precautions ===
=== 注意事项 ===
* The emulator may quit when a system reboot is initiated. This is an intentional design decision implemented by Microsoft as restarts are treated as full shutdowns by the Tegra 250 HAL, and cannot be worked around.
* 当模拟器内系统重启时,qemu将会直接退出,由于Microsoft在开发中将Tegra 250的重启设定为完全关闭,此问题无法解决,只能在模拟器退出后重新运行相关启动脚本再次运行。
* In rare edge cases, [[w:Secure Digital|Secure Digital]] [[w:MultiMediaCard|MultiMediaCard]] (SDMMC) emulation may not be reliable and can possibly corrupt the main OS disk partition midway through image deployment or feature staging. Re-attempting the below instructions by first formatting the main OS partition and then modifying the setup BCD store to use one CPU core (located as <code>EFI\Microsoft\Boot\BCD</code> in the installation media) via the command below may help significantly improve the chances of a successful installation, at the expense of additional time due to the lack of multi-threading:<syntaxhighlight lang="batch">
* 在一些特殊情况下,[[wikipedia:Secure_Digital|数字安全]] [[wikipedia:MultiMediaCard|多媒体卡]] (SDMMC) 模拟并不稳定,可能会在安装阶段损坏主系统安装分区。若要解决该问题,可先重新格式化安装分区,对安装介质中的BCD文件 (位于安装介质中的 <code>EFI\Microsoft\Boot\BCD</code> ) 可以提高安装成功的概率,但是由于单线程的性能问题会导致安装过程更加漫长:<syntaxhighlight lang="batch">
bcdedit /offline /store M:\EFI\Microsoft\Boot\BCD /set {default} NUMPROC 1
bcdedit /offline /store M:\EFI\Microsoft\Boot\BCD /set {default} NUMPROC 1
</syntaxhighlight>
</syntaxhighlight>
* USB HID device emulation is unstable and will occasionally result in devices failing to register any user inputs. To restore input, switch to the QEMU compatibility monitor ({{key press|Ctrl|Alt|2}}) and run the following commands:<syntaxhighlight lang="batch">
* USB HID模拟很不稳定,可能会出现任何输入无效的情况,为解决该情况, 请切换到QEMU 监视器 ({{key press|Ctrl|Alt|2}}) 并运行一下命令:<syntaxhighlight lang="batch">
device_del kbd
device_del kbd
device_add usb-kbd,id=kbd
device_add usb-kbd,id=kbd
</syntaxhighlight>
</syntaxhighlight>
* For builds prior to [[Windows 8 build 7957|7957]] (excluding builds [[Windows 8 build 7792|7792]] and [[Windows 8 build 7822|7822]]), it is critical that the [[Windows Setup]] boot image be substituted with the [[Windows Preinstallation Environment]] image from the original partner drop (ordinarily located in the <code>winpe</code> or <code>woape</code> directories), as the Setup boot image does not contain the required hardware abstraction layer (HAL) extensions, and will therefore cause the operating system to immediately bugcheck with code <code>HAL_INITIALIZATION_FAILED</code> as soon as the boot sequence starts.
* 对于 [https://wiki.win-story.cn/wiki/Windows_8_Build_7957.0.fbl_core1_kernel_npc.110302-1700 7957.0.fbl_core1_kernel_npc.110302-1700]之前的版本 (不包括 [https://wiki.win-story.cn/wiki/Windows_8_Build_7792.0.winmain.100802-1750 7792.0.winmain.100802-1750] [https://wiki.win-story.cn/wiki/Windows_8_Build_7822.0.fbl_core1_kernel_npc_ext.100930-1700 7822.0.fbl_core1_kernel_npc_ext.100930-1700]), 需要将  [https://wiki.win-story.cn/wiki/Windows_%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F Windows安装程序] wim启动镜像替换为原始泄漏压缩包中单独的 [https://wiki.win-story.cn/wiki/Windows_%E9%A2%84%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83 Windows预安装环境] wim启动镜像 (一般位于 <code>winpe</code> 或者 <code>woape</code> 文件夹中), 原因为原始安装介质的启动必须驱动中缺少在Tegra 2 HAL启动所需的硬件抽象层(HAL)驱动, 启动会导致系统发生错误检查 <code>HAL_INITIALIZATION_FAILED</code>
*This guide is not for build 7915 due to it being designed to run on Texas Instruments OMAP4 and won't run on the Tegra 2 QEMU. It is required to use QEMU-woa instead.
*此教程不适合  [https://wiki.win-story.cn/wiki/Windows_8_Build_7915.0.fbl_core1_kernel_npc_ext.110131-1820][[Windows 8 Build 7915.0.fbl core1 kernel npc ext.110131-1820|7915.0.fbl_core1_kernel_npc_ext.110131-1820]]的启动,由于第一次泄漏为德州仪器针对OMAP4设备进行设计,不适合在tegra 2设备运行,需要另一版本qemu添加相关驱动进行修改后以运行该构建。
===Instructions===
===详细设置===
These instructions assume that the user has an elevated command prompt window open.
这些说明基于命令提示符在管理员权限下运行。


Create the needed virtual disk images through the <code>diskpart</code> utility by running the below script; they will be created under a directory in the C: drive named <code>ARM8</code>. The <code>INSTALL</code>, <code>MainOS</code> and EFI system partitions will be respectively mounted under drive letters F and P.
通过运行以下脚本,通过系统程序创建所需的虚拟磁盘映像;假定我们在 C: 驱动器中名为<code>ARMv7Tegra2</code>的目录下创建,并将 EFI 系统分区和系统主分区分别挂载在驱动器号 F P 下。<syntaxhighlight lang="batch">
<syntaxhighlight lang="batch">
create vdisk file="C:\ARM8\Setup.vhd" maximum=4096 type=expandable
create vdisk file="C:\ARM8\Setup.vhd" maximum=4096 type=expandable
select vdisk file="C:\ARM8\Setup.vhd"
select vdisk file="C:\ARM8\Setup.vhd"
第 42 行: 第 41 行:
</syntaxhighlight>
</syntaxhighlight>


Depending on the users' desired build flavor (free or checked), copy the contents of the installation media over to the <code>INSTALL</code> partition. Extract the needed EFI boot manager (<code>\Windows\Boot\EFI\bootmgfw.efi</code>) from the [[Windows PE]] or [[Windows Setup]] boot image to <code>INSTALL</code>, as <code>EFI\Boot\bootarm.efi</code>.
根据所需的构建类型(fre或者chk),将安装介质的内容复制到分区。将所需的 EFI 启动管理器 (<code>\Windows\Boot\EFI\bootmgfw.efi</code>) [https://wiki.win-story.cn/wiki/Windows_%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F Windows安装程序] wim启动镜像或者 [https://wiki.win-story.cn/wiki/Windows_%E9%A2%84%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83 Windows预安装环境] 中的相关启动文件复制到 <code>EFIESP分区</code>,位于 <code>EFI\Boot\bootarm.efi</code>.


Eject all currently attached virtual disks from the machine, and paste and run the contents of the below script onto a batch file within the QEMU installation directory, replacing <code>FWType</code> with either the <code>78xx</code> variant firmware (for early builds up to [[Windows 8 build 7898|7898]]) or the <code>multi</code> variant (for builds 7898 through [[Windows 8 build 7996 (fbl_multimedia_media_sndproc)|build 7996]]):{{efn|name="quad2g"|If utilizing the quad-core variant of the Tegra 2 WoA fork, the machine configuration in the batch script must be modified to address 2 GB of RAM, and the patched <code>2g</code> EFI firmware capsules must also be used to start up the virtual machine. The <code>multi2g</code> combination can be used to immediately boot into builds 8020 through 8061; if this combination is not being used, then necessary registry modifications against the <code>SYSTEM</code> hive to load Tegra 2 HAL extension IDs <code>VEN_ra2.&DEV_0002</code> (<code>HalExtTegra2.dll</code>) and <code>VEN_ra2.&DEV_0003</code> (<code>HalExtTegra2Dma.dll</code>; in later builds, <code>HalExtTegraDma.dll</code>) are required.}}
从计算机中弹出所有当前连接的虚拟磁盘,然后将以下脚本的内容粘贴到 QEMU 安装目录中的批处理文件上并运行,替换为修改后的固件(适用于 早于7898 的早期版本)或其他固件(适用于版本 7898 到内部版本 7996):{{efn|name="quad2g"|If utilizing the quad-core variant of the Tegra 2 WoA fork, the machine configuration in the batch script must be modified to address 2 GB of RAM, and the patched <code>2g</code> EFI firmware capsules must also be used to start up the virtual machine. The <code>multi2g</code> combination can be used to immediately boot into builds 8020 through 8061; if this combination is not being used, then necessary registry modifications against the <code>SYSTEM</code> hive to load Tegra 2 HAL extension IDs <code>VEN_ra2.&DEV_0002</code> (<code>HalExtTegra2.dll</code>) and <code>VEN_ra2.&DEV_0003</code> (<code>HalExtTegra2Dma.dll</code>; in later builds, <code>HalExtTegraDma.dll</code>) are required.}}
<syntaxhighlight lang="batch">
<syntaxhighlight lang="batch">
set BL=".\fw\HARMONY.fd.FWType"
set BL=".\fw\HARMONY.fd.FWType"
第 60 行: 第 59 行:
</syntaxhighlight>
</syntaxhighlight>


Start installing the operating system. Setup must be directly invoked from the original installation media as the version in the OS boot image does not function.<!-- staging doesn't work in build 7792 through ~mid-/late 78xx, and MS recommends starting setup from the install media per official documentation --> The following command may be used to start the installation process:<syntaxhighlight lang="batch">
开始安装操作系统。必须直接从原始安装媒体启动安装程序,因为替换后的启动镜像中安装程序不起作用。运行以下命令可用于启动安装过程:<syntaxhighlight lang="batch">
start D:\sources\setup.exe
start D:\sources\setup.exe
</syntaxhighlight>
</syntaxhighlight>


Immediately after completing the first phase of setup, remove the SD slot for the installation media and boot into the operating system by using the below batch script configuration:{{efn|name="quad2g"}}
完成第一阶段的设置后,立即删除安装介质的 SD 插槽设备,并运行以下批处理脚本配置启动到操作系统:{{efn|name="quad2g"}}
<syntaxhighlight lang="batch">
<syntaxhighlight lang="batch">
set BL=".\fw\HARMONY.fd.FWTYPE"
set BL=".\fw\HARMONY.fd.FWTYPE"
第 78 行: 第 77 行:
</syntaxhighlight>
</syntaxhighlight>


Continue installing the operating system through normal means.
之后可以继续通过正常方式进行操作系统的sysprep阶段以及OOBE阶段。
114

个编辑