CN-121996378-A - Interrupt processing method, system and electronic equipment
Abstract
The application provides an interrupt processing method, a system and electronic equipment, wherein the system comprises hardware equipment and a microkernel operating system, the microkernel operating system comprises a microkernel and a user state process, the microkernel comprises an interrupt management node and an interrupt endpoint, the user state process comprises an interrupt service process and an application node, and the interrupt service process is registered with the corresponding interrupt endpoint. The method comprises the steps that hardware equipment sends interrupt information to an interrupt management node under the condition that interrupt exists, the interrupt management node determines a corresponding interrupt endpoint according to the interrupt information and sends the interrupt information to the corresponding interrupt endpoint, an interrupt service process serves as an interrupt monitoring receiver, and under the condition that the registered interrupt endpoint has the interrupt information, the interrupt service process obtains the interrupt information from the registered interrupt endpoint and sends the interrupt information to the corresponding application node so that the application node can conduct corresponding interrupt processing according to the interrupt information. In this way, interrupt handling in the microkernel operating system is better achieved.
Inventors
- HAN JINGLONG
Assignees
- 零束科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260121
Claims (10)
- 1. An interrupt processing method, applied to an interrupt processing system, where the interrupt processing system includes a hardware device and a microkernel operating system, where the microkernel operating system includes a microkernel and a user-mode process, where the microkernel includes an interrupt management node and at least one interrupt endpoint, where the user-mode process includes at least one interrupt service process, and at least one application node corresponding to each interrupt service process, where each interrupt service process registers a corresponding interrupt endpoint, and where the method includes: The hardware device sends corresponding interrupt information to the interrupt management node in the microkernel under the condition that interrupt exists, wherein the interrupt information comprises interrupt type identification information; The interrupt management node in the microkernel receives the interrupt information, determines an interrupt type corresponding to the interrupt information according to the interrupt type identification information included in the interrupt information, determines an interrupt endpoint corresponding to the interrupt information according to the interrupt type and a corresponding relation between a preset interrupt type and the interrupt endpoint, and sends the interrupt information to the corresponding interrupt endpoint; The interrupt service process is used as an interrupt monitoring receiver, monitors the registered interrupt endpoint, acquires the interrupt information from the registered interrupt endpoint when the interrupt information exists at the interrupt endpoint, and sends the acquired interrupt information to the corresponding application node so that the application node can perform corresponding interrupt processing according to the interrupt information.
- 2. The method of claim 1, wherein the interrupt endpoint has information caching capabilities, the method further comprising: And under the condition that the interrupt endpoint determines that interrupt triggering exists when receiving the interrupt information, if the interrupt endpoint determines that no interrupt service process is used as an interrupt monitoring receiver to monitor and acquire the interrupt information, caching the interrupt information into an interrupt cache queue corresponding to the interrupt endpoint based on a linked list form.
- 3. The method of claim 2, wherein the operational state of the interrupt endpoint includes an idle state, a transmit state, and a receive state, the method further comprising: and the interrupt endpoint adjusts the running state of the interrupt endpoint according to whether the interrupt service process is used as an interrupt monitoring receiver to monitor and acquire the interrupt information and whether interrupt triggering exists.
- 4. The method of claim 3, wherein the interrupt endpoint adjusting the operating state of the interrupt endpoint based on whether the interrupt service process is listening for the interrupt information as an interrupt listening recipient and whether there is an interrupt trigger comprises: When the interrupt service process is not used as an interrupt monitoring receiver to monitor and acquire the interrupt information and interrupt trigger is not generated, the interrupt endpoint is in the idle state; When the interrupt service process is not used as an interrupt monitoring receiver to monitor and acquire the interrupt information, but interrupt triggering exists, the interrupt endpoint is in a sending state; When the interrupt service process is used as an interrupt monitor receiver to monitor and acquire the interrupt information but no interrupt trigger is generated, the interrupt endpoint is in a receiving state, wherein, If the interrupt information exists at the interrupt endpoint, the interrupt trigger is considered to exist, and if the interrupt information does not exist at the interrupt endpoint, the interrupt trigger is considered to be absent.
- 5. The method of claim 4, wherein the interrupt service process, as an interrupt snoop receiver, snoops the registered interrupt endpoint, comprising: When the interrupt endpoint registered by the interrupt service process is in an idle state, the interrupt service process is suspended in a receiving blocking state when the interrupt endpoint registered by the interrupt service process monitors to acquire the interrupt information, and enters a thread waiting queue of the interrupt endpoint registered by the interrupt service process so as to monitor to acquire the corresponding interrupt information; When the interrupt endpoint registered by the interrupt service process is in a sending state, the interrupt service process directly acquires the corresponding interrupt information from an interrupt cache queue of the registered interrupt endpoint when monitoring that the registered interrupt endpoint acquires the interrupt information; When the interrupt endpoint registered by the interrupt service process is in a receiving state, when the interrupt endpoint registered by the interrupt service process monitors to acquire the interrupt information, the interrupt service process suspended in a receiving blocking state is triggered based on the interrupt of the registered interrupt endpoint, and the interrupt service process is added into an executable scheduling queue after awakening to monitor and acquire the corresponding interrupt information.
- 6. The method of claim 5, wherein the microkernel further comprises an interrupt scheduling node, the method further comprising enabling registration of the interrupt endpoint by the interrupt service process by: The interrupt service process sends an interrupt registration request to the interrupt scheduling node in the microkernel, wherein the interrupt registration request comprises interrupt type identification information of an interrupt type corresponding to the interrupt service process; The interrupt dispatching node in the microkernel determines the interrupt endpoint corresponding to the interrupt service process according to the interrupt type corresponding to the interrupt type identification information included in the interrupt registration request, completes registration configuration between the interrupt service process and the interrupt endpoint, returns corresponding configuration information to the interrupt service process, and stores the corresponding relationship between the interrupt type corresponding to the interrupt service process and the interrupt endpoint registered by the interrupt service process in a vector table manner; And the interrupt service process completes corresponding registration configuration according to the configuration information.
- 7. The method of claim 6, wherein one or more of the interrupt service processes are registered at each of the interrupt endpoints and/or wherein each of the interrupt service processes is registered with a corresponding one or more of the interrupt endpoints.
- 8. The method of claim 7, wherein the application node is a device driver in a user mode, and wherein the interrupt information further comprises interrupt content description information.
- 9. An interrupt processing system, characterized in that the interrupt processing system comprises a hardware device and a microkernel operating system, the microkernel operating system comprises a microkernel and a user-mode process, the microkernel comprises an interrupt management node and at least one interrupt endpoint, the user-mode process comprises at least one interrupt service process and at least one application node corresponding to each interrupt service process, each interrupt service process is registered with the corresponding interrupt endpoint, wherein, The hardware device is used for sending corresponding interrupt information to the interrupt management node in the microkernel under the condition that an interrupt exists, and the interrupt information comprises interrupt type identification information; The interrupt management node in the microkernel is configured to receive the interrupt information, determine an interrupt type corresponding to the interrupt information according to the interrupt type identification information included in the interrupt information, determine an interrupt endpoint corresponding to the interrupt information according to the interrupt type and a preset corresponding relation between the interrupt type and the interrupt endpoint, and send the interrupt information to the corresponding interrupt endpoint; The interrupt service process is used as an interrupt monitoring receiver for monitoring the registered interrupt endpoint, acquiring the interrupt information from the registered interrupt endpoint when the interrupt information exists at the interrupt endpoint, and sending the acquired interrupt information to the corresponding application node so that the application node performs corresponding interrupt processing according to the interrupt information.
- 10. An electronic device comprising an interrupt handling system according to claim 9 for implementing an interrupt handling method according to any of claims 1-8.
Description
Interrupt processing method, system and electronic equipment Technical Field The present application relates to the field of interrupt processing technologies for microkernel operating systems, and in particular, to an interrupt processing method, system, and electronic device. Background Microkernel operating systems are operating systems based on microkernel architecture, whose core idea is to "minimize the kernel", i.e. only keep the smallest and most critical core functions (e.g. functions of process scheduling, memory management, inter-process communication, etc.) in the microkernel, while most system services (e.g. services of file system, device driver, network protocol stack, etc.) are moved to user-mode process operation. This architecture promotes the modularity and flexibility of the system, but also presents a challenge of efficiently and safely notifying interrupt information in the hardware device to user-oriented processes in the microkernel operating system to better implement interrupt handling. Disclosure of Invention The application provides an interrupt processing method, an interrupt processing system and electronic equipment, which can more efficiently and safely inform interrupt information in hardware equipment to a user state process in a microkernel operating system so as to better realize interrupt processing. In a first aspect, an implementation manner of the present application provides an interrupt processing method, which is applied to an interrupt processing system, where the interrupt processing system includes a hardware device and a microkernel operating system, the microkernel operating system includes a microkernel and a user state process, the microkernel includes an interrupt management node and at least one interrupt endpoint, the user state process includes at least one interrupt service process, and at least one application node corresponding to each interrupt service process, and each interrupt service process registers a corresponding interrupt endpoint. The method comprises the steps that under the condition that the hardware equipment has an interrupt, corresponding interrupt information is sent to an interrupt management node in the micro-kernel, and the interrupt information comprises interrupt type identification information. The interrupt management node in the micro-kernel receives the interrupt information, determines the interrupt type corresponding to the interrupt information according to the interrupt type identification information included in the interrupt information, determines the interrupt endpoint corresponding to the interrupt information according to the interrupt type and the corresponding relation between the preset interrupt type and the interrupt endpoint, and sends the interrupt information to the corresponding interrupt endpoint. The interrupt service process is used as an interrupt monitoring receiver, monitors the registered interrupt endpoint, acquires interrupt information from the registered interrupt endpoint when the registered interrupt endpoint is monitored to have interrupt information, and sends the acquired interrupt information to the corresponding application node so that the application node can perform corresponding interrupt processing according to the interrupt information. In the technical scheme provided by the implementation mode of the application, an interrupt management node and at least one interrupt endpoint are arranged in the microkernel, the corresponding relation between interrupt types and interrupt endpoints is preset in the interrupt management node, the interrupt service process in the user state process registers the corresponding interrupt endpoint, and the interrupt service process is used as an interrupt monitoring receiver to monitor the registered interrupt endpoint so as to acquire the corresponding interrupt information. Therefore, under the condition that the interrupt management node in the microkernel receives the interrupt information sent by the hardware peripheral, according to the interrupt type corresponding to the interrupt information and the corresponding relation between the preset interrupt type and the interrupt endpoint, the interrupt information can be transmitted or routed to the corresponding interrupt endpoint, and further the interrupt information is acquired by the interrupt service process registered with the interrupt endpoint based on the monitoring mechanism, so that the purpose of transmitting the interrupt information in the microkernel to the interrupt service process in the user state process and finally transmitting the interrupt information to the corresponding application node in the user state process for corresponding interrupt processing is achieved, namely the purpose of notifying the interrupt information in the hardware device to the user state process in the microkernel operating system is achieved. Therefore, based on the corresponding relation of the inter