Embedded system development study notes (2)

Last review

Embedded system development study notes (1)

Embedded system development

Linux file operation commands

Command symbol
1, vim file editor
Three modes: 1, command mode 2, insert mode 3, bottom layer mode In
command mode, shift+zz exits the command mode.
In command mode, (a/i) enters insert mode, esc returns to command mode.
In command mode, (shift+:) enters the bottom mode, esc returns to command mode, q+!+enter forces to exit vim, w+q+!+enter forces to save and exit.
In command mode, yy is to copy, p is to paste, dd is to delete, and u is to undo.
(Number + command is equivalent to n times operation) In
bottom line mode, (s/hello/hi) means to replace the first hello with hi in the line pointed by the cursor; (s/hello/hi/g ) Means to replace all hello with hi in the line pointed by the cursor.

Embedded Linux development tools

Compiler: gcc, mycode
debugger: gdb
project manager: make cmake
version manager: git
preprocessing: preprocessed files end with .i, and no syntax errors are checked at this stage.
Compilation process:
1. Syntax check
2. Translate C program into assembly language
3. Assembly: Convert assembly language into binary code, ending with .o
4. Link: Link the code C library that needs to be used
Cross compilation:
1 1. Convert .c into .i file (preprocessed file)
2. Convert .i file into .s file (compiled file)
3. Convert .s file into .o file (assembly file)
4. Link to become Executable file
Example: gcc -E hello.c -o hello.i
gcc -S hello.i -o hello.s
gcc -c hello.s -o hello.o
gcc hello.o -o hello
Conditional compilation:
Insert picture description here

gcc
1.c -o 1 ./1
The following is the result

Insert picture description here

Guess you like

Origin blog.csdn.net/m0_52251623/article/details/114634364