[Arrangement] embedded system-Basic Knowledge Article 2

Source: Internet
Author: User

Embedded Microprocessor
The microprocessor consists of three major components:
1. Control Unit: Responsible for basic operations such as finger fetch, decoding, and number fetch, and sending main control commands, including two important registers: PC and IR;
2. arithmetic logic unit: divided into two parts: arithmetic operation unit and logical operation unit;
3. Register: stores temporary data.


Microprocessor architecture

1. Von noriman and Harvard)
In a computer with the Von noriman architecture, programs and data share a storage space. The storage address of program commands and data storage address point to different locations in the same storage space. The uniform address and data bus are used, and the program instruction and data width are the same. A computer in the von noriman architecture is composed of a CPU and a memory. a pc is a register that indicates the instruction and data storage location inside the CPU, without deciding the program flow.
Harvard architecture is an architecture that separates program instruction storage from data storage. Program commands and data are stored separately, with independent addressing, independent access, and four bus sets. The separated program bus and Data Bus allow you to obtain the command words and operands simultaneously within one machine week, doubling the data throughput.

2. CISC and RISC
CISC usually includes a complex data path and a microprogram controller. The microprogram controller consists of the microprogram memory, microprogram counter, and address selection logic. Each word in the microprogram memory represents a control word and contains the value of control signals for all data channels within a clock cycle. Each processor command is composed of a series of control words. Ibm801, the first computer in the world to adopt the concept of "CPU.
The data path of the RISC processor is usually composed of a large register file and an Alu. The large register file contains all the operands and results of the program calculation. The load command puts the data in the reg file and uses the store command to put it back into the memory. Due to the decrease in the number of commands, the Proteus compiler requires a series of advanced commands to perform complex operations, which provides flexible optimization performance for the compiler.
Comparison between CISC and RISC: Command System, execution time, encoding length, addressing mode, operation, and compilation.
The main ways to implement the concept of "Proteus" are as follows:
(1) Reduce the type of commands;
(2) load/store structure;
(3) Adopting command line technology;
(4) configure more general REG in the processor;

3. byte sequence of information storage
Small-end Storage Method: Low-byte data is stored in the memory low address;
Big-end Storage Method: Low-byte data is stored in the inner address;
The established rules on the byte sequence should be followed for communication between different storage modes.

 

Embedded Software Architecture
1. No OS
(1)Cycle rotation Mode: Divide system functions into several different tasks, include them in an infinite loop statement, execute them one by one in order, and then recycle them.
Disadvantage: It is too simple to handle asynchronous events and lacks the concurrent processing capability.
(2)Frontend and backend systems: Added the interrupt processing function based on cyclic rotation;
Foreground (foreground program: event processing level program): interrupt service program ISR, process asynchronous events;
Background (background program: task-level program): system management and scheduling program, infinite loop, responsible for the allocation, management and task scheduling of embedded system hardware and software resources.

2. OS
(1) Improved system reliability;
(2) Improved system development efficiency, reduced development costs, and shortened the development cycle;
(3) conducive to system expansion and transplantation;
Different embedded operating systems may have different components. Generally, all operating systems have a kernel. The kernel refers to a component in the operating system, which includes the main functions of the operating system, that is, various features of the operating system and their dependencies. (Task management, storage management, file management, device management, and network management)

 

Classification of Embedded Operating Systems
1. Classified by "system type": commercial systems, professional systems, and open-source systems;
2. By "Response Time": RTOS, non-RTOS;
3. Press"Software Structure"Category:Single structure, layered structure, micro kernel structure;
DifferenceIt is embodied in two aspects: (1) kernel design, that is, what functional components are contained in the kernel; (2) what other system software is integrated into the system.
(1)Monomer Structure(Eg: Linux): In a monolithic OS, middleware and device drivers are usually integrated in the system kernel, and the entire system usually has only one executable file, contains all functional components. The entire OS is composed of a group of functional modules that can be called from each other.
Advantages: good performance, mutual calls between system modules, low communication overhead;
Disadvantages: the OS is bulky and highly integrated, making it difficult to crop, modify, and debug the system.
(2)Layered Structure: In a layered structure, an OS is divided into several layers, and the call relationships between layers are unidirectional. The hierarchical OS also has only one large executable file, including the device driver and middleware. A set of API functions must be provided at each layer.
(3)Microkernel Structure(Eg: VxWorks): In the kernel, most of the functions of the OS are removed and only the core functional units are retained. The kernel is very small, and most of the system functions are outside the kernel. In the microkernel OS, new function components can be dynamically added, which is easy to expand, easy to debug, and easy to transplant. Communication Between Core Components and external components is message transmission, rather than direct function calls.

 

Important Concepts of Embedded Operating Systems
1,Preemptible Kernel: Once the current highest priority task is ready, the CPU control is immediately obtained, and the control is known;
2,Scheduling Policy Analysis(Strong real-time and weak real-time)
3,Task priority allocation(Static and dynamic)
4,Time certainty: Strong RTOS function calls and service execution time are deterministic. The execution time of system services does not depend on the number of application tasks. The time for the system to complete a specific task is predictable.
5,Task Switching time(Depends on the number of vcpus reg to be written into the stack)
6,Interrupt response time: In the preemptible kernel, the interrupt response time is equal to the maximum disconnection time, the time used to protect the internal registers of the CPU, the time used to enter the intermediate service function, and the time used to start executing the first ISR command;
7,Priority inversion(Solution: Priority Inheritance and priority limit)
8,Task execution time jitter
9,Task division(Principle: I/O principle, priority principle, large number of principles, function coupling, accidental coupling, and frequency combination)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.