Home Operation and Maintenance Linux Operation and Maintenance What are the embedded linux development tools?

What are the embedded linux development tools?

Mar 17, 2023 am 09:43 AM
linux

Embedded Linux development tools include: 1. vim tool. Vim is a text editor developed from vi. It has code completion, compilation and error jump and other convenient programming functions; 2. gcc compilation compiler, a programming language compiler developed by GNU; 3. Project manager make, make is an automatic project compilation manager in Linux, etc.

What are the embedded linux development tools?

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

What are the embedded Linux development tools?

Embedded Linux development tools

Using vim

1. Text editor: vim vscode: Learn to use and configure vim, install and use plug-in remote link vscode

2. Compiler gcc: common compilation options, production and use of static libraries and dynamic libraries

3. Debugger gdb: Breakpoint debugging, viewing memory, debugging memory errors

4. Project manager make: writing Makfile, multi-directory Makefile writing

5. Shell programming (after C language)

6. git version management tool (online: C language)

7. Cmake (project)

8. Memory detection tool (online: C language)

vi/vim/gvim: Text editor gedit emac (off the mouse)

  • Applicable scenarios: single file editing; vim plug-in (highly customized)>IDE

  • vim mode: command line mode (first time to enter, press a,i), bottom line mode, insert mode (esc switches to command line) wq save and exit

  • vim configuration (vimc):

Modify the /etc/vim/vimc file (line number, indentation style, mouse support)

vim /etc/vim/vimrc
Copy after login

Install plug-in

  • Usage of vim command:

Command line: yy copy p paste dd delete u restore previous line

Bottom line: find /str ?str

Replace: line number or %s/old/new/gc

Edit multiple files: vim file 1 file 2 file 3.

Jump: n file name

File saving w r

sp file name multiple file writing

gcc compiler

<> The difference between "" and "": the search paths are different: the former searches in the system header file directory "/usr/include", if not, an error will be reported

The latter searches in the current directory, if If not, search in the system header file directory. If not, an error will be reported.

Specification: <> Contains system header files "" Contains custom header files

#if 0 //注释 //#if 1//取消注释
#endif
Copy after login

Different processors have Different assembly

All header files in the system are in vim/user/include/header files

  • gcc Overview: The compiler provided by the GNU Project (Unix cc compilation Converter) (compilation tool chain g ld ldfd) –> (cross-compilation tool chain)

  • What is cross-compilation? .c->.s->.o->elf

The process of compiling code under the host machine to run under the target machine

In The process of compiling code running on other CPU platforms under the current CPU platform

a\源文件到可执行经历了哪几个步骤?(预处理,编译,汇编,链接)
b\预处理的任务:头文件展开(#include)、宏替换(#define)、条件编译(#ifdef)(#开头的代码)
c\编译的任务:检查语法。转成汇编、生成汇编文件(.s/.S)
d\汇编的任务:编译汇编文件,生成目标文件(.o)
e\链接的任务:链接所有目标文件,生成符号表,生成可执行文件
Copy after login
  • Compilation options

-o (executable rename: elf format?)

-E (the compiler only performs preprocessing)

-I: Specify the third-party path for header file compilation

-S: Perform compilation phase

-c: Proceed to the assembly stage

-O1 -O2 -O3 (compilation optimization): Baidu check what has been done

-w (off warning) -Wall ( Turn on warning): Switch warning information

Library file

  • Compiler gcc (production and use of static libraries and dynamic libraries)

  • Debugger gdb (common naming, calling memory errors)

  • Project manager make (makefile writing, multi-directory Makefile writing)

extern: This function has been defined in other files

Library function: printf scanf strcpy strcat (saved in library file)

Library file: save functions and variables , the functions and variables inside can only be used, but their implementation cannot be seen

Library file classification: static library (.a) and dynamic library (.so)

Static library (.a ): The saved functions and variables are loaded into the executable file during the compilation phase

Dynamic library (.so): The saved functions and variables are loaded into the executable file during the execution phase

The difference between using static libraries and dynamic libraries (the difference between executable files:)

  • The executable file compiled using the static library>The size of the executable file compiled using the dynamic library-- Overhead affecting memory

  • Execution speed of executable files compiled using static libraries>Execution speed of executable files compiled using dynamic libraries

  • Use the executable file compiled from the static library to upgrade

  • Use the executable file compiled from the static library to program deployment>Use the dynamic library to compile Deploy the executable file program that comes out

Storage path of library files:

Library files required for system operation: /lib

Third-party software and libraries required to run the tool:/usr/lib

When compiling, the compiler will automatically go to these two directories to find the library files that need to be linked

Make static libraries:

  • Compile the target source file into a target file: gcc -c target source file (can be multiple) (gcc -c add.c)

  • Use The ar tool makes static: ar -rcs (create if the library does not exist, update if it exists) the name of the library file to be generated (lib library name suffix .a) target file

Example: ar -rcs libadd.a add.o

Use static library:

-l: Specify which static library to load -l library name

-L: Specify the library to load File storage path

gcc source file-l library name-L library storage path

Example: gcc demo.c -ladd -L./libls

Project Managermake

  • What is a project?

Multiple source files and other files (picture header file script file)

  • Jobs of the project manager: Compile multiple source files

gcc All source files -o executable files—>Automatic compilation

  • ##make depends on the Makefile file;

  • Makefile is a script file (batch processing), and there is related syntax

  • Makefile syntax:

Three elements: target , dependency, command

Format:

Target: dependency

tab command

Target: the final generated file

Dependency: generate Files required for the target

Commands: Commands that need to be executed when generating the target

Execution order:

make: execute from the first target by default

make target body: execute from the corresponding target body

If the file that the target body depends on is a target, execute the dependent target first, and then execute the command of the target body

You can build a makefile or Makefile make -f Makefile -f to specify which Makefile to execute

Makefile:

Comments:

#You can use $@ instead of

for the target

What are the embedded linux development tools?

What are the embedded linux development tools?

What are the embedded linux development tools?

What are the embedded linux development tools?

What are the embedded linux development tools?# under multi-level directories Makefile:

    Top-level Makefile: Master Control Makefile
  • Subdirectory Makefile: Function Makefile
  • scripts directory Makefile: header file Makefile
  • General control Makefile: enter each functional subdirectory to execute the make command, and link the .o files in each subdirectory into an executable file

Function Makefile: Compile the .c file in the current directory to generate an .o file

Header file Makefile: Define some variables

Related recommendations: "

Linux Video Tutorial

The above is the detailed content of What are the embedded linux development tools?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1668
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

See all articles