Limit Meaning
There has always been a plausible understanding of the RO, RW and ZI data described in the ARM system. During this time, I have carefully understood it and found some rules. I have understood some things that were in the previous books but I don’t understand them. I think there should be a lot of people who have the same confusion as me. So I will write some of my understandings about RO, RW and ZI, I hope I can have something for everyone. help. To understand RO, RW and ZI, you need to first understand the following knowledge:
The composition of the ARM program
The "ARM program" referred to here is the ARM system. The program being executed, not the bin image file stored in the ROM, pays attention to the difference. An ARM program consists of three parts: RO, RW, and ZI RO are the instructions and constants in the program. RW is the initialized variable in the program. ZI is the uninitialized variable in the program. The above three points can be understood as: RO is readonly, RW is read/write, ZI is zero
The composition of ARM image file The so-called ARM image file refers to the bin file that is burned into ROM and also becomes image file. The following uses the Image file to call it. The Image file contains RO and RW data. The reason why the Image file does not contain ZI data is because the ZI data is 0, it is not necessary to include, as long as the program is running, the area where the ZI data is located is always cleared. Including it wastes storage space. Q: Why must Image contain RO and RW? A: Because the commands and constants in the RO and the variables initialized in the RW are not like the ZI, there is nothing in the middle.
The execution process of ARM program
From the above two points, it can be known that the image file burned into ROM is not completely compatible with the ARM program in actual operation. the same. Therefore, it is necessary to understand how the ARM program reaches the actual running state from the image in the ROM. In fact, the instructions in the ROM should at least have such a function: 1. Move the RW from the ROM to the RAM. Since RW is a variable, the variable cannot exist in the ROM. 2. Clear the RAM area where ZI is located. Because the ZI area is not in the Image, the program needs to clear the corresponding RAM area according to the ZI address and size given by the compiler. The ZI is also a variable. Similarly, the variable cannot exist in the ROM. In the initial stage of the program operation, the C program can access the variable normally after the two instructions are completed. Otherwise you can only run code without variables.
rt_system_heap_init ((void *) & Image
RW I RAM1
ZI $$ Limit, (void *) STM32_SRAM_END);
Image
RW I RAM1
ZI$$Limit
This is a symbol exported by the linker, which represents the end of the ZI segment, that is, after the RAM of the program execution area ends (note this & lsquo; & rsquo; ;, a little i++ and ++i) address, in turn, is the starting address of the unused area of RAM in our execution area (in fact, this is a bit far-fetched, because this understanding is often just a standard for quasi-finding, thinking in RAM The use of the ZI area is often the end of the entire program, maybe I understand it wrong here).
&Image Take the address.
RW I RAM1
ZI$$Limit
1. Install Oracle VM virtualBox, I am using version 4.0. The official download address is here. 2.
tcpdump is a commonly used capture tool under the Linux command line, record the usual way, the test
Too many open files Errors are common faults in Linux systems. Solutions can be easily found on the
The role of a .linux device driver Kernel: used to manage hardware and software resources, and pro
What is the meaning of dd if=/dev/zero of=? Detailed use of the dd command under Linux
IDE data transfer mode (PIO, DMA)
Practical tips: What to do when the Linux system "crash"
Server-side development experience summary Linux C language
Nginx front-end scheduling server overview
How to display dialogs in Bash Shell scripts
Restart Apache commands under Linux
PHP install imagick extension tutorial
SQLPLUS some friendly operation settings tutorial
How to get the motherboard information under Linux system
How does Win10 repair the system?
Set up a mail server with Win 2003 system
Win7 system is slow, catching the real fierce
Win7 system browser input localhost 404 error how to do
Solve the problem of unable to shut down
What should I do if the Windows 10 Start menu does not work?
Linux system Chinese display garbled how to do?
How to open the remote connection of Windows 2000 3389
How do special symbols come out? Special symbols are sent to you!
How does Win8 shut down a running service so that it no longer starts releasing system memory