Build a Linux development environment

Source: Internet
Author: User
Tags bz2

The development Environment (software development environment) refers to the set of software that is used to support the engineering development and maintenance of system software and application software, which is referred to as SDE, on the basis of basic hardware and host software. It is composed of software tools and environment integration mechanism, which is used to support the related processes, activities and tasks of software development, which provides unified support for tool integration and software development, maintenance and management.

In particular, as an embedded developer, due to the characteristics of embedded systems, there must be a set of embedded development environment. The embedded development environment is diverse, but the Linux development environment is more common. To build a Linux development environment, you first need to install the Linux operating system. Ubuntu is undoubtedly a good choice for many versions of Linux operating systems.

Ubuntu is a desktop application-oriented Linux operating system. Ubuntu has many advantages. It has its own advantages over other versions of Linux,ubuntu. First of all, the installation system is very simple, only requires very few settings, secondly, the graphical interface is very user-friendly, completely comparable to the Windows desktop system, as well as the installation and upgrade of the program, you can use the network, the system self-install dependent packages, No longer have to worry about the dependencies of Linux systems.

Consider the use of Ubuntu to build a Linux development environment.

The Ubuntu installer can be downloaded to the official Ubuntu website download page.

Here's a quick introduction to how Ubuntu installs.

There are usually two ways of installing Ubuntu:

1, direct installation.

It can be installed through a disc image or through the Wubi application under the Windows operating system. After the installation is complete, it is an operating system that runs on the physical computer.

Installation steps:


2, virtual machine installation.

Virtual machine is a complete computer system that is run in a fully isolated environment with full hardware functionality that is simulated by software.

With virtual machine software, you can simulate one or more virtual machines on a single physical computer that works exactly like a real computer, such as installing an operating system, installing applications, accessing network resources, and so on. For you, it's just an application running on a physical computer, but for an application running in a virtual machine, it's a real computer.

Today's popular virtual machine software has VMware, virtual box, and virtual PC, all of which can virtualize multiple computers on a Windows system.

VMware installation Steps:

VMware under Ubuntu virtual machine installation steps:

Catalog [Hide]
1 cross-compilation tool ARM-NONE-LINUX-GNUEABI-GCC installation
1.1 Opening the terminal
1.2 Download ARM-NONE-LINUX-GNUEABI-GCC installation package
1.3 Unpacking the ARM-NONE-LINUX-GNUEABI-GCC installation package
1.4 Adding cross-compilation tool paths
1.5 Verification
2 cross-compilation tool Gcc-arm-linux-gnueabi installation
2.1 Opening the terminal
2.2 Installing Gcc-arm-linux-gnueabi
2.3 Verification

[Edit] cross-compilation tool ARM-NONE-LINUX-GNUEABI-GCC installation click to download


[Edit] Open terminal to Ubuntu OS, select Applications (APP), Accessories (attachment), Terminal (terminal). The shell terminal interface looks like this.

File: Ubuntu terminal.png


[edit] Download the ARM-NONE-LINUX-GNUEABI-GCC installation package in the Ubuntu operating system, you can download the ARM-NONE-LINUX-GNUEABI-GCC installation package using your own wget tool.

Wget is a non-interactive command-line tool for retrieving files from the network and downloading them automatically, supporting HTTP, HTTPS, and FTP three most commonly used TCP/IP protocols.

wget command format:

wget [OPTION] [URL] under shell command line, enter the following command and press <Enter> to execute, you can download the ARM-NONE-LINUX-GNUEABI-GCC installation package.

wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/ arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
In the process of downloading can be completely press <Ctrl>+<c> exit download, and later with the-C option can continue to download from the breakpoint, as shown below.

Wget-c http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/ arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2[Edit] Unzip the ARM-NONE-LINUX-GNUEABI-GCC installation package ARM-NONE-LINUX-GNUEABI-GCC after the installation package is downloaded:

First, copy to the/usr/local directory.

sudo cp Arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2/usr/local Then, unzip to the current directory.

sudo tar-jxvf ARM-2009Q1-203-ARM-NONE-LINUX-GNUEABI-I686-PC-LINUX-GNU.TAR.BZ2 after executing the above command, the ARM-NONE-LINUX-GNUEABI-GCC installation package will be decompressed to a arm-2009 in the current directory The Q1 directory. The ARM-2009Q1 directory is created automatically when decompressed.

[Edit] Add the cross-compilation tool path after the decompression is complete, you can go to the arm-2009q1/directory to view the directory structure. In the/usr/local/arm-2009q1/bin/directory, the commands for the cross-compilation tool are stored. To enable the system to find the commands of the cross-compilation tool, you can add the/usr/local/arm-2009q1/bin/directory to the PATH variable. Take VI for example, the steps are as follows:

