Development Environment In GNU/Linux

Source: Internet
Author: User

Development Environment In GNU/Linux

In the work environment, virtual machines are a major issue. Therefore, we will introduce them separately before this chapter. In addition to virtual machines, there are several important things, including the editor, compiler, and the automation tool GNU make.
Many working in Linux use VI or Emacs as the editor. If you are interested in trying, I suggest you do not give up because you are not used to it at the beginning, because they are indeed a classic in the editor and are the same as those in Linux, has steep learning curves. Many people fall in love with them once they learn to use them, including the author himself. Of course, learning them is not necessary, and you have more options than the operating system. I believe there will be one that will satisfy you.
For compilers, we select GCC and NASM to compile C code and Assembly Code respectively. The reason for choosing GCC is simple. It is a de facto standard for compilers in the Linux World. The full name of GCC is GNU Compiler Collection. Here we only use the C compiler, so for us, all its meaning is only gnu c compiler, which is exactly the original name. As mentioned before, the Linux we use is actually called GNU/Linux. Therefore, it is quite convenient to use GCC. Why can't we use GCC to compile our assembly code? Why bother using NASM? The reason is that GCC requires that the assembly code be in at&t format, and its syntax will look strange to readers who are used to ibnmpc Assembly. I guess most readers may be the same as me, ibnmpc assembly is used to learn assembly languages. The official website of NASM is located here. You can also find detailed documentation on it.
For more information about GNU make, see Chapter 5th.
Or use Debian as an example. To install GCC and NASM, run the following command:
$ Sudo apt-Get install build-essential NASM
Note that the build-essential software package contains GCC and GNU make.
Now, we can summarize the following work if you want to build a Linux-based development environment:
• Install a Linux release. If you are not familiar with Linux, we recommend that you use ubuntu.
• Install the following content by using the package management tool of the Linux release or by manually downloading the source code:
O your favorite editor, such as Emacs.
O is the GCC used to compile C language code.
O is the NASM used to compile assembly code.
O gnu make for automated compilation and linking.
O a virtual machine that runs our operating system. We recommend using bochs.
Once again, if you encounter difficulties in installing or using them, Do not worry or be discouraged, because smooth sailing is rare in real life. You may try the following solutions (these methods also apply to other problems in the installation, configuration, and use of free software ):
• Ask for help from friends.
• Use the search engine to see if someone has encountered a similar problem. The solution may have been provided.
• Read Relevant documents carefully (do not be afraid of English), such as installation instructions or FAQs.
• Subscribe to the corresponding mailing list, as long as you can clearly describe the problem [17], you can usually get a response within several hours.
• Go to the Forum to ask questions.
• If it is really difficult, you can try to contact software developers, usually by means of a mailing list (the same project may have multiple mailing lists, and the developer's mailing list is usually separated from other ones ).
• Read the source code and solve it independently-this may be a challenge. However, once the problem is solved, you will gain the joy of knowledge, experience, and success.
In the future, if everything goes well, the steps when you write the operating system are likely to be as follows:
• Write code in the editor.
• Use make to call GCC, NASM, and other Linux tools to generate the kernel and write it into the disk image.
• Use bochs to run your operating system.
• If there is a problem:
O uses various methods for debugging, such as bochs;
O returns step 1.

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.