Development Environment in Windows

Source: Internet
Author: User
Article Title: development environment in Windows. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

We mentioned in QEMU that in Windows, you need a virtual Linux to help you compile the source code of the operating system. Compiling and linking the operating system kernel to the ELF format has many advantages. We can not only use the ready-made tools (such as readelf) in Linux to analyze the compiled kernel, we can also refer to the source code of the Linux kernel to help our own development when necessary. In short, this brings us closer to Linux. Therefore, it is easy to install a Linux system.

However, installing a virtual Linux is different from installing a real Linux, mainly in two aspects. First, we only want to use this Linux to compile links. Therefore, we try to remove unnecessary content when selecting components, which can save time and space; the second is to make sure that the virtual machine you selected is easy to communicate with the host machine over the network, because you need to give the source code on the host machine for compilation.

There are multiple options for the installation method. The simple method is to install it on a CD. Of course, the CD can also be "virtual", that is, a CD image. First download an image for the installation of the CD from the official website of your favorite Linux release. Some releases also provide free or paid mail services. You can choose one as you like. Assume that you have obtained a CD image named inst. iso.

With the CD image, we still lack a hard disk image. You can use the bximage mentioned above to generate it, or use the following command:

$ Qemu-img create hd. img 1500 M

In this way, a hard disk image of about GB can be generated.

Next we can install it:

$ Qemu-cdrom inst. iso-hda hd. img-boot d

During the installation process, try to streamline your components as much as possible. Do not install too many useless things. These components are required for us: GCC, GNU Make, NASM, Samba. If they are not installed by default during installation, you need to install them after the system installation is complete. Currently, most virtual machines have easy-to-use network functions, so it is not difficult to install them.

After installation, we also need to solve the problem of making the host machine communicate with the virtual machine. In fact, you can regard them as two machines in the LAN. the method used in the LAN is also applicable here, So Samba is very suitable.

First, share a folder in a read/write mode in Windows, assuming it is called OrangeS, and then run the following command on virtual Linux:

$ Sudo mount-t smbfs-o username = user, password = blah //

Assume that your host IP address is In this way, you can see the content in the Windows shared folder under the/mnt directory of Linux. You can read and write the content in the virtual machine at will, just like treating local files.

In this way, your compiling environment is installed. Next, you need an editor, just like in Linux. It is said that some people always use notepad to write code. For whatever reason, I hope you will not do this, because you can find many editors that are more suitable for coding than notepad, there are charges and free items. They usually have keyword color, automatic indentation, and other convenient functions for developers, which can greatly improve work efficiency.


To sum up, you need to do the following to build a development environment in Windows:

· Install Windows.

· Install Bochs (the installer can be obtained from its official website ).

· Install an editor you like to write code.

· Install a fast virtual machine, such as QEMU (the installer can be obtained from its official website }).

· Install a Linux instance on a fast-paced virtual machine.

· Install GCC, GNU Make, NASM, and Samba in virtual Linux -- if they are not installed by default.

· Share a read/write folder between a virtual Linux instance and a host.

In the future, your development process may look like this:

· Compile code in the editor in Windows.

· Use Make in virtual Linux to call GCC, NASM, and other tools to generate the kernel and write it into the disk image.

· Use Bochs in Windows to run your operating system.

· If there is any problem.

O uses various methods for debugging, such as Bochs;

O returns step 1.


Now, I believe that you already know how to build your own development environment. To put it bluntly, the difference between it and developing a common software is basically on a virtual machine. It is both our "hardware" and our debugger. With it, we feel more at ease. Can we start our development of the operating system right away? Sorry, you cannot worry about it because you know that the operating system is closely connected to the hardware. If you want to implement an operating system running on an ibm pc using the IA32 architecture, you must have relevant knowledge. Among them, the most important thing is the 32-bit Intel CPU operating mechanism. After all, CPU is the brain of a computer and the core of the entire computer system.

So what we need to learn is to understand the IA32 protection mode. Only when we master the protection mode can we know how Intel's CPU runs in 32-Bit mode, so that we can write a 32-bit operating system.

Related Article

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: 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.