亲自翻译 Windows Research Kernel v1.2 readme.txt

Copyright (c) Microsoft Corporation. All rights reserved.
这句就不用翻译了吧……

You may only use this code if you agree to the terms of
the Windows Research Kernel Source Code License agreement
(see License.txt).  If you do not agree to the terms, do not use the code.

你只有同意 Windows 研究内核源代码协议(见License.txt) 才能使用这些代码。
如果你不同意,请不要使用这些代码。

***

WRK v1.2

The Windows Research Kernel v1.2 contains the sources for the core of
the Windows (NTOS) kernel and a build environment for a kernel that will run on
    x86     (Windows Server 2003 Service Pack 1) and
    AMD64   (Windows XP x64 Professional)
A future version may also support booting WRK kernels on Windows XP x86 systems,
but the current kernels will fail to boot due to differences in some shared structures.

Windows 研究内核 v1.2 包含了Windows 的内核代码以及一个编译内核的环境,这个内核能够在x86  (Windows Server 2003 Service Pack 1)  和 AMD64   (Windows XP x64 Professional) 上运行。一个未来的版本可能会支持在 Windows XP x86 系统上启动内核。但是目前的版本不行,因为在一些共享的结构上存在差异。

The NTOS kernel implements the basic OS functions
for processes, threads, virtual memory and cache managers, I/O management,
the registry, executive functions such as the kernel heap and synchronization,
the object manager, the local procedure call mechanism, the security reference
monitor, low-level CPU management (thread scheduling, Asynchronous and Deferred
Procedure calls, interrupt/trap handling, exceptions), etc.

这个 NTOS 内核实现了一些基础的操作系统函数,包括进程、线程、虚拟内存、高速缓存管理器、输入输出管理,内核堆和同步的注册、执行函数、对象管理器、本地过程调用机制、安全参考监视器、低水平的 CPU 管理(线程调度,异步以及延迟过程调用,中断/陷阱处理,异常处理),等等

The NT Hardware Abstraction Layer, file systems, network stacks, and device
drivers are implemented separately from NTOS and loaded into kernel mode
as dynamic libraries.  Sources for these dynamic components are not included
in the WRK, but some are available in various development kits published
by Microsoft, such as the Installable File System (IFS) Kit and the
Windows Driver Development Kit (DDK).

NT 硬件抽象层,文件系统,网络堆栈。设备驱动程序被从 NTOS 中分离了出来,以动态链接库的方式运行在内核模式。这些动态组件的源代码并没有被包含在 WRK 中,但是其中的某一些可以在微软发布的各种开发包中找到,例如设备文件系统开发包和 Windows 驱动开发套件。

WRK v1.2 includes most of the NTOS kernel sources from the latest released
version of Windows, which supports the AMD64 architecture on the Desktop.
The kernel sources excluded from the kit are primarily in the areas of
plug-and-play, power management, the device verifier, kernel debugger
interface, and virtual dos machine.  The primary modifications to WRK
from the released kernel are related to cleanup and removal of server
support, such as code related to the Intel IA64.

WRK v1.2 包含了 NTOS 内核的大部分源代码,这些代码来自最新发布版的 Windows。它支持 AMD64 结构的桌面。内核代码中不包含的代码主要在即插即用、电源管理、设备校验、内核调试接口以及 DOS 虚拟机。从发布版内核到 WRK 主要的修改与清除和移去服务(器?)支持有关,例如与 Intel IA64 有关的代码。

***

Organization of the WRK sources

WRK 源代码的组织

The file License.txt contains the license covering use of the WRK.

License.txt 文件包含了使用 WRK 所需要遵循的协议。

The public\ directory contains a number of include files shared among system
components.  base\ntos\ contains the NTOS sources.

public\ 目录包含了系统组件共享的一些包含文件。base\ntos\ 目录下包含了 NTOS 的源代码。

The primary NTOS source components included in the WRK are organized as follows:

