Use VS2012 to debug ReactOS source code

Source: Internet
Author: User

Directory

    1. Download and install VS2012
    2. Two download and install WDK80
    3. Three download ReactOS0315 source code
    4. Four download and install RosBE211
    5. Five use ROSBE command line compile ReactOS source code
    6. VI compiling NTOSKRNL module with VS2012
    7. Seven Production ReactOS installation disk
    8. Eight with VirtualBox installation ReactOS
    9. Nine setting up the debugging environment
    10. Ten debugging ReactOS source code
One. Download and install VS2012

I installed the vs2012_ult_chs.iso, the Internet download freely

Two. Download and install WDK8.0

: http://msdn.microsoft.com/zh-cn/windows/hardware/hh852365

After installing the VS2012, you will find that there are some driver items in the new project, and there is a menu item on the MenuBar driver

Three. Download ReactOS0.3.15 source code

: http://download.reactos.org/reactos/ReactOS/0.3.15/

Download Reactos-0.3.15-rel-src.zip and unzip to D:\ReactOS

Four. Download and install RosBE2.1.1

: HTTP://DOWNLOAD.REACTOS.ORG/REACTOS/ROSBE-WINDOWS/I386/2.1.1/

Download Rosbe-2.1.1.exe, after installation, remember to import the generated registry file, and then add the bin directory to the environment variable path

My installation path is D:\ProgramFiles\RosBE, add D:\ProgramFiles\RosBE\Bin to the environment variable path

Five. Compile ReactOS source code with rosbe command line

1. Double-click ReactOS Build Environment to enter the compilation environment, because the ReactOS source location is selected when installing ROSBE, so it automatically enters the D:\ReactOS

2. Enter Configure.cmd to generate the directory output-mingw-i386

3. Enter CD Output-mingw-i386\host-tools, enter D:\ReactOS\output-MinGW-i386\host-tools, enter make compile build tools

4. Enter the CD. \reactos, enter make BOOTCD, compile build Bootcd.iso

Six. Compiling the NTOSKRNL module with VS2012

1. Open VS2012 X86 command line tool, enter D:\ReactOS, enter configure.cmd vssolution generate directory Output-vs11-i386

2. The following folders or files need to be fixed, or during the compilation process due to coding problems error: http://download.csdn.net/detail/ayang1986/7731527. Kbdcz
D:\ReactOS\dll\keyboard\kbdcz\kbdcz.c. Kbdhu
D:\ReactOS\dll\keyboard\kbdhu\kbdhu.c. Butterflies
D:\ReactOS\modules\rosapps\applications\screensavers\butterflies\lang. Ctm
D:\ReactOS\modules\rosapps\applications\sysutils\ctm\lang. Cylfrac
D:\ReactOS\modules\rosapps\applications\screensavers\cylfrac\lang. Kernel32
D:\ReactOS\dll\win32\kernel32\winnls\nls. Matrix
D:\ReactOS\modules\rosapps\applications\screensavers\matrix\lang. Mazescr
D:\ReactOS\modules\rosapps\applications\screensavers\mazescr\lang. Ntvdm
D:\ReactOS\subsystems\ntvdm\lang. Starfield
D:\ReactOS\modules\rosapps\applications\screensavers\starfield\lang. Usetup
D:\ReactOS\base\setup\usetup\lang 3. Enter D:\ReactOS\output-VS11-i386\host-tools, open the project file REACTOS.sln, build All_build 4. Enter D:\ReactOS\output-VS11-i386\reactos, open the project file REACTOS.sln, compile the build all_build (long wait  ...........................................................................................)  Because we only use the NTOSKRNL generated by the engineering Ntoskrnl.exe, so you can only compile the project NTOSKRNL to save time! 5. Ntoskrnl.exe and ntoskrnl.pdb Seven should now be generated under the D:\ReactOS\output-VS11-i386\reactos\ntoskrnl\Debug directory. To make a ReactOS installation disk in the sixth step, In fact, we compile the project with VS20120 BootCD can also generate Bootcd.iso, but I do not know why in the virtual machine can not boot the installation, so we need to generate the fifth step Bootcd.iso 1. Use the disc image Editing Tool (UltraISO) to open the fifth step generated by Bootcd.iso 2. Replace the file of the same name in Bootcd.iso with the Kdcom.dll in the Ntoskrnl.exe and Window 2003 system generated by step sixth, and save to generate the new Bootcd.iso eight. Install VirtualBox with ReactOS

1. Download and install VirtualBox, I am using virtualbox-4.3.12-93733

2. Create a new virtual machine and select the Bootcd.iso to be loaded in step seventh

3. Setting the serial port parameters

