Arm-linux Study Notes-1

Source: Internet
Author: User

After installing Linux, remember the system update, update using APT command, as follows (remember to switch to root mode using sudo-i instruction before using)

Apt-get Update updates the system software source, which is equivalent to finding updates

Apt-get Upgrade update system all software to be updated

Apt-get Dist-upgrade Update System kernel

Apt-get clean clears unused packets in the system

Apt-get AutoClean automatically cleans up unused packages after each installation software is completed

Apt-get install PackageName software with the specified name

Apt-get Remove Package name uninstall software with the specified name

Apt-cache Search PackageName to find the specified software from the software meta

Apt-get source PackageName Get the source code of the software

Apt-get-f Install repair installation software

Apt-get Reinstall reinstall Software

After the system installation, remember to install three services

1.vsftpd

Apt-get Install VSFTPD

After the installation is complete, open the configuration file, and the configuration file

/etc/vsftpd.conf, open two comments (the latest version is open by default)

Local_enable=yes

Write_enable=yes

Control of services using service vsftpd restart ...

The first allows local users to log on the second allow upload

2. Installing the SSH Service

Apt-get Install Openssh-server

Configuration file is/etc/ssh/sshd-config after installation, no modification required

Modify the status of a service

Service SSH Restart

3. Installing NFS Services

Apt-get Nfs-kernel-server Portmap

Configuration file

/etc/exports, the file determines those directory shares, you can add your own directory, as follows

/work/nfs_root * (Rw,sync,no_root_squash,no_subtree_check)

Last one if not added there will be a warning

Modify Service Status

Service Nfs_kernel_server Restart

Then add the basic toolchain to the host and use the

Apt-get Install Build-essential

Adding a grammar lexical analyzer

Apt-get Install Bison Flex

Installing the C function library manual

Apt-get Install Manpage-dev

View the installed GCC and GDB versions

GCC--version

GDB--version

Installation of additional enhanced software

Apt-get Install autoconf automake//tools for generating engineering makefile

Apt-get Install Binutil-doc cpp-doc gcc-doc glibc-doc stl-manual//user manual for other programs

View the manual method of using the name of the man function, Exit press Q

Decompression to get gcc-3.4.5-glibc-2.3.6, the extracted file bin directory, it is best not to add directly to the environment variables, use the time to add, so that the system has a number of different versions of the cross-tool chain

The path to the system environment variable is

/etc/environment can add environment variables directly in this file

The second method is to add the/etc/profile file

Export Path=/home/work/gcc-3.4.5-glibc-2.3.6/arm-linux/bin: $PATH, call source/etc/profile after saving, no spaces on either side of the equals sign

The third method is to open the terminal, manually enter the above command, only valid for this time, exit the command window automatically expire

When compiling Linux, make menuconfig needs to use the Ncurses Toolkit, and the way Ubuntu adds the tool is

Apt-get install libncurses usually comes with it.

Apt-get Install Linncurses-dev Installation

A c,c++ file can be turned into an executable file after four parts

1. Preprocessing

Arm-linux-cpp tool, expand macro definition and conditional compilation, generate file ending with suffix i

2. Compiling

CC1 (not arm-linux-cc1), compiles high-level languages into assembly code, generates. S end-of-file

3. Compilation

Arm-linux-as compiles the sink code into an elf file, generating an. o file

4. Links

ARM-LINUX-LD will link multiple elf files, generate executable files, and generate final. o files or. out files

But using

ARM-LINUX-GCC can complete all of the above steps at once

Arm-linux-gcc-o Hello hello.c

Generate target file Hello.o,-o parameter specifies the file name of the makefile

Arm-linux-gcc-v-O Hello hello.c

-V to display the details of the compilation in the compilation

Various options are available to control the action of the ARM-LINUX-GCC

-C preprocessing compilation but does not make a link, the default generated file name. o file, to specify the filename, remember to use the-o file name, and placed in the front of the-C

-S compile immediately after the stop, do not compile, generate. S files, to specify the file name, remember to use the-o file name, and placed in the front of-s, can be used to view the assembly code

-E to stop after processing, generate. I files, ignore any source files that do not require preprocessing

-V shows the version number of the GCC tool itself and the detailed process at compile time

-o Specifies the destination file name, otherwise the executable file defaults to A.out, and the other default original file name. O

Examples Show

Gcc-c-O main.o main.c

Gcc-c-O sub.o sub.c

Gcc-o Test SUB.O MAIN.O

The contents of the SUB.C are called in MAIN.C, but the non-connection is able to pass when the. o file has been successfully generated and can be used to generate the target file once.

Assemble files that generate a file directly

Gcc-s-O name.s name.c

Note that s must be uppercase OH

Arm-linux Study Notes-1

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