1. Open/ETC/BASH.BASHRC Script

Vi/etc/bash.bashrc
2. Add the/usr/local/arm-2009q1/bin/directory to the PATH variable

VI Enter command mode by default, in command mode, you can only move the cursor, modify and delete text, and there are fixed action commands.

To insert text under VI, you must first enter insert mode. To enter insert mode, you can press the <a> or <A> key, "I" or "I" key, <o> or <O> key in command mode, and the operation and its functions are as follows.

Operation function
A starts inserting after the cursor
A inserts at the end of the line where the cursor is located
I start inserting before the cursor
I start inserting before the first non-whitespace character in the line where the cursor is located
o Add a new line below the cursor line to begin inserting
O insert a new line on the line where the cursor is located


First, move the cursor to the last line of the file;

Next, press the <o> key to start inserting a new line under the cursor line;

Then, insert the following statement;

Export path= $PATH:/usr/local/arm-2009q1/bin/Finally, save exit.

Under VI, to save the file and exit, you must first enter the last line mode. To enter the last line mode, enter colon <:> only in command mode. While currently in insert mode, returning from insert mode to command mode must press the <Esc> key. Therefore, press the <Esc> key first to return to command mode, then enter the colon <:>, and enter the last line mode. Some commonly used commands in the last-line mode are listed as follows.

Operation function
Q! Do not save changes, Exit VI
Wq save changes, Exit VI


Obviously, you need to save the changes, so enter <wq>, save the/ETC/BASH.BASHRC script and Exit VI, and return to the shell command line.


3. Execute/ETC/BASH.BASHRC Script

Although the path to the cross-compilation tool has been added, and the/ETC/BASH.BASHRC script has been saved, the modified path variable does not work and must be manually executed once/ETC/BASH.BASHRC script, as shown below, because it has not been executed since it was modified.

SOURCE/ETC/BASH.BASHRC of course, you can also reboot the system, because the script will be executed automatically when the system starts.

[Edit] Validation Next, verify that the ARM-NONE-LINUX-GNUEABI-GCC is installed successfully. At the shell command line, you can enter arm-first, and then press the <Tab> key. If it can be automatically completed as arm-none-linux-gnueabi-, the installation is successful.

Note: 64-bit operating systems need to execute the following command to install the required library files to run the 32-bit cross-compilation toolchain:

sudo apt-get install ia32-libs[edit] The cross-compilation tool Gcc-arm-linux-gnueabi a compiled program that runs in a computer environment and compiles code that runs in a different environment, which is said to support cross-compiling. This compilation process is called cross-compiling. Simply put, the executable code on the other platform is generated on one platform. such as Keil Software, compiled on the Keil, but run on a microcontroller, typical cross-compilation. Before compiling the embedded operating system kernel and applications, you must install the cross-compilation tool first.

Click to download


[Edit] Open terminal to Ubuntu OS, select Applications (APP), Accessories (attachment), Terminal (terminal). The shell terminal interface looks like this.

File: Ubuntu terminal.png


[Edit] Install Gcc-arm-linux-gnueabi in the Ubuntu operating system, thanks to the Ubuntu apt (Advanced packaging Tool), search, install, upgrade and uninstall packages, Even upgrading the Ubuntu operating system is very simple. Working with APT is a powerful command-line tool for--apt-get commands. The Apt-get command generally requires root permission to execute, so it is generally preceded by sudo.

For example, to install a package, simply add the package full name after Apt-get install. The following commands are used to install Gcc-arm-linux-gnueabi:

sudo apt-get install Gcc-arm-linux-gnueabi in the shell command line, enter the above command and press <Enter> to execute, you can download the installation Gcc-arm-linux-gnueabi cross-compilation tool, As shown in.

Files: Apt-get install Gcc-arm-linux-gnueabi.png system will not be installed immediately, but first print the installation information and prompts to continue the installation, waiting for the user to choose. If you continue with the installation, enter <y>, as shown; otherwise enter <n>. Then press the <Enter> key.

File: Install Gcc-arm-linux-gnueabi.png If you choose to continue the installation, then the system will not actually download the installation Gcc-arm-linux-gnueabi. When the installation is complete, the system returns to the shell command line.

[Edit] Validation Next, verify that the Gcc-arm-linux-gnueabi is installed successfully. At the shell command line, you can enter Arm-linux first, and then press the <Tab> key. If it can be automatically completed, the installation is successful.

Build a Linux development environment

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.