想高台坐论windows,linux,ce,ucos....你好我好,至少了解才能比较吧?<br />linux和ucos的容易获得,<br />windows的内核代码和编译环境,我给出一个线索<br />下载关键字:windows research kernel.<br /><br /><br /><br /><br />WRK v1.2<br /><br />The Windows Research Kernel v1.2 contains the sources for the core of<br />the Windows (NTOS) kernel and a build environment for a kernel that will run on<br /> x86 (Windows Server 2003 Service Pack 1) and<br /> AMD64 (Windows XP x64 Professional)<br />A future version may also support booting WRK kernels on Windows XP x86 systems,<br />but the current kernels will fail to boot due to differences in some shared structures.<br /><br />The NTOS kernel implements the basic OS functions<br />for processes, threads, virtual memory and cache managers, I/O management,<br />the registry, executive functions such as the kernel heap and synchronization,<br />the object manager, the local procedure call mechanism, the security reference<br />monitor, low-level CPU management (thread scheduling, Asynchronous and Deferred<br />Procedure calls, interrupt/trap handling, exceptions), etc.<br /><br />The NT Hardware Abstraction Layer, file systems, network stacks, and device<br />drivers are implemented separately from NTOS and loaded into kernel mode<br />as dynamic libraries. Sources for these dynamic components are not included<br />in the WRK, but some are available in various development kits published<br />by Microsoft, such as the Installable File System (IFS) Kit and the<br />Windows Driver Development Kit (DDK).<br /><br />WRK v1.2 includes most of the NTOS kernel sources from the latest released<br />version of Windows, which supports the AMD64 architecture on the Desktop.<br />The kernel sources excluded from the kit are primarily in the areas of<br />plug-and-play, power management, the device verifier, kernel debugger<br />interface, and virtual dos machine. The primary modifications to WRK<br />from the released kernel are related to cleanup and removal of server<br />support, such as code related to the Intel IA64.<br /><br />***<br /><br />Organization of the WRK sources<br /><br />The file License.txt contains the license covering use of the WRK.<br /><br />The public\ directory contains a number of include files shared among system<br />components. base\ntos\ contains the NTOS sources.<br /><br />The primary NTOS source components included in the WRK are organized as follows:<br /><br /> cache\ - cache manager<br /> config\ - registry implementation<br /> dbgk\ - user-mode debugger support<br /> ex\ - executive functions (kernel heap, synchronization, time)<br /> fsrtl\ - file system run-time support<br /> io\ - I/O manager<br /> ke\ - scheduler, CPU management, low-level synchronization<br /> lpc\ - local procedure call implementation<br /> mm\ - virtual memory manager<br /> ob\ - kernel object manager<br /> ps\ - process/thread support<br /> se\ - security functions<br /> wmi\ - Windows Management Instrumentation<br /><br /> inc\ - NTOS-only include files<br /> rtl\ - kernel run-time support<br /> init\ - kernel startup<br /><br />***<br /><br />Two of the best existing sources for documentation of the NTOS kernel are<br /><br /> Microsoft Windows Internals, 4th Ed 2005, Mark Russinovich and David Solomon<br /><br /> The Windows Curriculum Resource Kit (CRK)<br /> http://www.msdnaa.net/curriculum/pfv.aspx?ID=6191<br /><br />Additional information about using Windows for teaching and research<br />in operating systems is available at<br /><br /> http://www.microsoft.com/resources/sharedsource/Licensing/WindowsAcademic.mspx<br /><br />Specific questions about use of the WRK, CRK, or ProjectOZ can be directed to<br /><br /> compsci@microsoft.com<br /><br />Questions about the kernel sources (or CRK or ProjectOZ) can be directed to<br />the MSDN academic forum groups (http://forums.microsoft.com/WindowsAcademic)<br /><br /> Curriculum<br /> A discussion forum regarding development of operating systems curriculum<br /> based on the Windows kernel, including use of the Windows Curriculum<br /> Resource Kit, the Windows Research Kernel, and ProjectOZ.<br /><br /> Kernel <br /> Questions & Answers regarding the Windows Research Kernel,<br /> its architecture, source code and use in teaching and research.<br /><br /> ProjectOZ<br /> Questions & Answers regarding use of ProjectOZ for teaching and<br /> research of operating systems topics.<br /><br />***<br /><br />Building/deploying a WRK kernel for x86 [or amd64]<br /><br /> 0. Copy the WRK into a directory, say %wrk%. <br /> 1. set arch=x86 [or amd64]<br /> 2. path %wrk%\tools\%arch%;%path%<br /> 3. cd %wrk%\base\ntos<br /> 4. nmake -no** %arch%=<br /> will produce kernel files in BUILD\EXE\%arch%<br /> [wrkx86.* or wrkx64.*]<br /> 5. copy the kernel to %SystemRoot%\system32\<br /> 6. if x86, find the Multi-processor version of hal.dll [see below]<br /> 7. add a line to C:\boot.ini of the target system<br /> to boot this kernel and the MP hal [see below]<br /> 8. reboot and select the boot option for the new kernel<br /> 9. you will boot up on a kernel you built/linked yourself!<br /> [always keep the original boot.ini line and kernel/hal available so you<br /> can still boot your system if something fails with your WRK kernel modifications]<br /> 10. set up a debugger [see below]<br /><br />Multi-processor hal (x86 only, amd64 hals are all MP)<br /> All hals are renamed hal.dll, so you have to use the link command to<br /> see what type of hal hal.dll really is:<br /> link -dump -all hal.dll | findstr pdb<br /> The MP hals have an 'm' in the native name of the hal, e.g. halmacpi.dll<br /> You may already have an MP hal installed on UP systems, due to hyperthreading.<br /> If the hal isn't MP, you need to find the MP hal that corresponds to the current hal<br /> the target system does have, i.e. <br /> halacpi.dll -> halacpim.dll ; ACPI PIC-based PC [used by VirtualPC]<br /> halaacpi.dll -> halmacpi.dll ; ACPI APIC-based PC<br /> halapic.dll -> halmps.dll ; MPS<br /> Look in the WRK WS03SP1HALS\x86 directory for the MP hal you need.<br /><br />Boot.ini<br /> Edit boot.ini (you may have to use attrib -h -s -r first)<br /> Copy the line for the first operating system listed to the end of the file and edit it.<br /> [boot loader]<br /> timeout=30<br /> default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS<br /> [operating systems]<br /> multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Windows Server 2003, Standard"<br /> multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="test" /kernel=wrkx86.exe /hal=halmacpi.dll<br /> Note that the filenames must be short (8.3) names.<br /> You can add additional options for debugging (as specified in the WinDbg/KD help).<br /><br />Debugging WRK<br /> The WinDBG/KD debuggers will work with the WRK. The documentation is pretty thorough, and<br /> includes information about how to debug across a serial port, locally (examining kernel <br /> data from user-mode), and debugging kernels running on VirtualPC.<br /><br /> Version 6.6.3.5 of the WinDBG/KD debuggers is available with the Curriculum Resource Kit<br /> Tools ("CurriculumResourceKit-CRK\CRKTools\Debugging Tools" directory on the CD). <br /> The latest version of the Windows Debugging Tools can be downloaded from<br /> http://www.microsoft.com/whdc/devtools/debugging.<br /> |
|