4. Start the virtual machine, install ReactOS, it is recommended to select the English version to install. The installation process restarts once, followed by steps to 5. After the installation is complete, launch into the selection screen and select ReactOS (Debug) boot nine. Setting up a debugging environment

1. Open VS2012 (Win7, Win8 to run as Administrator), select Menu driver, Test, Configure Computers to open the Computer Configuration window

2. Click Add New Computer, enter the name of your real computer in Computer name: (not the name of the computer in the virtual machine), the bottom three options select the last item "Manually configure debuggers and do not PR Ovision ", Configuring debugging manually

3. Press to configure the debug parameters

Connection type selected as serial (serial port)
(baud rate) Baud Rate 115200
Pipeline Pipe tick
(Re-connect) Reconnect tick
(Pipe name) Pipe name \\.\pipe\com_debug
These options are set according to the virtual machine settings in step eighth.
Finally click Next to finish.

4. In vs2012, select Menu tool, attach to process, open attach to process window

Transfer: Windows Kernel Mode Debugger
Qualifier: The computer name that we added above

Select kernel process, click Attach to enter debug state

5. Tab+k interrupt is generated in the VirtualBox virtual machine, VS2012 captures the interrupt

10. Debug ReactOS Source code

1. In the VS2012 open source code file D:\REACTOS\NTOSKRNL\PS\PROCESS.C, at the function pspcreateprocess Press F9 the breakpoint

2. Press F5 to restore the virtual machine to run, and then run a program in the virtual machine to create a new process, then break the virtual opportunity to the location of the breakpoint you just set, and start debugging!!!generate ReactOS and VC projects with RosBE2.1

1. First download the source code and ROSBE from the website https://www.reactos.org

2. Install the ROSBE and select a good source directory

3. Enter the VS2010 command line environment and switch to the ROS source directory

4. If there is no CMake path that contains ROSBE

SET path=%path%;D: \rosbe\bin\ (This assumes that you are installing ROSBE in the Rosbe folder of the D drive)

Then execute Configure.cmd vssolution

Can generate VS2010 works in the Output-vs10-i386\reactos directory of the Ros source directory

Now we can browse the Ros source code.

A: ReactOS introduction

ReactOS is a Windows NT architecture (Windows XP, Windows 7, Windows Server 2012, etc.) design principle for the open-source operating system. Since all the code has been rewritten, ReactOS is not a Linux-based operating system and does not contain any UNIX architectures.

The main goal of the ReactOS project is to provide an operating system that is binary compatible with the Windows environment. It allows your Windows applications and drivers to run as if they were on Windows. Also, because of the appearance features of the Windows operating system, you are already familiar with Windows? Users of the user interface will be familiar with using ReactOS. ReactOS's ultimate goal is to enable you to use ReactOS without feeling the end user experience changes? To replace Windows.

Free software advocates agree that the improvement in the status of free software operating systems promotes competition, and ReactOS also benefits ReactOS is the most complete class windows® operating system work platform, therefore, Programmers involved in development need to spend a lot of time learning ReactOS source code and researching ReactOS development documentation.

ReactOS components are growing and compatibility is getting better, but ReactOS will not have any constraints. ReactOS has and will continue to absorb the latest version of the Win32 API to track and even develop the latest operating system technologies. Do what we can, use the latest technology, and constantly incorporate new features into the latest version. Simply put, the ReactOS goal is to use your hardware device to run your application, and finally, the creation of a FOSS operating system that anyone can use for free.

II: Overview of ReactOS functions