WRK 中主要的 NTOS 源代码按如下方式组织:

    cache\  - cache manager
    config\ - registry implementation
    dbgk\   - user-mode debugger support
    ex\     - executive functions (kernel heap, synchronization, time)
    fsrtl\  - file system run-time support
    io\     - I/O manager
    ke\     - scheduler, CPU management, low-level synchronization
    lpc\    - local procedure call implementation
    mm\     - virtual memory manager
    ob\     - kernel object manager
    ps\     - process/thread support
    se\     - security functions
    wmi\    - Windows Management Instrumentation

    inc\    - NTOS-only include files
    rtl\    - kernel run-time support
    init\   - kernel startup

   cache\  - 高速缓存管理器
    config\ - 注册实现
    dbgk\   -用户模式调试器支持
    ex\     - 执行功能 (内核堆, 同步, 时间)
    fsrtl\  - 运行时文件系统支持
    io\     - 输入输出管理器
    ke\     - 调度程序, CPU 管理, 低水平的同步
    lpc\    - 本地过程调用实现
    mm\     - 虚拟内存管理器
    ob\     - 内核对象管理器
    ps\     - 进程/线程支持
    se\     - 安全功能体
    wmi\    - Windows 管理装置

    inc\    - NTOS 包含文件
    rtl\    - 运行时内核支持
    init\   - 内核启动

***

Two of the best existing sources for documentation of the NTOS kernel are

现有的两个关于 NTOS 内核最好的文档是:

    Microsoft Windows Internals, 4th Ed 2005, Mark Russinovich and David Solomon

    The Windows Curriculum Resource Kit (CRK)
    http://www.msdnaa.net/curriculum/pfv.aspx?ID=6191

Additional information about using Windows for teaching and research
in operating systems is available at

使用 Windows 进行教学和研究操作系统的更多信息可以访问以下网址:

    http://www.microsoft.com/resourc ... indowsAcademic.mspx

Specific questions about use of the WRK, CRK, or ProjectOZ can be directed to

关于使用 WRK, CRK, 或者 ProjectOZ 特殊问题可以发邮件到:

    compsci@microsoft.com

