Multi-core operating system architecture applied to acquisition terminal
By designing a multi-core operating system architecture on the acquisition terminal, combined with embedded macro kernels and micro-kernels, multi-core collaboration and cross-core communication are achieved, solving the stability problems of acquisition terminal software upgrades and resource management, and improving the real-time performance and performance of the system. Operational efficiency.
Patent Information
- Application Number
- CN202410829017.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-18
AI Technical Summary
Existing acquisition terminal software has instability and security issues in upgrades and resource management, and the real-time performance of multi-core systems is affected by competition for resource access. Traditional memory management methods cannot meet the needs.
A multi-core operating system architecture is designed, including an embedded macro-kernel operating system, an embedded micro-kernel real-time operating system, a shared storage space and a system boot loader. Data communication is realized through a pre-established inter-core data communication management mechanism, and three Staged multi-core operating system boot loading solution and container-based virtualization solution support multi-core collaboration and cross-core communication.
It realizes the decoupling of software and hardware of multi-core operating systems, improves the openness and flexibility of the operating system, improves the operating efficiency and response rate of the collection terminal, and supports efficient resource management and independently deployed APP applications.
Smart Images

Figure CN118796285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent measurement technology, and in particular to a multi-core operating system architecture applied to an acquisition terminal. Background Art
[0002] Existing acquisition terminals have the risk of technical constraints and limitations in software. Once the current software ecosystem is destroyed, the reliability, security and stability of the equipment cannot be guaranteed. The new generation of intelligent measurement systems has put forward higher requirements for the rapid upgrade and replacement of equipment software. At the same time, the embedded operating system lacks effective mechanism support in load balancing, resource sharing access and task real-time performance. In addition, for multi-core systems, while computing power increases, its real-time performance is often affected by resource access competition, so it is necessary to write a fully parallel kernel; for microcontroller systems, their memory management methods are different, and traditional abstract methods often cannot meet the needs, and cannot use the same system-level programming paradigm as medium and large computers. Summary of the invention
[0003] In view of the technical problems existing in the above-mentioned prior art, the present disclosure provides a multi-core operating system architecture applied to a collection terminal.
[0004] According to one aspect of the present application, a multi-core operating system architecture applied to a collection terminal is provided, including: an embedded macro-kernel operating system, an embedded micro-kernel real-time operating system, a shared storage space, and a system boot loader, wherein:
[0005] The shared storage space communicates with the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system through a pre-established inter-core data communication management mechanism, thereby realizing data communication between the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system;
[0006] The system boot loader is a pre-designed three-stage multi-core operating system boot loading solution, which is used to construct the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system initialization resource calling process.
[0007] Optionally, the embedded macro kernel operating system supports the simultaneous deployment of no less than 5 containers, and the container adopts a C / S framework, including three parts: client, host, and image repository, among which,
[0008] The client uses and manages the container service through HTTP or REST API with the container daemon according to the corresponding container commands;
[0009] The host runs various container components to provide container services. The container daemon is responsible for listening to client requests. The container image in the host provides the files required for container operation. The namespace is responsible for container resource isolation. The control group is responsible for container resource usage restrictions.
[0010] Image repository, responsible for container image storage management.
[0011] Optionally, the kernel functions of the embedded microkernel real-time operating system include a microkernel, root services, system services, a trusted boot program and an application framework, wherein:
[0012] The microkernel supports the necessary functions of the system, including address space, thread scheduling, interrupt management, inter-thread communication, and access control. The microkernel basic services include address space support for mapping between physical memory and virtual memory, and kernel memory space allocation management and isolation protection; thread scheduling supports priority-based preemption, system clock and thread queue-based time slice round-robin scheduling, and provides the best strategy for flexible resource allocation of real-time application tasks; interrupt management is responsible for processing all interrupts of the entire system, including interrupts used by the kernel and interrupts used by user-mode threads, to improve the responsiveness of real-time application task processing; inter-thread communication provides a message passing mechanism and event notification mechanism for inter-thread communication, and is also used to implement the kernel notifying related user-mode threads after receiving an interrupt request; access control capability implements a capability-based access control model, forcing access permission checks for all system calls, and quickly implementing access permission modification, granting, and revoking operations;
[0013] Root services include memory management, lightweight file system, and lightweight network protocol stack. Memory management is used to hand over system memory to component management service for management after the kernel is initialized. It can allocate memory efficiently and quickly, and release and recycle memory resources at the appropriate time. The lightweight file system encapsulates the read and write requests of the device into remote service calls to achieve the tailorability, configurability and reliability of service components. The lightweight network protocol stack is used to monitor the service requests of client components and network device components to ensure the reliability, security and correctness of data packets.
[0014] System services mainly include password library, log management, key-value database, database, graphical user interface, and security mechanism. The password library is used to store and manage user password information to prevent the operating system from being invaded by unauthorized users. The security mechanism mainly includes identity authentication mechanism, data encryption mechanism, security log mechanism, firewall mechanism, vulnerability scanning and patching mechanism, and security policy and rule formulation mechanism.
[0015] Trusted boot mainly performs integrity check on system images and executable files when the microkernel operating system starts or loads executable programs. If the check passes, it is allowed to start or run, otherwise it cannot be loaded into the memory to start or run, providing support for the synchronous operation of dual-core operating systems. The input of the image integrity verification function includes the address and length of the trusted public key and the address and length information of the image loaded into the memory;
[0016] The application framework integrates system service calls, C++ libraries, linear algebra libraries, and scripting engines.
[0017] Optionally, a three-stage multi-core operating system boot loading scheme includes: a first-stage program BL1, a second-stage program BL2, and third-stage programs BL31 and BL32. The boot process of the system boot loader is as follows: after the chip is reset, the BootROM of the hardware platform will first load the first-stage program BL1 image from the memory to the internal static random access memory of the processor, and jump to the entry address of the first-stage program BL1 in the internal static random access memory for execution. The first-stage program BL1 first checks which processor core the code is currently being executed on. If the code is being executed on the first processor core, the other processor cores are initialized, and the other processor cores are idle through the WFI instruction, allowing only the first processor core to execute the code; then the first-stage program BL1 initializes the dynamic random access memory and the interrupt controller, and loads other system images from the memory, including the system monitor program image, the microkernel operating system image, and the macrokernel image to the dynamic random access memory, and transfers control to the system monitor program;
[0018] The system monitoring program executes the second-stage program BL2, the third-stage programs BL31 and BL32 in sequence, and finally decides whether to boot the embedded macro-kernel operating system or the embedded micro-kernel real-time operating system first according to the configuration. When the embedded micro-kernel operating system is booted first, the fourth processor core is initialized, the entry code of the micro-kernel operating system is executed, and then jumps to the macro-kernel, and the multi-core processing initialization process of the embedded macro-kernel operating system is started: the second processor core and the third processor core are initialized in sequence, and these processor cores are put into an idle state, waiting for the wake-up scheduling of the embedded macro-kernel operating system kernel.
[0019] Optionally, the inter-core data communication management mechanism uses inter-core interrupt triggers for data communication between the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system, and exchanges data through shared storage space. The sender of the signal generates an inter-core interrupt by triggering the interrupt controller, and passes the signal to the receiver. The latter's current running state is immediately interrupted by the signal, and then the corresponding inter-core interrupt processing function is run.
[0020] The beneficial effects of the present invention are as follows:
[0021] 1. The present invention completes the design of a multi-core operating system architecture of "real-time core" + "management core". The architecture integrates the real-time processing capability of the microkernel and the management capability of the macrokernel, realizes dual-system booting, multi-core collaboration, and cross-core and cross-system communication mechanisms, gives full play to the advantages of multi-core processors, and is easier to adapt to the acquisition terminal platform.
[0022] 2. The present invention realizes the decoupling of multi-core operating system hardware and software. The virtualization solution based on container design supports the decoupling of deployed APP applications from the acquisition terminal hardware and the running operating system, supports independent deployment of APP applications, and has more sophisticated resource management, less resource consumption, higher operating efficiency and faster deployment.
[0023] 3. The present invention uniformly manages the embedded microkernel real-time operating system microkernel, root services, system services, trusted boot and application framework, and customizes and tailors the key modules of the operating system, thereby improving the openness, flexibility and convenience of the operating system.
[0024] 4. The inter-core communication component designed by the present invention is based on a message passing mechanism. Each processor uses this component to create an addressable endpoint through a shared memory for message communication, thereby reducing memory resource usage and improving the response rate of the acquisition terminal and the reliability of internal communications.
[0025] Based on the detailed description of the specific embodiments of the present application in combination with the accompanying drawings below, those skilled in the art will become more aware of the above and other objects, advantages and features of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Hereinafter, some specific embodiments of the present application will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
[0027] Figure 1 is a schematic diagram of a multi-core operating system architecture applied to a collection terminal according to an embodiment of the present application;
[0028] Figure 2 It is a schematic diagram of the overall architecture of container virtualization according to an embodiment of the present application;
[0029] Figure 3 It is a schematic diagram of the functional framework of the embedded real-time operating system kernel according to an embodiment of the present application;
[0030] Figure 4 is an execution flow chart of the integrity verification function according to an embodiment of the present application;
[0031] Figure 5is a system boot flow chart according to an embodiment of the present application;
[0032] Figure 6 It is an initialization diagram of the macro kernel and micro kernel operating system according to the embodiment of the present application;
[0033] Figure 7 is a schematic diagram of the SGIR register according to an embodiment of the present application;
[0034] Figure 8 It is a master-slave communication method in AMP according to the embodiment of the present application;
[0035] Fig. 9 is a schematic diagram of a message buffer in RPMsg according to an embodiment of the present application;
[0036] Fig.10 It is a schematic diagram of a process of a master core sending a message to a slave core according to an embodiment of the present application;
[0037] Fig.11 It is a schematic diagram of the process of sending a message from a core to a master core according to an embodiment of the present application. DETAILED DESCRIPTION
[0038] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0039] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0042] Boot: system boot; Definition: It is usually completed by a special code called a boot loader, which is located in the system read-only memory and is used to complete the entire system boot process of locating the specific location of the kernel code in the external memory, correctly loading the kernel into the memory as required, and finally making the kernel run.
[0043] Bootlaoder: Boot loader; Definition: The first code executed by the embedded system after power-on. After it completes the initialization of the processor and related hardware, it loads the operating system image or the solidified embedded application into the memory and then jumps to the space where the operating system is located to start the operating system. In this article, BL1 is the first stage program BL1 of the system boot, BL2 is the second stage program BL2 of the system boot, and BL31 and BL32 are the third stage programs of the system boot.
[0044] BootROM: boot code memory; Definition: After the processor is powered on, the first piece of code that is started can go to different storage devices to get the bootlaoder according to different boot modes (hardware dialing), and execute the bootloader to perform subsequent system startup work.
[0045] Internal SRAM: internal static random access memory; Definition: static random access memory integrated inside the chip. Executing the code in the static random access memory means starting to execute our BootLoader code, which will complete some hardware initialization work.
[0046] GIC: Interrupt Controller; Definition: The interrupt controller receives interrupts from peripherals, prioritizes them, and delivers them to the appropriate processor core.
[0047] Core: kernel; definition: refers to the operating system kernel.
[0048] WFI: Wait for Interrupt; Definition: The abbreviation of Wait For Interrupt. The WFI instruction allows the processor to enter low-power mode. At this time, the core will suspend other activities and wait for the occurrence of an interrupt event. After the interrupt is detected, the WFI instruction is executed and the processor exits the low-power mode.
[0049] Linux Kernel: operating system kernel; Definition: Linux operating system kernel.
[0050] Idle: Idle task; Definition: It is a special task in the operating system, which runs when there are no other tasks in the system that need to be executed.
[0051] APP: micro application; Definition: refers to a microcomputer program installed inside a terminal and running to complete one or more specific tasks.
[0052] AMP: Asymmetric processor; Definition: Each core has a special address, different address space, core architecture, instruction set, running operating system, etc., and is compiled independently, and each core is associated with an executable file.
[0053] SMP: Symmetric Multi-Processor; Definition: The kernel structure is the same, the architectural features, core architecture, instruction set and memory space are the same, unified compilation is used, and all cores are associated with one executable file.
[0054] RPMsg: Remote Processor Message Framework; Definition: A message bus that allows kernel drivers to communicate with remote processors available on the system.
[0055] SGI: Inter-core interrupt; Definition: An inter-core interrupt is when a processor sends an interrupt signal to a target processor in the system to enable the target processor to perform a specific operation.
[0056] Endpoint: Endpoint is the receiver or source of communication data between the host and the device. When the host and the device communicate, they will eventually use the various endpoints on the device. It is a logical terminal of the communication flow between the host and the device. A series of independent endpoints together constitute a USB logical device.
[0057] Figure 1 Schematic diagram of a multi-core operating system architecture applied to a collection terminal according to an embodiment of the present application. Figure 1 As shown, the multi-core operating system architecture applied to the acquisition terminal includes: an embedded macro-kernel operating system, an embedded micro-kernel real-time operating system, a shared storage space, and a system boot loader, wherein:
[0058] The shared storage space communicates with the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system through a pre-established inter-core data communication management mechanism, thereby realizing data communication between the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system;
[0059] The system boot loader is a pre-designed three-stage multi-core operating system boot loading solution, which is used to construct the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system initialization resource calling process.
[0060] Specifically, the multi-core operating system architecture design method for the acquisition terminal proposed in the present invention is mainly used for the design of the acquisition terminal operating system based on multi-core processor design in the new power system. Through the asymmetric software system, while ensuring the collaboration between the embedded Linux and the microkernel operating system, it effectively supports mixed time domain and mixed criticality application scenarios.
[0061] 1. Overall architecture design of multi-core operating system:
[0062] The overall architecture of a multi-core operating system is as follows Figure 1 As shown in the figure, it includes the main contents such as embedded Linux operating system architecture, embedded microkernel real-time operating system architecture, multi-core operating system booting, and inter-core communication management. First, the overall architecture of the multi-core operating system is constructed, integrating the macro-kernel management capability and the micro-kernel real-time processing capability; then, in order to ensure the overall coordination and real-time performance of the multi-core operating system, a three-stage (BL1 / BL2 / BL3) multi-core operating system boot loading scheme is designed, and the multi-core system initialization resource call process is reasonably constructed; finally, an inter-core data communication management mechanism based on shared storage space and inter-core message interrupt is established to realize data communication between the macro-kernel operating system and the embedded micro-kernel real-time operating system. Based on key technologies such as "real-time core" + "macro-kernel", three-stage multi-core booting, and interrupt-based inter-core communication, a complete multi-core operating system architecture solution is formed.
[0063] 2. Multi-core operating system macro kernel architecture:
[0064] The present invention designs a multi-core operating system macro kernel architecture based on the customized tailoring of the operating system and the integrated container virtualization solution based on the embedded Linux kernel, which can support the decoupling of deployed non-real-time and non-safe APP applications from the acquisition terminal hardware and the running operating system. The container virtualization component architecture diagram is shown in the figure. Figure 2As shown. At present, the actual application process of the new acquisition terminal can be divided into basic business, edge computing business, and advanced application business. Advanced applications can be divided into low-voltage centralized collection, special transformer collection, new energy regulation and other types. Considering the computing power requirements, software upgrades and resource isolation needs of advanced applications and edge computing applications, the virtualization solution design should support the simultaneous deployment of no less than 5 containers. The virtualization component can support remote online dynamic adjustment, that is, it supports local and remote start, stop, installation and uninstallation of containers, and does not affect the operation of deployed containers during operation; it supports local and remote container information query, including software list, version information, running status, CPU occupancy and memory occupancy, etc. It supports the function of monitoring container abnormalities, including container restart, CPU occupancy exceeding the limit and memory occupancy exceeding the limit.
[0065] The overall architecture of the container solution adopts a C / S framework, including three parts: client, host, and image repository. The client implements the use and management of container services with the container daemon through HTTP or RESTAPI according to the corresponding container commands; the host runs various container components to provide container services, among which the container daemon is responsible for listening to the client's requests, the container image provides the files required for container operation, the namespace is responsible for container resource isolation, and the Cgroup is responsible for container resource usage restrictions; the container image repository is responsible for container image storage management.
[0066] 3. Multi-core operating system microkernel architecture
[0067] The present invention carries out microkernel architecture design based on embedded microkernel real-time operating system. The kernel functions include microkernel, root service, system service, trusted boot program and application framework. Figure 3 As shown, it mainly serves real-time applications, safety-critical applications, and high-security level applications.
[0068] Among them, the microkernel supports the necessary functions of the system, including address space, thread scheduling, interrupt management, inter-thread communication, access control and other basic microkernel services. The address space can support the mapping between physical memory and virtual memory, and can allocate and manage the kernel memory space and isolate and protect it. Thread scheduling can support scheduling methods such as priority-based preemption and time slice rotation based on system clock and thread queue, providing the best strategy for flexible resource allocation of real-time application tasks. Interrupt management is responsible for processing all interrupts of the entire system, including interrupts used by the kernel and interrupts used by user-mode threads, to improve the responsiveness of real-time application task processing. Inter-thread communication provides a message passing mechanism and event notification mechanism for inter-thread communication, and is also used to implement the kernel notifying related user-mode threads after receiving an interrupt request. Access control capability implements a capability-based access control model, forcing access rights checks for all system calls, and can quickly implement operations such as modification, granting and revoking access rights, providing trusted identity authentication services for safety-critical applications and high-security application tasks.
[0069] The root services mainly include memory management, lightweight file system, lightweight network protocol stack, etc. After the kernel is initialized, it will hand over the system memory to the component management service for management, which can allocate efficiently and quickly, and release and recycle memory resources at the appropriate time. The lightweight file system encapsulates the read and write requests of the device into remote service calls to achieve the configurability and reliability of the service components. The main function is to provide the operating system with file data storage, access and search. The lightweight network protocol stack uses the lightweight protocol stack as the basic part of the microkernel network service component. The lightweight network protocol stack service component not only monitors the service requests of the client component, but also monitors the service requests of the network device component to ensure the reliability, security and correctness of the data packet.
[0070] System services mainly include password vault, log management, key-value database, database, graphical user interface, security mechanism, etc. The password vault is used to store and manage user password information to prevent the operating system from being invaded by unauthorized users. The security mechanism mainly includes identity authentication mechanism, data encryption mechanism, security log mechanism, firewall mechanism, vulnerability scanning and patching mechanism, security policy and rule formulation mechanism, etc., which effectively eliminate security risks and ensure the safe and reliable operation of security-critical applications and high-security application tasks.
[0071] Trusted boot mainly performs integrity check on system images and executable files when the microkernel operating system starts or loads executable programs. If the check passes, it is allowed to start or run. Otherwise, it cannot be loaded into memory to start or run, providing support for the synchronous operation of dual-core operating systems. The execution process of the image integrity verification function is as follows: Figure 4As shown, its input includes the address and length of the trusted public key and the address and length information of the image loaded into the memory.
[0072] The application framework integrates software capabilities such as system service calls, C++ libraries, linear algebra libraries, and scripting engines. It supports the development of applications using more developer-friendly languages such as C++ and Python, and provides a usage environment for real-time applications, safety-critical applications, and high-security-level applications.
[0073] 4. Multi-core operating system boot architecture
[0074] The system boot process is as follows Figure 5 As shown. After the chip is reset, the BootROM of the hardware platform will first load the BL1 image from the SD card to the internal SRAM of the processor, and jump to the entry address of BL1 in the internal SRAM to execute. BL1 first checks which processor core the code is currently executing on. If the code is executing on Core 0, it initializes other Cores and puts other Cores in IDLE state through the WFI instruction, allowing only Core 0 to execute code. Then BL1 initializes DDRSDRAM and GIC, and loads other system images from the SD card, including the system monitor image, microkernel operating system image, Linux Kernel image, etc. to DDR SDRAM, and transfers control to the system monitor.
[0075] The system monitoring program executes BL2, BL31, and BL32 in sequence, and finally decides whether to boot Linux or the microkernel operating system first according to the configuration. Taking the microkernel booting first as an example, it initializes Core3, executes the entry code of the microkernel operating system, then jumps to the Linux Kernel, and starts the Linux SMP initialization process: initialize Core1 and Core2 in sequence to make these processor cores enter the IDLE state and wait for the wake-up schedule of the Linux kernel, such as Figure 6 shown.
[0076] 5. Inter-core data communication management mechanism
[0077] In this scheme, data communication between the macro kernel operating system and the embedded micro kernel real-time operating system is triggered by inter-processor interrupt (IPI), and data is exchanged through shared memory. The sender of the signal transmits the signal to the receiver by triggering the SGI interrupt. The current running state of the receiver is immediately interrupted by the signal, and then the corresponding inter-core interrupt processing function is run. Inter-core interrupt refers to the interrupt between processor cores. When one core needs to interrupt another core, an inter-core interrupt is needed.
[0078] In the GIC (Software Generated Interrupt) provided by the ARM architecture, the inter-core interrupt is triggered by software. The key step is to set the SGIR (Software Generated Interrupt Register) register in the Distributor. This register is shared by multiple CPUs and can only be written but not read. The detailed information is as follows Figure 7 shown.
[0079] When the target register list, interrupt number and other information are written to the SGIR register, an inter-core interrupt will be triggered immediately. The interrupt signal is parsed in the Distributor and sent to the CPU Interface corresponding to the target CPU. If the priority of the interrupt is high enough and is not intercepted by the CPU Interface, the execution of the target CPU can be interrupted.
[0080] According to the actual situation of the specific embodiment of the present invention, an inter-core interrupt variable is defined for data communication interrupt, and the interrupt number is 14. After receiving the inter-core interrupt, the receiver receives the data according to the pre-determined data structure in the interrupt processing function, and completes the corresponding processing according to different commands after parsing the data.
[0081] (2) Data communication:
[0082] 1) Remoteproc framework implementation
[0083] The remoteproc framework abstracts away hardware differences and allows remote processors to be controlled, such as powering on, loading firmware, and powering off. In addition, the framework adds rpmsg virtio device support to the remote processors to facilitate rpmsg communication. In Linux, all rpmsg drivers need to work by implementing a few low-level handlers in the platform-specific remoteproc driver, while in RTOS, the remoteproc framework needs to be coded.
[0084] Currently, the remoteproc framework code directory in Linux is located in drivers / remoteproc / , which includes the implementation of core, elf_loader, sysfs, virtio files, etc., and needs to be ported for Linux.
[0085] In order to shorten the boot time of real-time applications, this project uses the real-time operating system as the main operating system to control the startup of the entire system. The Linux remoteproc driver is modified to remove the operation codes such as power on, firmware loading, and power off.
[0086] 2) Linux RPMsg driver implementation:
[0087] In the Linux kernel code, the RPMsg driver code is mainly located in drivers / rpmsg / . At first, Linux only used VirtIO as the protocol transport layer, and later added Glink, SMD, etc. Glink and SMD are mainly used on Qualcomm platforms. Therefore, it is necessary to transplant and customize the development for high-end control chip platforms.
[0088] The user code implements the data sending and receiving operations by manipulating the rpmsg driver. All data is transmitted on the RPMsg bus.
[0089] In the AMP system, the master-slave cores communicate through shared memory, such as Figure 8 As shown. The main core is responsible for memory management. There are two buffers in each communication direction, namely USED and AVAIL. This buffer can be divided into pieces and linked to form a ring according to the format of the message in RPMsg, as shown Fig. 9 shown.
[0090] When the master core needs to communicate with the slave core, it can be divided into four steps, such as Fig.10 shown.
[0091] ①The main core first obtains a block of memory from USED;
[0092] ②Fill the message according to the message protocol;
[0093] ③ Link the memory to the AVAIL ring;
[0094] ④Trigger an interrupt to notify the slave core that there is a message to process.
[0095] Conversely, the slave core needs to communicate with the master core in a similar manner, such as Fig.11 shown.
[0096] ①The main core first obtains a block of memory from AVAIL;
[0097] ②Fill the message according to the message protocol;
[0098] ③Link the memory to the USED swap;
[0099] ④Trigger an interrupt to notify the main core that there is a message to process.
[0100] The key points of the present invention are as follows:
[0101] 1. Multi-core operating system architecture design:
[0102] The multi-core operating system architecture design based on "real-time core" + "management core" fully considers the operation needs of different measurement terminals, integrates the real-time processing capabilities of the micro-kernel and the management capabilities of the macro-kernel, and adjusts the key modules of the embedded Linux operating system architecture and embedded micro-kernel real-time operating system architecture. The specific contents include:
[0103] (1) Customized tailoring of components such as kernel initialization, exception services, root services, trusted boot, and application framework in the microkernel to serve real-time applications, safety-critical applications, and high-security applications, ensuring the overall real-time performance of the dual-core operating system.
[0104] (2) An operating system virtualization architecture is established for the macro kernel, and an application management model of the integrated container is used to support remote online dynamic adjustment, that is, local and remote start, stop, installation and uninstallation functions are supported. The operation process does not affect the operation of the deployed containers. Application management modules such as lifecycle management, resource management, and information query are implemented to ensure the secure isolation and stable operation of business applications in the lightweight operating system.
[0105] The multi-core heterogeneous design has good flexibility and scalability. The number of processor cores can be increased or decreased in the system according to specific needs to adapt to different real-time performance requirements and the complexity of computing tasks. It can solve the problems of unbalanced load, resource access restrictions, low real-time performance, and high hardware and software coupling in the traditional acquisition terminal operating system architecture.
[0106] 2. Multi-core operating system boot solution:
[0107] The present invention designs a dual-core system boot process and an initialization process of Linux and a microkernel operating system, and can determine whether to boot Linux or the microkernel operating system first according to the configuration, thereby ensuring that the dual-core system starts in an orderly manner and runs synchronously and stably.
[0108] 3. Inter-core communication mechanism:
[0109] The present invention designs a message transmission mechanism based on inter-core interrupts. In a multi-core processor, if one core wants to trigger an interrupt with a destination of another core, or forwards a received interrupt to another core, an inter-core interrupt is generated. The interrupt refers to an interrupt between processor cores. According to the target processor address contained in the message and the source processor address in the message header, a cross-core and cross-system communication mechanism is implemented. This communication mechanism occupies less memory resources and can improve the operation response rate of the acquisition terminal and the reliability of internal communication.
[0110] The beneficial effects of the present invention are as follows:
[0111] 1. The present invention completes the design of a multi-core operating system architecture of "real-time core" + "management core". The architecture integrates the real-time processing capability of the microkernel and the management capability of the macrokernel, realizes dual-system booting, multi-core collaboration, and cross-core and cross-system communication mechanisms, gives full play to the advantages of multi-core processors, and is easier to adapt to the acquisition terminal platform.
[0112] 2. The present invention realizes the decoupling of multi-core operating system hardware and software. The virtualization solution based on container design supports the decoupling of deployed APP applications from the acquisition terminal hardware and the running operating system, supports independent deployment of APP applications, and has more sophisticated resource management, less resource consumption, higher operating efficiency and faster deployment.
[0113] 3. The present invention uniformly manages the embedded microkernel real-time operating system microkernel, root services, system services, trusted boot and application framework, and customizes and tailors the key modules of the operating system, thereby improving the openness, flexibility and convenience of the operating system.
[0114] 4. The inter-core communication component designed by the present invention is based on a message passing mechanism. Each processor uses this component to create an addressable endpoint through a shared memory for message communication, thereby reducing memory resource usage and improving the response rate of the acquisition terminal and the reliability of internal communications.
[0115] Unless otherwise specifically stated, the relative arrangement of the parts and steps described in these embodiments, numerical expressions and numerical values do not limit the scope of the present disclosure. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship. The technology, methods and equipment known to ordinary technicians in the relevant field may not be discussed in detail, but in appropriate cases, the technology, methods and equipment should be regarded as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0116] For ease of description, spatially relative terms such as "above", "above", "on the upper surface of", "above", etc. may be used here to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" can include both "above" and "below". The device can also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatially relative descriptions used here are interpreted accordingly.
[0117] In the description of the present disclosure, it is necessary to understand that the orientation or positional relationship indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, perpendicular, horizontal" and "top, bottom" are usually based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the scope of protection of the present disclosure; the directional words "inside and outside" refer to the inside and outside relative to the outline of each component itself.
[0118] The above is only a preferred specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A multi-core operating system architecture applied to acquisition terminals, It is characterized in that include: Embedded macro kernel operating system, embedded micro kernel real-time operating system, shared storage space and system boot loader, among which, The shared storage space is connected to the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system through a pre-established inter-kernel data communication management mechanism, thereby realizing data communication between the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system; The system boot loader is a pre-designed three-stage multi-core operating system boot loading solution, which is used to construct the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system initialization resource calling process.
2. The multi-core operating system architecture according to claim 1, It is characterized in that The embedded macro kernel operating system supports the simultaneous deployment of no less than 5 containers. The container adopts a C / S framework, including three parts: client, host, and image repository. The client implements container service usage and management with the container daemon through HTTP or REST API according to the corresponding container command; The host runs various container components to provide container services, wherein the container daemon is responsible for listening to requests from the client; the container image in the host provides the files required for container operation, the namespace is responsible for resource isolation of the container, and the control group is responsible for limiting the use of container resources; The image repository is responsible for container image storage management.
3. The multi-core operating system architecture according to claim 1, It is characterized in that The kernel functions of the embedded microkernel real-time operating system include microkernel, root service, system service, trusted boot program and application framework, wherein: The microkernel supports the necessary functions of the system, including address space, thread scheduling, interrupt management, inter-thread communication, and access control microkernel basic services. The address space supports mapping between physical memory and virtual memory, and manages the allocation and isolation protection of kernel memory space; the thread scheduling supports priority-based preemption, system clock and thread queue-based time slice round-robin scheduling, and provides the best strategy for flexible resource allocation of real-time application tasks; the interrupt management is responsible for processing all interrupts of the entire system, including interrupts used by the kernel and interrupts used by user-mode threads, to improve the responsiveness of real-time application task processing; the inter-thread communication provides a message passing mechanism and an event notification mechanism for inter-thread communication, and is also used to implement the kernel notifying the relevant user-mode threads after receiving an interrupt request; the access control capability implements a capability-based access control model, forcing access permission checks for all system calls, and quickly implementing access permission modification, granting and revoking operations; The root service includes memory management, lightweight file system, and lightweight network protocol stack. The memory management is used to hand over the system memory to the component management service for management after the kernel is initialized, which can efficiently and quickly allocate, and release and recycle memory resources at the appropriate time; the lightweight file system encapsulates the read and write requests of the device into remote service calls to achieve the tailorability, configurability and reliability of the service component; the lightweight network protocol stack is used to monitor the service requests of the client component and the service requests of the network device component to ensure the reliability, security and correctness of the data packet; The system services mainly include password library, log management, key-value database, database, graphical user interface, and security mechanism, wherein the password library is used to store and manage user password information to prevent the operating system from being invaded by unauthorized users; the security mechanism mainly includes identity authentication mechanism, data encryption mechanism, security log mechanism, firewall mechanism, vulnerability scanning and patching mechanism, and security policy and rule formulation mechanism; The trusted boot is mainly to perform integrity check on the system image and executable file when the microkernel operating system starts or loads the executable program. If the check passes, it is allowed to start or run, otherwise it cannot be loaded into the memory to start or run, providing support for the synchronous operation of the dual-core operating system. The input of the image integrity verification function includes the address and length of the trusted public key and the address and length information of the image loaded into the memory; The application framework integrates system service calls, C++ libraries, linear algebra libraries and script engines.
4. The multi-core operating system architecture according to claim 1, It is characterized in that The three-stage multi-core operating system boot loading scheme includes: a first-stage program BL1, a second-stage program BL2, and third-stage programs BL31 and BL32. The boot process of the system boot loader is as follows: after the chip is reset, the BootROM of the hardware platform will first load the first-stage program BL1 image from the memory to the internal static random access memory of the processor, and jump to the entry address of the first-stage program BL1 in the internal static random access memory for execution. The first-stage program BL1 first checks which processor core the code is currently executed on. If the code is executed on the first processor core, the other processor cores are initialized, and the other processor cores are put into an idle state through the WFI instruction, and only the first processor core is allowed to execute the code; then the first-stage program BL1 initializes the dynamic random access memory and the interrupt controller, and loads other system images from the memory, including the system monitoring program image, the microkernel operating system image, and the macrokernel image to the dynamic random access memory, and transfers the control right to the system monitoring program; The system monitoring program executes the second stage program BL2, the third stage programs BL31 and BL32 in sequence, and finally decides whether to boot the embedded macro kernel operating system or the embedded micro kernel real-time operating system first according to the configuration. When the embedded micro kernel operating system is booted first, the fourth processor core is initialized, the entry code of the micro kernel operating system is executed, and then jumps to the macro kernel, and the multi-core processing initialization flow of the embedded macro kernel operating system is started: the second processor core and the third processor core are initialized in sequence, and these processor cores are put into an idle state, waiting for the wake-up scheduling of the embedded macro kernel operating system kernel.
5. The multi-core operating system architecture according to claim 1, It is characterized in that The inter-core data communication management mechanism uses inter-core interrupt triggers for data communication between the embedded macro-kernel operating system and the embedded micro-kernel real-time operating system, and exchanges data through shared storage space. The sender of the signal generates an inter-core interrupt by triggering the interrupt controller, and transmits the signal to the receiver. The latter's current running state is immediately interrupted by the signal, and then the corresponding inter-core interrupt processing function is run.
Citation Information
Cited By
Multi-APP implementation method based on power gap operating system, medium and terminal
CN119065821A
Common resource access system, common resource control method, and electronic device
CN119201500A
Embedded software system architecture and application method
CN119759345A
Embedded software system architecture and application method
CN119759345B
Cortex-M85 kernel-based multi-core operating system synchronous starting method
CN120144213A
