In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Topic 1-Deep and simple processors 1. Processor basic concept 1.1 the difference between a processor and a microcontroller:
microcontroller generally refers to: CPU + on-chip memory + external peripherals
microprocessor generally refers to single charge CPU.
For current embedded devices, microcontrollers are usually used, or this is called SoC (system on chip), which has low cost and low power consumption. For software engineers, there is no difference between microcontrollers and microprocessors.
1.2 what is CPU?
CPU runs rhythmically under the control of a fixed frequency clock.
CPU can read the binary instruction set in the external storage device through the bus, and then decode and execute it.
These binary instruction sets that can be decoded and executed by CPU are determined at the time of CPU design, defined by CPU designers (ARM, etc.), and are essentially a string of numbers consisting of 1s and zeros. This is the assembly instruction set of CPU.
From source code to CPU execution:
1.3 Classification of registers
A.CPU register
-CPU registers are responsible for proprietary instruction execution, data operations, variable processing, and parameter transfer.
b. Peripheral register
The peripheral register is used to control the behavior and working mode of the peripheral, and the configuration value needs to be completed according to the chip manual of the peripheral.
-the peripheral register is the key for the programmer to control the hardware, and it is the "active switch" that the peripheral is programmed to control. Just as the assembly instruction set is the programming interface API of CPU, the register is the software programming interface API of the peripheral hardware. Using software programming to control a piece of hardware is actually programming to read and write the registers of the hardware.
1.4 two key registers
For CPU registers, we need to pay special attention to these two registers.
A.PC pointer-program counter (instruction pointer IP)
PC pointers are called because they point to the next instruction to be executed (we don't consider multi-level caching here), similar to pointers. Each time an instruction is executed, the value of PC changes accordingly.
B.SP pointer-stack pointer
The stack pointer always wants only the top of the stack space to implement the LIFO feature.
Save breakpoints, return values of function calls, save CPU sites, etc.
Example of the use of PC pointer and SP pointer: initially, the PC pointer points to the mov instruction, and the field is saved before the next jump (execute jmp) instruction. Starting from the position pointed to by the SP pointer, the data is saved in the stack space, and the SP pointer moves in turn, and there is also a BP pointer (base address pointer) to save the value of the last SP. At this time, the site before the instruction jump is saved between BP and SP. When the function returns, or after the interrupt execution is completed, the field recovery is performed from that address, and the SP pointer points to its original value.
1.5 IO operation
IO operation of the processor:
a. The data between the processor and the peripheral is completed by IO operation.
b. Memory mapped IO space (memory and IO unified addressing)
Peripherals are mapped to the processor's address space through sophisticated hardware connections
Communicate with peripherals through address access
c. Independent IO mapping (memory and IO addressing independently)
A) independent of address space, peripherals cannot be accessed through addresses
B) use special instructions to communicate with peripherals
d. Operating IO is actually configuring the control register to read and write to the register.
1.6 address mapping
Through the specific hardware design, the value on the address bus can be made within a certain range, and the chip selection signal is true, that is, the device can be connected to read the data in the corresponding address.
The chip selection signal is generated by the address line.
Example of address mapping:
Such as the following address 0XFFFF1234, which is a 32-bit address, how to map to an address space with only 16 bits?
The usual practice is to use a high-order address to generate a slice selection signal through the & & operation, and then directly access the actual memory space through the low-order address.
1.7 processor boot process
After the processor is powered on, the PC pointer is fixed to a default value (usually 0), and the default value of the PC pointer is used to determine the first instruction to execute. The subsequent instructions are then executed, as shown in the following figure.
Start the program (BootLoader):
BootLoader is the first program that runs after the system is powered on and is usually used to boot the operating system. According to the run phase, the volume and function are divided into three parts (the usual practice):
BL0- is fixed in the hardware to initialize the most basic hardware and load BL1
BL1- is stored in an external storage device to initialize main memory, load and run BL2
BL2- is stored in an external device and is used to boot and boot the operating system.
Case analysis:
For S3C6410, the design of the startup process of this chip is exactly the same as what we mentioned above.
The first stage: first, the BL0 solidified in the IROM will be run after the system is powered on, and the project of this part of the program completes the most basic initialization work (closing the watchdog, initializing the instruction cache, initializing the stack, loading the BL1 to the internal IRAM, and jumping to the BL1 to execute).
Phase 2: then the code in IRAM is responsible for initializing memory (SDRAM), then loading BL2 into SRM and jumping to SRAM.
Phase 3: BL2 runs in SDRAM, then loads OS into SDRAM and starts the operating system
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.