By the year 2005, the ReactOS kernel has been very stable, most of the APIs used for the development of the upper program have been made, and have a basic GUI window interface. ReactOS already has a ReactOS Explorer similar to the Windows browser as the System operator interface.

  • ReactOS version 0.2 can run quite a large number of WIN32 applications and have their own Notepad (Notepad, basic text editor), Regedit (System Registry Editor), CMD (command line prompt) and several other big applications (such as AbiWord Text editor) and some games (Quake and Quake Ii,wine's minesweeper clones).
  • 0.2.5 version of the main work is the sound card, network card driver support. The Lynx text web browser captures a screenshot of the webpage, but this feature remains to be improved. This version adds support for the Ext2 file system and GRUB boot loader, allowing ReactOS to coexist with the Linux partition.
  • Since the 0.2.6 version, Dillo, MIRC and web browser Mozilla Firefox's DCOM components can be run in ReactOS. Some games, such as Unreal Tournament and Deus Ex, are known to work in software rendering. Using the soft mode of Nvidia-driver or Mesa 3D, OpenGL runs with only a few minor problems. The first network server tiny Web server and the UltraVNC client announce a successful run. As you can see from the image on the right, OpenOffice (version 1.x) also has partial execution.
  • Some of the elements from version 0.2.8,TCP/IP start working, and there are many more applications such as Notepad, AbiWord, OpenOffice, Deus Ex and Unreal tournament. Sound and USB support is still in production (SB16 semi-work, USB OHCI and UHCI remain labor-intensive) USB features are "borrowed" from Cromwell. The development work, and WDM support for Plug and play have also been launched. In addition to the character Web browser Lynx,reactos, you can browse the Web page graphically using Mozilla's DCOM components.
  • ReactOS 0.2.8 detects if it is running in VMware and then installs the SVGA driver to the VMware Tools ISO to provide better GUI performance. CSRSS has been completely rewritten, and a "start-up" ws2_32 is expected to be completed soon. In the trunk there are some ddraw,dplay and dplayx elements that can work.

Three: ReactOS Open source website

ReactOS Open Source website URL: https://www.reactos.org/, the official website is as follows:

Three: ReactOS the schema of Open source code

Use an architectural picture of the ReactOS source code to illustrate that it is more valuable, as follows:

I download here is ReactOS-0.3.15, the latest version is React-0.3.16, we download the latest version of, I just want to research and understand the Windows NT kernel architecture, so the code version is not very important!

The source of the download URL is: http://sourceforge.net/projects/reactos/files/

Have time to slowly analyze reactos design ideas, of course, will also learn from the WinCE OS thought, the two combine to analyze it ...

1: First download the ReactOS be tool from Https://www.reactos.org/wiki/ReactOS_Build_Environment, the installation will let you specify the ReactOS source folder path, When the installation is complete, the desktop automatically generates a registry file that imports this registry file

2: Open the VS2012 command line tool, switch to the ReactOS source folder, type the command Configure.cmd vssolution, and then generate the VS project in the source directory. Over

ReactOS is an open-source operating system based on Windows NT architecture design principles. The main goal of the ReactOS project is to provide an operating system that is binary compatible with the Windows environment. It allows your Windows applications and drivers to run as if they were on Windows. In addition, users who are already familiar with the Windows user interface will be comfortable using ReactOS because of the appearance features of the Windows operating system. The ultimate goal of ReactOS is to enable you to replace Windows with ReactOS without feeling the end user experience changing.

Tools/Materials
    • VMware Workstation virtual Machines
    • React OS system image
Configuring virtual Machines
    1. 1 Open VMware Workstation and click Create New virtual machine
    2. 2 installation Source Select your pre-downloaded React OS image
    3. 3 Select the guest operating system. Because the VMware virtual machine does not provide a simple installation of the React OS OS, and because ReactOS is an open-source operating system based on the Windows NT Architecture design principles, select Windows NT as the guest operating system.
    4. 4 Change virtual machine name, installation location, etc... The disk size is chosen according to individual needs.
    5. 5 View the virtual machine configuration, complete the setup, and turn on the virtual machine.
React OS System Foundation Installation
    1. 1 after the virtual machine is turned on, the installation screen appears. Language is the best choice of English, if you choose Simplified Chinese "Chinese (PRC)", the worst case is in the future installation interface, the Chinese can not be displayed, the interface is full of boxes (there is a dense phobia of the million don't try Tat).
    2. 2 You can read English or not understand, anyway, after the hard press the ENTER key to the line (if you do not plan to partition). The general idea is to welcome the installation of the React OS, which is still in its early stages of development and does not perfectly support all basic applications, as well as installation configurations.
    3. 3 (If you plan to partition, when the following screen appears, press the up and down keys to select the system installation partition; Press ENTER to install the system in the highlighted partition, create the partition by C, and press D to delete the existing partition)
    4. 4 Format the partition. Fat and ext2 are available in two file system formats, where fat is used for Windows systems, and ext2 is used for Linux systems. (Both of these file system formats are old-fashioned ...) )
    5. 5 Select the installation root directory
    6. 6 press ENTER to start the installation
    7. 7 Install the boot program (MBR and UBR) on the hard disk as the first item. You choose the last one to do what ...
    8. The basic part of the 8React OS is installed, press ENTER to restart.
React OS driver installation and system basic setup
    1. 1 Each time there is this boot interface, the default first item is OK.
    2. 2 Welcome interface and GPL License viewing interface
    3. 3 Change the system settings and keyboard layout settings, fill in the user name and password, set the time zone and time
    4. 4 When installing VMware Tools, be sure to first install VMware tools in the virtual machine catalog, then click Next. (Press Ctrl+alt key to release the mouse) "Do not understand the reason to see English"
    5. 5 Complete the installation. Restart to explore React OS
Precautions
    • React OS is still in the Alpha pilot phase, it is recommended not to do more important work in the React OS environment.
    • React OS can be compatible with limited hardware and software, but the stability is better, and open source is free.
    • You can visit the React OS website or forum if you have problems after installation or after installation.

Use VS2012 to debug ReactOS source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.