Wei Dongshan embedded first phase of the study notes DAY_3--7_1_ bare metal development steps Introduction

Author: GWD Time: 2019.7.4

First, the course content:
1, asked: windows, linux and arm (linux) to establish the difference between the project?
A:
Here Insert Picture Description
2, Q: process of compiling a C file under ubuntu environment?
A:
1), to establish a hello.c file, and enter the code, enter the complete ESC +: wq Quit vi editor;

Here Insert Picture Description
Here Insert Picture Description
2), gcc compiler, gcc + -o + + .c file output files;
Here Insert Picture Description
3), run hello_1 file;
Here Insert Picture Description
3, Q: What is GCC?
A: gcc compiler software is a major linux system, gcc stands for GNU compiler suite (GNU Compiler Collection), in addition to the program can be compiled c language development, but also can develop C ++, Java and other language programs. GCC intention is for the GNU operating system specifically written a compiler.
4, Q: Why GCC rather than anything else?
A: The reason for using the gcc: powerful, stable, open source free.
1), gcc -v view gcc version, which proves the gcc compiler normally. No matter which version you are using gcc, behind only the normal compile it.
2), gcc -o output file name of the source file (O: Output)
. 3), arm-linux-based arm GCC compiler linux platform. It is open source free compiler. arm-linux-gcc powerful, stable, many support arm chip, update speed.
5, Q: What is cross-compilation mode?
A: cross compiler modes: Platform usually compiled program become embedded host (such as: PC's ubuntu system, CPU architecture X86 architecture), embedded platform to run the program becomes the target machine (eg: a section ARM development board, CPU architecture ARM architecture). In the editing and X86 platform and compiler arm-linux-gcc compiler program ARM architecture, platform belong to different architectures, thus belonging to the cross-compilation mode. Then programmed into the ARM development board (downloading methods: a variety of ways JTAG, USB, SD card, network, etc.), then the development board to run the program.
Second, learning points:
1. Q: Why is the use of host and target cross-development pattern bound to the plate?
A: The software on the development of the PC, the PC can directly edit, compile, debug software, the final release of the software running on a PC also, but for embedded development, embedded devices are insufficient resources used to develop software, so a cross-development model, edit on the host, compile, and run on the target board, the verification process.
2, Q: How can a C file executable?
A: The need to go through pre-compiler, assembler, linker four steps before they can turn into an executable file. Pretreatment: Expand the beginning of the # command; compilation: the C code is "translated" into assembly code; Assembler: translate the output of the second step of assembly code into machine code; Connection: connect the target file and library files, can eventually generate in the platform-specific executable file to run.
Third, the code (no)

Guess you like

Origin blog.csdn.net/gongweidi/article/details/94635806