Questions about the kernel sources (or CRK or ProjectOZ) can be directed to
the MSDN academic forum groups (http://forums.microsoft.com/WindowsAcademic)

关于内核代码(或者 CRK 或者 ProjectOZ)的任何疑问可以前往 MSDN academic forum groups (http://forums.microsoft.com/WindowsAcademic)


    Curriculum
        A discussion forum regarding development of operating systems curriculum
        based on the Windows kernel, including use of the Windows Curriculum
        Resource Kit, the Windows Research Kernel, and ProjectOZ.

    课程
        一个基于 Windows 内核开发操作系统的讨论论坛
        包括 Windows 课程资源包的使用, WRK 和 ProjectOZ.

    Kernel
        Questions & Answers regarding the Windows Research Kernel,
        its architecture, source code and use in teaching and research.

    内核
        关于 WRK 的问答,它的结构,源代码在教学研究中的使用

    ProjectOZ
        Questions & Answers regarding use of ProjectOZ for teaching and
        research of operating systems topics.

    ProjectOZ
        使用 ProjectOZ 进行操作系统主题的教学研究的问答

***

Building/deploying a WRK kernel for x86 [or amd64]

为 x86 [或者 amd64] 建立/配置一个 WRK 内核:

    0. Copy the WRK into a directory, say %wrk%.  
    1. set arch=x86 [or amd64]
    2. path %wrk%\tools\%arch%;%path%
    3. cd %wrk%\base\ntos
    4. nmake -nologo %arch%=
        will produce kernel files in BUILD\EXE\%arch%
        [wrkx86.* or wrkx64.*]
    5. copy the kernel to %SystemRoot%\system32\
    6. if x86, find the Multi-processor version of hal.dll [see below]
    7. add a line to C:\boot.ini of the target system
        to boot this kernel and the MP hal [see below]
    8. reboot and select the boot option for the new kernel
    9. you will boot up on a kernel you built/linked yourself!
        [always keep the original boot.ini line and kernel/hal available so you
         can still boot your system if something fails with your WRK kernel modifications]
    10. set up a debugger [see below]

    0. 把 WRK 复制到一个目录中, 称之为 %wrk%.  
    1. 设置 arch=x86 [或 amd64]
    2. path %wrk%\tools\%arch%;%path%
    3. cd %wrk%\base\ntos
    4. nmake -nologo %arch%=
        将会把内核文件产生到 BUILD\EXE\%arch% 中
        [wrkx86.* 或 wrkx64.*]
    5. 把内核复制到 %SystemRoot%\system32\
    6. 如果是 x86, 找到 hal.dll 的多处理器版本[见下面]
    7. 在 C:\boot.ini 为目标系统中添加一行
        以便引导内核和 MP 硬件抽象层 [见下面]
    8. 重启并选择新内核的启动选项
    9. 你将会以你自己建立/连接的内核启动!
        [总是保持原有的 boot.ini 和 kernel/hal 可用,这样当 WRK 启动失败的时候你仍然可以启动你的系统]
    10. 启动一个调试器[见下面]

Multi-processor hal (x86 only, amd64 hals are all MP)
    All hals are renamed hal.dll, so you have to use the link command to
    see what type of hal hal.dll really is:
        link -dump -all hal.dll | findstr pdb
    The MP hals have an 'm' in the native name of the hal, e.g. halmacpi.dll
    You may already have an MP hal installed on UP systems, due to hyperthreading.
    If the hal isn't MP, you need to find the MP hal that corresponds to the current hal
    the target system does have, i.e.
        halacpi.dll  -> halacpim.dll    ; ACPI PIC-based PC  [used by VirtualPC]
        halaacpi.dll -> halmacpi.dll    ; ACPI APIC-based PC
        halapic.dll  -> halmps.dll      ; MPS
    Look in the WRK WS03SP1HALS\x86 directory for the MP hal you need.

多处理器硬件抽象层 (只针对 x86 , amd64 hals 都是 MP 的)
    所有的硬件抽象层都被重命名为 hal.dll, 所以你必须使用连接命令究竟是何种 hal.dll :
        link -dump -all hal.dll | findstr pdb
    多处理器硬件抽象层在本地硬件抽象层的名称中有一个字母 'm' , 例如 halmacpi.dll
    由于超线程,你可能已经在一个 UP 系统上安装了一个 MP 硬件抽象层。
    如果硬件抽象层不是 MP, 你需要找到与目标系统当前拥有的 hal 相对应的 MP hal
    也就是:
        halacpi.dll  -> halacpim.dll    ; ACPI PIC-based PC  [used by VirtualPC]
        halaacpi.dll -> halmacpi.dll    ; ACPI APIC-based PC
        halapic.dll  -> halmps.dll      ; MPS
    在 WRK WS03SP1HALS\x86 目录中寻找你所需要的 MP hal.

Boot.ini
    Edit boot.ini (you may have to use attrib -h -s -r first)
    Copy the line for the first operating system listed to the end of the file and edit it.
        [boot loader]
        timeout=30
        default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
        [operating systems]
        multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows Server 2003, Standard"
        multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="test" /kernel=wrkx86.exe /hal=halmacpi.dll
    Note that the filenames must be short (8.3) names.
    You can add additional options for debugging (as specified in the WinDbg/KD help).

Boot.ini
   编辑 boot.ini (你可能需要先使用 attrib -h -s -r)
    把列出来的第一个操作系统的那一行复制到文件尾部并编辑它.
        [boot loader]
        timeout=30
        default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
        [operating systems]
        multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows Server 2003, Standard"
        multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="test" /kernel=wrkx86.exe /hal=halmacpi.dll
    注意文件名必须是短文件名.
    你可以为调试器添加一个额外的项 (按照 WinDbg/KD 帮助手册中的说明).

Debugging WRK
    The WinDBG/KD debuggers will work with the WRK.  The documentation is pretty thorough, and
    includes information about how to debug across a serial port, locally (examining kernel
    data from user-mode), and debugging kernels running on VirtualPC.

    Version 6.6.3.5 of the WinDBG/KD debuggers is available with the Curriculum Resource Kit
    Tools ("CurriculumResourceKit-CRK\CRKTools\Debugging Tools" directory on the CD).  
    The latest version of the Windows Debugging Tools can be downloaded from
    http://www.microsoft.com/whdc/devtools/debugging.

调试 WRK
    WinDBG/KD 调试器能够与 WRK 一起工作.  文档非常完整, 并且包含了如何通过一个串口行调试的信息,
     局部的 (从用户模式检查内核数据), 并调试在 VirtualPC 上运行的内核.

    6.6.3.5 版本的 WinDBG/KD 调试器已经在课程资源包中提供了。
   工具(CD 中的"CurriculumResourceKit-CRK\CRKTools\Debugging Tools" 目录).  
    Windows 调试工具的最新版本可以在http://www.microsoft.com/whdc/devtools/debugging.下载

相关文章
1556条评论
  • 雨云

    雨云

    2009年12月09日 09:03:55

    英语好棒

  • 星空泪

    星空泪

    2009年12月09日 20:26:24

    …………

留下评论

电子邮件地址不会被公开。 必填项已用*标注