


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.
#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
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
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\链接的任务:链接所有目标文件,生成符号表,生成可执行文件
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:
make target body: execute from the corresponding target bodyIf 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
# 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 TutorialThe 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!

The five core components of the Linux operating system are: 1. Kernel, 2. System libraries, 3. System tools, 4. System services, 5. File system. These components work together to ensure the stable and efficient operation of the system, and together form a powerful and flexible operating system.

The five core elements of Linux are: 1. Kernel, 2. Command line interface, 3. File system, 4. Package management, 5. Community and open source. Together, these elements define the nature and functionality of Linux.

Linux user management and security can be achieved through the following steps: 1. Create users and groups, using commands such as sudouseradd-m-gdevelopers-s/bin/bashjohn. 2. Bulkly create users and set password policies, using the for loop and chpasswd commands. 3. Check and fix common errors, home directory and shell settings. 4. Implement best practices such as strong cryptographic policies, regular audits and the principle of minimum authority. 5. Optimize performance, use sudo and adjust PAM module configuration. Through these methods, users can be effectively managed and system security can be improved.

The core operations of Linux file system and process management include file system management and process control. 1) File system operations include creating, deleting, copying and moving files or directories, using commands such as mkdir, rmdir, cp and mv. 2) Process management involves starting, monitoring and killing processes, using commands such as ./my_script.sh&, top and kill.

Shell scripts are powerful tools for automated execution of commands in Linux systems. 1) The shell script executes commands line by line through the interpreter to process variable substitution and conditional judgment. 2) The basic usage includes backup operations, such as using the tar command to back up the directory. 3) Advanced usage involves the use of functions and case statements to manage services. 4) Debugging skills include using set-x to enable debugging mode and set-e to exit when the command fails. 5) Performance optimization is recommended to avoid subshells, use arrays and optimization loops.

Linux is a Unix-based multi-user, multi-tasking operating system that emphasizes simplicity, modularity and openness. Its core functions include: file system: organized in a tree structure, supports multiple file systems such as ext4, XFS, Btrfs, and use df-T to view file system types. Process management: View the process through the ps command, manage the process using PID, involving priority settings and signal processing. Network configuration: Flexible setting of IP addresses and managing network services, and use sudoipaddradd to configure IP. These features are applied in real-life operations through basic commands and advanced script automation, improving efficiency and reducing errors.

The methods to enter Linux maintenance mode include: 1. Edit the GRUB configuration file, add "single" or "1" parameters and update the GRUB configuration; 2. Edit the startup parameters in the GRUB menu, add "single" or "1". Exit maintenance mode only requires restarting the system. With these steps, you can quickly enter maintenance mode when needed and exit safely, ensuring system stability and security.

The core components of Linux include kernel, shell, file system, process management and memory management. 1) Kernel management system resources, 2) shell provides user interaction interface, 3) file system supports multiple formats, 4) Process management is implemented through system calls such as fork, and 5) memory management uses virtual memory technology.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Atom editor mac version download
The most popular open source editor
