Embedded technology study notes (2)

Embedded System Development Overview Supplement

Embedded learning route : (embedded operating system, development tools, system application development (& GUI), system transplantation, driver, kernel)
Knowledge system : c language, single chip, embedded operating system (assembly, c ++)
programming language : C, C ++, assembly, python
operating system : non-real-time (Linux) real-time (ucosii)
hardware foundation : 51 + stm32 + arm64
development tools : git / github, makefile writing, gdb debugger, shell
embedded operating system ( Portable operating system) Type : Vxworks, Linux, Ucossii

Embedded Linux operating system

Learning content and goals: Introduction to Linux, using Linux operations (instructions), Linux development tools
1, installing a Linux development environment
vm virtual machine:
Why not choose dual systems but install virtual machines by simulating pc through software Answer: Because of the interaction between embedded development and the kernel, if an error occurs, the system will crash.
Linux distribution (version released to users) redhat (centos7 is the most stable) ubuntu (18.04) deepin
2. Introduction to Linux (POSIX, GPL, GNU )
On the basis of absorbing the essence of MINIX, Linus wrote his own Linux operating system in 1991, the version is Linux0.01, which is the sign of the beginning of the Linux era.
GPL: open source community
GPL agreement: the program you use in the open source community. If you modify the source program, you must put the modified source program on the open source community for others to modify and use.
Linux has been issued through the GPL agreement, and now has been developed to Linux5.0 version
unix is ​​a commercial software, it is the
POSIX standard developed by the father of C language Dennis Ridge : portable operating system interface (cross-platform conditions)
GNU project: gnu is no unix (among which are excellent tools: gcc, gdb)
3. The use of
Linux The difference between
Linux and win32 Linux operating system positioning: for developers, developers focus on the efficiency of development.
The positioning of Win32 operating system: for ordinary users, the operation that ordinary users pay attention to is simple.

The goal of using Linux is to get rid of the mouse and use commands to complete the operation.
If you want to learn commands, you can search the Linux command Daquan to learn
Linux commands, also called shell commands, because the entered Linux commands are analyzed by the shell command parser and then interact with the kernel
. Linux command
root: super user (with all permissions)
jsetc: ordinary user (restricted)
user management command: su (switch root) sudo (for more advanced permissions)
adduser: add user desuler: delete user passwd: modify password
file operation Command: ls
Linux has a philosophy that everything is a file.
Classification of Linux files: ordinary files (beginning with-), directory files (beginning with d), device files (beginning with c character / b block device), link files (beginning with l)
Linux special files: pipeline files ( beginning with p) At the beginning), stack files (beginning with f), shared files (beginning with s)
Linux file operation permissions: r readable, w writeable, x executable
permission description is divided into three groups, the first group of three represents the current user , The second group of three represents the current user group, and the third group of three represents other users.
Modify file permissions: chmod usage example chmod ux hello.c
r has a weight of 4, w has a weight of 2, and x has a weight of 1, You can also modify the permissions through chmod 655 hello.c
Create an empty file: touch View the file content: cat Delete the file: rm
Linux hidden files start with. (Dot)
File editing: (gedit, vim, gvim)-text editor
Excellent IDE: vscode
compiled file: gcc compiler./a.out
output compiled content

The directory operation command
cd enters the directory cd… return to the previous directory
mkdir to create a directory rm -r directory name or use rmdir (only empty directories can be deleted) to delete the directory
mkdir -p 0303 / kk / mm / nn create
root under the corresponding path Directory: the parent directory of all files (all files are stored in the root directory) enter cd / to enter the root directory
bin: store commands in the system
sbin: store administrator commands
dev: store all device files in the
system etc: store system All configuration files in
root: store the working directory of the root user
home: store the working directory of the ordinary user
usr: store the software (library files, header files) installed in the system

cd ~ Back to the current user's working directory
Absolute path and relative path, relative path can only enter the current directory, and absolute path to enter the mulu
cd class_c ++ relative path you need to enter cd / root / class_c ++ absolute path
cp copy file cp- r Copy directory
mv has both cut and rename functions

The role of other directories
boot: mainly stores the boot files used during booting, such as linux kernel files and boot menus and the configuration file needed for booting
lib: stores the function libraries and / bin and / sbin directories required for system booting The function library
lib64 called by the command will store the function library that supports the 64-bit format in / lib
media: store removable media devices, such as CDs, DVDs, etc.
mnt: mount, temporarily mount device files, temporary installation Directory, the system administrator can mount the file system. It is the system installation point
opt: optional, optional software package, that is, third-party software, which is a system administrator's temporary installation file . We can install other software besides the system's own software into this directory
proc: a special dynamic directory to maintain system information and status, including current running processes (processes) information. Contains information about system processes, is a virtual file system, contains information about running processes, system resources exist in the form of text information
run: all information generated after the last boot, such as the current user and running The
srv: service in the daemon process is used to store some data needed after the service is started
sys: system, similar to / proc is also a virtual file system, which stores the system core and hardware related information management device files. Does not occupy the hard disk capacity
tmp: temporary, storing some temporary files used during the system operation, can be accessed by all users, the system will be cleared when the system restarts
var: frequently variable (variable) files, such as logs or databases, etc. representative variable files . In this directory, you can find files that may grow in content

tar zxvf cvzf meaning
tar: used for Linux compression and decompression
zxvf: z means gzip compression, gzip is also used for decompression; x means decompression; v means to display detailed information of all processes; f is a required parameter It must also be the last parameter, which can only be followed by the file name
cvzf: c means to create a compressed file; v means to display detailed information about all processes; z means to use gzip for compression; f is a required parameter and must also be the last parameter , Only file name can be followed

Published 14 original articles · Like1 · Visits 477

Guess you like

Origin blog.csdn.net/a1152946932/article/details/104631408