Method and apparatus for starting server device
By deploying a faster operating system on the server device to process requests first and then handing over control permissions when it starts up and allows communication, the problem of low interaction efficiency between server devices is solved, and a more efficient communication process is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2026-04-02
AI Technical Summary
The interaction efficiency between server devices is low.
By deploying two operating systems on the server device, one operating system, which is faster, first gains control of the bus to process the request results, and then hands over control to the other operating system when communication is enabled, until all interactions are completed by the slower operating system.
It improves the interaction efficiency between server devices, avoids interaction obstacles caused by slow operating system startup, and enhances the overall efficiency of the communication process.
Smart Images

Figure CN2025107751_02042026_PF_FP_ABST
Abstract
Description
Method and apparatus for starting server device
[0001] Cross Reference to Related Applications
[0002] The present application claims priority to the Chinese patent application No. 202411343001.6, filed on September 25, 2024, and entitled "Method and apparatus for starting server device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] Embodiments of the present application relate to the field of computers, and in particular, to a method and apparatus for starting a server device. BACKGROUND
[0004] In the process of starting a server device, the cooperation of another server device is usually involved. In the running process of the server device, data interaction with other server devices is also involved. Currently, the server device is connected to other server devices through a bus, and the server devices connected through the bus interact with each other through the bus. However, the current interaction efficiency between server devices is relatively low. SUMMARY
[0005] Embodiments of the present application provide a method and apparatus for starting a server device to at least solve the problem of low interaction efficiency between server devices in the related art.
[0006] According to one embodiment of the present application, a starting method of a server device is provided, a first operating system and a second operating system are deployed on the first server device, the response speed of the first operating system is greater than that of the second operating system, the first server device is connected with a second server device through a target bus, the method is applied to the first server device, and the method comprises the following steps: in the case that the first server device is started and the first operating system has been started, the first operating system acquires the control right of the target bus, receives a first device request initiated by the second server device, acquires the processing right of the device request by the first operating system to execute the first device request to obtain a first request result, and transmits the first request result to the second server device by the first operating system using the control right of the target bus; in the case that the second operating system is started to the stage of allowing communication with the second server device, the second operating system acquires the control right of the target bus, receives a second device request initiated by the second server device, and transmits the second device request to the first operating system, the first operating system continues to execute the second device request by using the processing right of the device request to obtain a second request result and transmits the second request result to the second operating system, and the second operating system transmits the second request result to the second server device by using the control right of the target bus; in the case that the second operating system is started to the stage of allowing execution of the device request, the second operating system receives a third device request initiated by the second server device by using the control right of the target bus, acquires the processing right of the device request by the second operating system to execute the third device request to obtain a third request result, and transmits the third request result to the second server device by the second operating system using the control right of the target bus.
[0007] As an optional implementation, the first server device comprises a baseboard management controller of the target server, the second server device comprises a server host of the target server, and the target bus is a bus allowing transmission of data conforming to the intelligent platform management interface protocol; in a case where the first server device is started and the first operating system has been started, the first operating system takes control authority of the target bus, receives a first device request initiated by the second server device, executes the first device request to obtain a first request result by taking processing authority of the device request, and sends the first request result to the second server device by using the control authority of the target bus, comprising: in a case where the target server is started, starting the first operating system and the second operating system on the baseboard management controller; in a case where a first bus driver of the target bus has been loaded on the first operating system and a first application program conforming to the intelligent platform management interface protocol has been run, the first operating system takes control authority of the target bus, and receives a first device request initiated by a basic input output system run on the server host through the first bus driver; the first operating system takes processing authority of the device request, and executes the first device request to obtain a first request result through the first application program; and the first operating system sends the first request result to the basic input output system through the first bus driver by using the control authority of the target bus.
[0008] As an optional implementation, in a case where the second operating system starts to a stage allowing communication with the second server device, the second operating system takes control authority of the target bus, receives a second device request initiated by the second server device, and transmits the second device request to the first operating system, the first operating system continues to execute the second device request to obtain a second request result by using processing authority of the device request, and transmits the second request result to the second operating system, and the second operating system sends the second request result to the second server device by using the control authority of the target bus, comprising: in a case where the second operating system starts to a stage where a second bus driver of the target bus has been loaded, determining that the second operating system has started to the stage allowing communication with the second server device; the second operating system takes control authority of the target bus, receives a second device request initiated by the basic input output system through the second bus driver, and transmits the second device request to the first operating system; the first operating system continues to execute the second device request to obtain a second request result by using processing authority of the device request, and transmits the second request result to the second operating system through the first application program; and the second operating system sends the second request result to the basic input output system through the second bus driver by using the control authority of the target bus.
[0009] As an optional implementation, in the case that the second operating system starts to the stage of allowing the execution of the device request, the third device request initiated by the second server device is received by the second operating system using the control right of the target bus, the third device request is executed by the second operating system to obtain a third request result, and the third request result is sent to the second server device by the second operating system using the control right of the target bus, comprising: in the case that the second operating system starts to the second application program which has run the intelligent platform management interface protocol, it is determined that the second operating system has started to the stage of allowing the execution of the device request; the third device request initiated by the basic input output system is received by the second operating system using the control right of the target bus through the second bus driver; the third device request is executed by the second operating system to obtain a third request result; and the third request result is sent to the basic input output system by the second operating system using the control right of the target bus through the second bus driver.
[0010] As an optional implementation, the second device request initiated by the second server device is received by the second operating system using the control right of the target bus and transmitted to the first operating system, the second device request is continued to be executed by the first operating system using the processing right of the device request to obtain a second request result and transmitted to the second operating system, and the second request result is sent to the second server device by the second operating system using the control right of the target bus, comprising: the control right of the target bus is obtained by the second operating system from the first operating system; the second device request initiated by the second server device on the target bus is obtained by the second operating system using the control right of the target bus to access the target bus; and the second device request is sent to the first operating system by the second operating system.
[0011] The second device request is continued to be executed by the first operating system using the processing right of the device request to obtain a second request result of the second device request; the second request result is sent to the second operating system by the first operating system; and the second request result is sent to the second server device by the second operating system using the control right of the target bus to access the target bus.
[0012] As an optional implementation, sending, by the second operating system, the second device request to the first operating system comprises: writing, by the second operating system, the second device request into a target storage space on the first server device, wherein the target storage space is accessible to the first operating system and also accessible to the second operating system; triggering, by the second operating system, a first interrupt to the first operating system; reading, by the first operating system, the second device request from the target storage space in response to the first interrupt; and sending, by the first operating system, a second request result to the second operating system, comprising: writing, by the first operating system, the second request result into the target storage space; triggering, by the first operating system, a second interrupt to the second operating system; and reading, by the second operating system, the second request result from the target storage space in response to the second interrupt.
[0013] As an optional implementation, receiving, by the second operating system, the second device request initiated by the second server device and transmitting the second device request to the first operating system by obtaining the control right of the target bus comprises: requesting, by the second operating system, the control right of the target bus from the first operating system; accessing, by the second operating system, the target bus to obtain the second device request initiated by the second server device through the target bus in a case where the second operating system has requested the control right of the target bus; and transmitting, by the second operating system, the second device request to the first operating system through a target storage space on the first server device, wherein the target storage space is accessible to the first operating system and also accessible to the second operating system.
[0014] As an optional implementation, requesting, by the second operating system, the control right of the target bus from the first operating system comprises: sending, by the second operating system, a first control request to the first operating system, wherein the first control request is used to request the control right of the target bus; releasing, by the first operating system, the control right of the target bus in response to the first control request, and sending first response information to the second operating system, wherein the first response information is used to indicate that the second operating system is allowed to obtain the control right of the target bus; and determining, by the second operating system, that the control right of the target bus has been requested in response to the first response information, or determining, by the second operating system, that the control right of the target bus has been requested in a case where the second operating system does not receive the first response information within a first time period after detecting the first control request.
[0015] As an optional implementation, the first control request is sent from the second operating system to the first operating system, including: writing, by the second operating system, the first control request into a target storage space on the first server device, wherein the target storage space is accessible to the first operating system and also accessible to the second operating system; triggering, by the second operating system, a third interrupt to the first operating system; releasing, by the first operating system, the control right of the target bus in response to the first control request, and sending first response information to the second operating system, including: reading, by the first operating system, the first control request from the target storage space in response to the third interrupt; releasing, by the first operating system, the control right of the target bus in response to the first control request, and writing first response information into the target storage space; triggering, by the first operating system, a fourth interrupt to the second operating system; determining, by the second operating system, that the control right of the target bus has been requested in response to the first response information, including: reading, by the second operating system, the first response information from the target storage space in response to the fourth interrupt; determining, by the second operating system, that the control right of the target bus has been requested according to the first response information.
[0016] As an optional implementation, the third device request is executed by the second operating system to obtain a third request result, including: requesting, by the second operating system, the processing right of the device request from the first operating system; in the case that the second operating system has requested the processing right of the device request, executing, by the second operating system, the third device request by running the application program of the device request to obtain the third request result.
[0017] As an optional implementation, the processing right of the device request is requested by the second operating system from the first operating system, including: sending, by the second operating system, a second control request to the first operating system, wherein the second control request is used to request the processing right of the device request; releasing, by the first operating system, the processing right of the device request in response to the second control request, and sending second response information to the second operating system, wherein the second response information is used to indicate that the second operating system is allowed to obtain the processing right of the device request; determining, by the second operating system, that the processing right of the device request has been requested in response to the second response information, or determining, by the second operating system, that the processing right of the device request has been requested in the case that the second operating system has not received the second response information within a second time period after sending the second control request.
[0018] As an optional implementation, the sending of the second control request from the second operating system to the first operating system comprises: writing, by the second operating system, the second control request into a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system; triggering, by the second operating system, a fifth interrupt to the first operating system; releasing, by the first operating system, the processing authority requested by the device in response to the second control request, and sending second response information to the second operating system, comprising: reading, by the first operating system, the second control request from the target storage space in response to the fifth interrupt; releasing, by the first operating system, the processing authority requested by the device in response to the second control request, and writing second response information into the target storage space; triggering, by the first operating system, a sixth interrupt to the second operating system; determining, by the second operating system, that the processing authority requested by the device has been requested in response to the second response information, comprising: reading, by the second operating system, the second response information from the target storage space in response to the sixth interrupt; determining, by the second operating system, that the processing authority requested by the device has been requested according to the second response information.
[0019] As an optional implementation, a target memory area is divided in the memory of the first server device, a first interrupt service function, an interrupt receiving thread and a service module are deployed in the first operating system, a kernel layer and an application layer are divided in the second operating system, an inter-core communication driver is loaded in the kernel layer, and a service process is deployed in the application layer, the target memory area is set to be accessible by both the interrupt receiving thread and the inter-core communication driver, and the method further comprises: in a case where the service process generates first data to be sent to the service module, sending, by the service process, the first data to the inter-core communication driver through a system call; writing, by the inter-core communication driver, the first data into the target memory area, and sending a first inter-core soft interrupt to the first operating system; triggering, by the first operating system, the first interrupt service function after receiving the first inter-core soft interrupt; awakening, by the first interrupt service function, the interrupt receiving thread; reading, by the interrupt receiving thread, the first data from the target memory area, and sending the first data to the service module.
[0020] As an optional implementation, the memory of the first server device is divided into a target memory area, an interrupt sending thread and a service module are run in the first operating system, a kernel layer and an application layer are divided in the second operating system, an inter-core communication driver is loaded in the kernel layer, a second interrupt service function is deployed in the inter-core communication driver, a service process is deployed in the application layer, the target memory area is set to be accessible by both the interrupt sending thread and the inter-core communication driver, and the method further comprises: in a case where the service module generates second data to be sent to the service process, sending, by the service module, the second data to the interrupt sending thread; writing, by the interrupt sending thread, the second data into the target memory area and sending a second inter-core soft interrupt to the inter-core communication driver; triggering, by the inter-core communication driver, the second interrupt service function; reading, by the second interrupt service function, the second data from the target memory area and sending, by the second interrupt service function, the second data to the service process through a system call.
[0021] As an optional implementation, after receiving a third device request initiated by the second server device using the control right of the target bus by the second operating system, the method further comprises: monitoring, by the first operating system, a running state of the processing right of the device request on the second operating system; in a case where the running state is monitored to indicate that the processing right of the device request on the second operating system runs abnormally, acquiring, from the second operating system, the control right of the target bus and the processing right of the device request; and controlling, by the first operating system, the second operating system to restart.
[0022] As an optional implementation, monitoring, by the first operating system, the running state of the processing right of the device request on the second operating system comprises: sending, by the first operating system, a heartbeat command to the second operating system, wherein the heartbeat command is used to instruct the second operating system to send a system state of the second operating system and a functional state of the processing right of the device request to the first operating system, wherein the running state of the processing right of the device request on the second operating system comprises the system state and the functional state; and the method further comprises: listening, by the second operating system, to the heartbeat command; in a case where a time length during which the heartbeat command is not listened to is greater than or equal to a target time length, determining that the first operating system runs abnormally, and restarting, by the second operating system, the first operating system.
[0023] According to another embodiment of the present application, a starting device of a server device is provided, a first server device is deployed with a first operating system and a second operating system, the response speed of the first operating system is greater than that of the second operating system, the first server device is connected with a second server device through a target bus, the device is applied to the first server device, and the device comprises: a first running module configured to, in a case where the first server device is started and the first operating system is started, acquire control authority of the target bus by the first operating system, receive a first device request initiated by the second server device, acquire processing authority of the device request by the first operating system to execute the first device request to obtain a first request result, and send the first request result to the second server device by the first operating system using the control authority of the target bus; a second running module configured to, in a case where the second operating system is started to a stage of allowing communication with the second server device, acquire control authority of the target bus by the second operating system, receive a second device request initiated by the second server device and transmit the second device request to the first operating system, continue to execute the second device request by the first operating system using the processing authority of the device request to obtain a second request result and transmit the second request result to the second operating system, and send the second request result to the second server device by the second operating system using the control authority of the target bus; and a third running module configured to, in a case where the second operating system is started to a stage of allowing execution of the device request, receive a third device request initiated by the second server device by the second operating system using the control authority of the target bus, execute the third device request by the second operating system to acquire processing authority of the device request to obtain a third request result, and send the third request result to the second server device by the second operating system using the control authority of the target bus.
[0024] According to still another embodiment of the present application, a computer nonvolatile readable storage medium is also provided, the computer nonvolatile readable storage medium stores a computer program, and the computer program is configured to execute the steps in any of the method embodiments when running.
[0025] According to still another embodiment of the present application, an electronic device is also provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to execute the steps in any of the method embodiments by running the computer program.
[0026] According to still another embodiment of the present application, a computer program product is also provided, comprising a computer program, and the computer program is executed by a processor to implement the steps in any of the method embodiments.
[0027] Through the application, in the case that the first server device is started and the first operating system is started at a faster response speed, the first operating system can obtain the control right of the target bus and the processing right of the device request, so that the request of the second server device can be responded faster, and the long-time waiting of the request of the second device is avoided; in the case that the second operating system is started to the stage that the communication can be performed, the control right of the target bus is obtained by the second operating system, the process of the communication of the first server device and the second server device is executed by the second operating system, the first operating system continues to use the processing right of the device request, and the interactive process of the server device is gradually transferred to the second operating system; in the case that the second operating system is started to the stage that the device request is allowed to be executed, the control right of the target bus and the processing right of the device request are used by the second operating system, and finally the interactive process of the server device is completed by the second operating system. The above interactive process of the server device makes the starting process of the second operating system not become an obstacle to the interaction between the second server device and the first server device, and makes the second operating system take over the interactive process of the server device to improve the efficiency of the interactive process when the second operating system has more operation ability. Therefore, the problem of low interaction efficiency between server devices can be solved, and the effect of improving the interaction efficiency between server devices is achieved. BRIEF DESCRIPTION OF DRAWINGS
[0028] FIG. 1 is a hardware structure block diagram of a server device of a starting method of a server device according to an embodiment of the application;
[0029] FIG. 2 is a flow chart of a starting method of a server device according to an embodiment of the application;
[0030] FIG. 3 is a schematic diagram of communication between operating systems according to an embodiment of the application;
[0031] FIG. 4 is a schematic diagram of communication between operating systems according to an embodiment of the application;
[0032] FIG. 5 is a structure schematic diagram of data stored in a target memory area according to an embodiment of the application;
[0033] FIG. 6 is a structure schematic diagram of a server device starting process according to an embodiment of the application;
[0034] FIG. 7 is a flow chart of a baseboard management controller starting process according to an embodiment of the application;
[0035] FIG. 8 is a flow chart of a control right / processing right handover process according to an embodiment of the application;
[0036] FIG. 9 is a flow chart of a first operating system monitoring a running state of a second operating system according to an embodiment of the application;
[0037] FIG. 10 is a flow diagram of a second operating system monitoring a running state of a first operating system according to an embodiment of the present application;
[0038] FIG. 11 is a structural block diagram of a starting apparatus of a server device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] Hereinafter, the embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.
[0040] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence.
[0041] The method embodiments provided in the embodiments of the present application can be executed in a server device or similar computing apparatus. Taking an example of running on a server device, FIG. 1 is a hardware structural block diagram of a server device of a starting method of a server device according to an embodiment of the present application. As shown in FIG. 1, the server device can include one or more (only one is shown in FIG. 1) processors 102 (the processor 102 can include but is not limited to a processing apparatus such as a microprocessor MCU, a system on chip SOC or a programmable logic device FPGA) and a memory 104 configured to store data, wherein the above-mentioned server device can further include a transmission device 106 configured to implement a communication function and an input and output device 108. Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic, which does not limit the structure of the above-mentioned server device. For example, the server device can further include more or less components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.
[0042] The memory 104 can be configured to store computer programs, for example, software programs of application software and modules, such as a computer program corresponding to the starting method of the server device in the embodiments of the present application. The processor 102 executes various function applications and data processing by running the computer programs stored in the memory 104, that is, implements the above-mentioned method. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0043] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication service provider of the server device. In one example, the transmission device 106 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet through a wireless manner.
[0044] In the present embodiment, a starting method of a server device is provided. FIG. 2 is a flowchart of the starting method of the server device according to the present embodiment. As shown in FIG. 2, the flowchart includes the following steps:
[0045] In step S202, when the first server device is started and the first operating system is started, the first operating system obtains the control right of the target bus, receives a first device request initiated by the second server device, executes the first device request to obtain a first request result by using the processing right of the device request, and sends the first request result to the second server device by using the control right of the target bus.
[0046] In step S204, when the second operating system is started to a stage where the second server device is allowed to communicate, the second operating system obtains the control right of the target bus, receives a second device request initiated by the second server device, and transmits the second device request to the first operating system. The first operating system continues to execute the second device request to obtain a second request result by using the processing right of the device request, and transmits the second request result to the second operating system. The second operating system sends the second request result to the second server device by using the control right of the target bus.
[0047] In step S206, when the second operating system is started to a stage where the device request is allowed to be executed, the second operating system receives a third device request initiated by the second server device by using the control right of the target bus. The second operating system obtains the processing right of the device request, executes the third device request to obtain a third request result, and sends the third request result to the second server device by using the control right of the target bus.
[0048] Through the above steps, in the case that the first server device is started and the first operating system is started at a faster response speed, the first operating system can obtain the control right of the target bus and the processing right of the device request, so that the request of the second server device can be responded faster, and long-time waiting of the request of the second device is avoided; in the case that the second operating system is started to a stage at which communication can be performed, the control right of the target bus is obtained by the second operating system, the process of communication of the first server device and the second server device is executed by the second operating system, and the first operating system continues to use the processing right of the device request, so that the interactive process of the server device is gradually transferred to the second operating system; in the case that the second operating system is started to a stage at which the device request can be executed, the control right of the target bus and the processing right of the device request are used by the second operating system, and finally the interactive process of the server device is completed by the second operating system, so that the above interactive process of the server device not only makes the starting process of the second operating system not become an obstacle to the interaction between the second server device and the first server device, but also makes the second operating system take over the interactive process of the server device when the second operating system has more operation capabilities, so that the efficiency of the interactive process is improved. Therefore, the problem of low interaction efficiency between server devices can be solved, and the effect of improving the interaction efficiency between server devices is achieved.
[0049] Optionally, in the embodiment of the present application, the first server device can be but is not limited to a BMC (Baseboard Management Controller). The BMC is an embedded processor arranged to monitor, report and control the status of the server hardware. The BMC is a separate system under the server system, and has its own processor and memory. Even if the host hardware or operating system is down or off, the host system can still be managed by the BMC system. The BMC can monitor various parameters of the host, such as temperature, voltage, fan speed, power state, etc., and can realize functions such as remote power on / off, remote host system reinstallation, and remote display of host screen.
[0050] The second server device can be, but is not limited to, a server host, which is responsible for initializing hardware devices, testing hardware, loading operating system boot loaders, or starting operating systems from storage devices (such as hard disks, USB (Universal Serial Bus) drives, optical discs, etc.) at boot time in the BIOS (Basic Input Output System) responsible for the process. BIOS is the basic input and output system of the computer, which is a firmware program pre-installed on the motherboard of the computer. BIOS runs on the host CPU (Central Processing Unit), and ends its life cycle after the host operating system is started.
[0051] The target bus can be, but is not limited to, a bus that allows the transmission of data conforming to the Intelligent Platform Management Interface protocol, such as a KCS (Keyboard Controller Style) bus or a BT (Block Transfer) bus. During the BIOS startup process, the BMC sends IPMI (Intelligent Platform Management Interface) protocol commands to the BMC through the KCS bus or the BT bus to obtain data. KCS bus is a communication interface for system management and monitoring, which uses a byte-based handshake protocol for data transmission. BT bus is an interface standard for data transmission, commonly used in high-performance systems. It provides an efficient and reliable way of data transmission, especially suitable for block transmission of large amounts of data. BIOS will read the hardware configuration or software configuration file to select which bus to use for transmission in the early stage of startup.
[0052] IPMI is an open standard protocol for server management. IPMI protocol allows system administrators to remotely monitor various parameters of servers, such as temperature, voltage, fan speed, power status, etc., and can run independently of server host firmware and host operating system. Through IPMI, administrators can remotely power on / off, restart servers, and even automatically send alert notifications when servers have problems. IPMI protocol has been widely used in data centers, cloud computing, etc. It can greatly improve the management efficiency and reliability of servers, and reduce maintenance costs.
[0053] Optionally, in the embodiments of the present application, the first server device can be but is not limited to a RAID (Redundant Array of Independent Disks) controller, the second server device can be but is not limited to a host device deploying a storage array, and the target bus can be but is not limited to a bus allowing transmission of data conforming to the PCIe (peripheral component interconnect express) protocol.
[0054] Optionally, in the embodiments of the present application, the first operating system can have a higher sensitivity to response time than the second operating system. The first operating system and the second operating system can be but are not limited to two heterogeneous operating systems deployed on a processor of an embedded system, i.e., embedded operating systems. The embedded operating systems can be classified into real-time operating systems (RTOS) and non-real-time operating systems according to their sensitivity to response time. The real-time operating systems can include but are not limited to Free RTOS (Free Real-Time Operating System) and RT Linux (Real Time Linux), and the non-real-time operating systems can include but are not limited to contiki (Contiki Operating System), HeliOS (Helix Operating System), and Linux (Linux Operating System), etc. In some embodiments, the first operating system can be but is not limited to a real-time operating system, and the second operating system can be but is not limited to a non-real-time operating system.
[0055] Optionally, in the embodiments of the present application, the first operating system can be but is not limited to used for implementing the main functions of the first server device, and the second operating system can be but is not limited to used for implementing the auxiliary functions of the first server device. The second operating system can be able to implement functions that the first operating system cannot implement while the response speed of the second operating system is less than that of the first operating system.
[0056] Optionally, in the embodiments of the present application, the first server device can be but is not limited to a BMC, the first operating system can be but is not limited to a real-time operating system (RTOS), and the second operating system can be but is not limited to Linux. The BMC can include but is not limited to at least two processor cores, one part (at least one) of which is a processor core with better computing capability, which can be referred to as a main core, and the other part (at least one) is a processor core with general computing capability but better real-time performance, which can be referred to as a sub-core. The hardware structure of the main core can provide stronger performance support for the operating system on the main core, and the sub-core provides weaker performance support for the operating system than the main core. Therefore, the second operating system (such as a Linux operating system) with a more complex structure and stronger performance but slower startup speed can be but is not limited to running on the main core, and the first operating system (such as a real-time operating system (RTOS)) with a simpler structure, more ordinary performance, and relatively faster startup speed can be but is not limited to running on the sub-core.
[0057] In the embodiments provided in step S202, the control of the target bus can be but is not limited to achieved by using a data reading module or program of the target bus, and / or a data writing module or program of the target bus, and the data reading module or program of the bus and / or the data writing module or program of the bus can be but is not limited to a bus driver corresponding to each bus. The operating system that has obtained the control authority of the target bus can be but is not limited to allowed to use the bus driver corresponding to the target bus, and the operating system that has not obtained the control authority of the target bus can be but is not limited to forbidden to use the bus driver corresponding to the target bus; the operating system that has obtained the processing authority of the device request can be but is not limited to allowed to execute the program corresponding to the device request, and the operating system that has not obtained the processing authority of the device request can be but is not limited to forbidden to execute the program corresponding to the device request.
[0058] In the embodiments provided in step S204, the second operating system can be but is not limited to communicate with the second server device through the target bus, and the starting of the second operating system to the stage of allowing the communication with the second server device includes but is not limited to that the components / programs in the second operating system for communicating with the second server device through the target bus have been successfully started, and the second operating system has the capability of receiving the second device request of the second server device from the target bus and sending the second processing result of the second device request to the second server device through the second target bus.
[0059] In the embodiment provided in step S206, the second operating system starting to the stage of allowing the execution of the device request includes, but is not limited to, the components / programs for communicating with the second server device using the target bus and the components / applications for executing the device request from the second server device have been started successfully, the second operating system has the capability of receiving the second device request of the second server device from the target bus and sending the second processing result of the second device request to the second server device through the second target bus, and has the capability of executing the third device request to obtain the third request result.
[0060] As an optional implementation, the memory of the first server device is divided into a target memory area, the first operating system is deployed with a first interrupt service function, an interrupt receiving thread and a service module, the second operating system is divided into a kernel layer and an application layer, the inter-core communication driver is loaded in the kernel layer, and the service process is deployed in the application layer, the target memory area is set to be accessible by both the interrupt receiving thread and the inter-core communication driver, and the method further includes: in the case that the service process generates first data to be sent to the service module, sending, by the service process, the first data to the inter-core communication driver through a system call; writing, by the inter-core communication driver, the first data into the target memory area and sending a first inter-core soft interrupt to the first operating system; triggering, by the first operating system, the first interrupt service function after receiving the first inter-core soft interrupt; awakening, by the first interrupt service function, the interrupt receiving thread; and reading, by the interrupt receiving thread, the first data from the target memory area and sending the first data to the service module.
[0061] Through the above steps, the data in the second operating system is delivered to the first operating system, so that the first server device can still efficiently process data in the case that the second operating system cannot process data, and the data processing efficiency of the first server device is improved.
[0062] Optionally, in the embodiment of the present application, FIG. 3 is a schematic diagram of communication between operating systems according to an embodiment of the present application, as shown in FIG. 3, the communication between Linux (i.e., the second operating system) and the real-time operating system RTOS (i.e., the first operating system) needs to use inter-core communication soft interrupts (i.e., inter-core soft interrupts) and shared memory (i.e., target memory area), and the shared memory is in the memory of the BMC (i.e., the first server device). The shared memory has multiple channels (i.e., channel 0-channel n), and each channel can only transmit one command (i.e., data) at the same time. The command follows a certain data structure to facilitate the analysis of both the first operating system and the second operating system. The inter-core communication module can be divided into two directions: Linux to real-time operating system and real-time operating system to Linux. The process of Linux to real-time operating system includes the following steps:
[0063] Step S301, Linux is divided into a kernel layer and an application layer, the inter-core communication driver is located in the kernel layer, and each service module (i.e., a service process) is located in the application layer. When each service module needs to send data to the real-time operating system, the data is sent to the inter-core communication driver in the kernel layer through a system call such as copy_from_user;
[0064] Step S302, after the inter-core communication driver obtains the data, the data is written into a free channel of the shared memory, and an inter-core soft interrupt is sent to the co-core (i.e., to the first operating system);
[0065] Step S303, after the co-core receives the inter-core soft interrupt, an interrupt service function (ISR) of the real-time operating system is triggered, and the IPI (Inter-Processor Interrupt, processor interrupt) receiving thread (i.e., an interrupt receiving thread) is awakened by the interrupt service function;
[0066] Step S304, the IPI receiving thread reads the data from the shared memory and parses the data, and then the data is handed over to each service module for execution according to the data content.
[0067] As an optional implementation, a target memory region is divided in the memory of the first server device, an interrupt sending thread and a service module are run in the first operating system, a kernel layer and an application layer are divided in the second operating system, an inter-core communication driver is loaded in the kernel layer, a second interrupt service function is deployed in the inter-core communication driver, a service process is deployed in the application layer, the target memory region is set to be accessible by both the interrupt sending thread and the inter-core communication driver, and the method further includes: in a case where a second data to be sent to the service process is generated in the service module, sending, by the service module, the second data to the interrupt sending thread; writing, by the interrupt sending thread, the second data into the target memory region, and sending a second inter-core soft interrupt to the inter-core communication driver; triggering, by the inter-core communication driver, the second interrupt service function; and reading, by the second interrupt service function, the second data from the target memory region, and sending, by the second interrupt service function, the second data to the service process through a system call.
[0068] Through the above steps, the data in the first operating system is delivered to the second operating system, so that the first server device can efficiently process data in a case where the first operating system cannot process data, and the data processing efficiency of the first server device is improved.
[0069] Optionally, in the embodiment of the present application, FIG. 4 is a schematic diagram II of intercommunication between operating systems according to the embodiment of the present application, as shown in FIG. 4, the communication between Linux (i.e., the second operating system) and the real-time operating system RTOS (i.e., the first operating system) needs to use the inter-core communication software interrupt (i.e., the inter-core software interrupt) and the shared memory (i.e., the target memory area), and the shared memory is in the memory of the BMC (i.e., the first server device). The shared memory has multiple channels (i.e., channel 0-channel n), and each channel can only transmit one command (i.e., data) at the same time. The command follows a certain data structure to facilitate the analysis of both the first operating system and the second operating system. The inter-core communication module can be divided into two directions: Linux to the real-time operating system and the real-time operating system to Linux. The process of the real-time operating system to Linux includes the following steps:
[0070] Step S401, in the real-time operating system, there is no need for data transfer between the application layer and the kernel layer. Each business module sends data to the IPI sending module (i.e., the interrupt sending thread);
[0071] Step S402, after the IPI sending module receives the data, the data is structured and placed in the idle channel of the shared memory, and an inter-core software interrupt is sent to the main core;
[0072] Step S403, after the main core receives the inter-core software interrupt, the interrupt service function is triggered, the data is taken out from the shared memory and analyzed, and after the data analysis is completed, the data is sent to the corresponding business module (i.e., the business process) through a system call;
[0073] Step S404, after the corresponding business module receives the data, the command is executed according to the data.
[0074] Optionally, in the embodiment of the present application, FIG. 5 is a structural diagram of data stored in the target memory area according to the embodiment of the present application, and the data stored in the shared memory (i.e., the target memory area) has the data structure shown in FIG. 5, wherein the channel state value is 0 (the channel is not occupied) or 1 (the channel is occupied), and the value can be used to determine whether the channel is occupied. The structure of the IPI command (i.e., the first data and the second data) data header is:
[0075] As an optional implementation, the first server device comprises a baseboard management controller of the target server, the second server device comprises a server host of the target server, and the target bus is a bus allowing transmission of data conforming to the intelligent platform management interface protocol; in a case where the first server device is started and the first operating system has been started, the first operating system acquires control authority of the target bus, receives a first device request initiated by the second server device, executes the first device request to obtain a first request result by the first operating system acquiring processing authority of the device request, and sends the first request result to the second server device by the first operating system using the control authority of the target bus, comprising: in a case where the target server is started, starting the first operating system and the second operating system on the baseboard management controller; in a case where a first bus driver of the target bus has been loaded on the first operating system and a first application program of the intelligent platform management interface protocol has been run, acquiring, by the first operating system, control authority of the target bus, receiving, by the first bus driver, a first device request initiated by a basic input output system running on the server host; acquiring, by the first operating system, processing authority of the device request, executing the first device request by the first application program to obtain a first request result; sending, by the first operating system using the control authority of the target bus, the first request result to the basic input output system by the first bus driver.
[0076] Through the above steps, in a case where the target server is started, the first operating system and the second operating system are started on the baseboard management controller, the first operating system can acquire control authority of the target bus and processing authority of the device request, and can receive, by the first operating system, a first device request initiated by a basic input output system running on the server host and process the first device request to obtain a first request result of the first device request in a case where the second operating system has not been completely started successfully, and send the first request result back to the basic input output system, avoiding influence of the starting time of the second operating system on data interaction with the server host and improving the interaction efficiency between the server devices.
[0077] As an optional implementation, in the case that the second operating system starts to the stage of allowing communication with the second server device, the second operating system takes the control right of the target bus to receive the second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using the processing right of the device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control right of the target bus to send the second request result to the second server device, including: in the case that the second operating system starts to the second bus driver of the target bus having been loaded, it is determined that the second operating system has started to the stage of allowing communication with the second server device; the second operating system takes the control right of the target bus, receives the second device request initiated by the basic input output system through the second bus driver and transmits the second device request to the first operating system; the first operating system continues to execute the second device request using the processing right of the device request, obtains a second request result through the first application program, and transmits the second request result to the second operating system; and the second operating system uses the control right of the target bus to send the second request result to the basic input output system through the second bus driver.
[0078] Through the above steps, in the case that the second operating system starts to the second bus driver of the target bus having been loaded, that is, the second operating system has the ability to obtain the device request from the target bus, the second operating system takes the control right of the target bus, and the process of obtaining the device request and the process of sending the corresponding result of the device request are transferred to be completed by the second operating system, and all processes of the device request are gradually transferred to be implemented by the second operating system, so as to avoid the influence on the data interaction between the server devices due to the insufficient processing capacity of the first operating system, and improve the data interaction efficiency between the server devices.
[0079] Optionally, in the embodiment of the present application, the second operating system takes the control right of the target bus, after receiving the second device request initiated by the basic input / output system through the second bus driver, the service process deployed in the application layer in the second operating system sends the second device request to the inter-core communication driver loaded in the kernel layer of the second operating system through a system call, the inter-core communication driver writes the second device request into the target memory area in the baseboard management controller memory which is set to be accessed by both the interrupt receiving thread deployed in the first operating system and the inter-core communication driver, and sends a third inter-core soft interrupt to the first operating system, after receiving the third inter-core soft interrupt, the first operating system triggers the first interrupt service function deployed in the first operating system, the first interrupt service function wakes up the interrupt receiving thread, the interrupt receiving thread reads the second device request from the target memory area, and sends the second device request to the service module deployed in the first operating system, so as to realize the transmission of the second device request to the first operating system.
[0080] Optionally, in the embodiment of the present application, after obtaining the second request result by executing the second device request through the first application program, the service module running in the first operating system sends the second request result to the interrupt sending thread running in the first operating system, the interrupt sending thread writes the second request result into the target memory area in the baseboard management controller memory which is set to be accessed by both the interrupt receiving thread and the inter-core communication driver loaded in the kernel layer of the second operating system, and sends a fourth inter-core soft interrupt to the inter-core communication driver loaded in the kernel layer of the second operating system, the inter-core communication driver triggers the second interrupt service function deployed in the inter-core communication driver, the second interrupt service function reads the second request result from the target memory area, and sends the second request result to the service process deployed in the application layer of the second operating system through a system call, so as to realize the transmission of the second request result to the second operating system.
[0081] As an optional implementation, in the case that the second operating system is started to a stage allowing execution of the device request, the third device request initiated by the second server device is received by the second operating system using the control right of the target bus, the processing right of the device request is obtained by the second operating system to execute the third device request to obtain a third request result, and the third request result is sent to the second server device by the second operating system using the control right of the target bus, comprising: in the case that the second operating system is started to a second application program that has run an intelligent platform management interface protocol, it is determined that the second operating system has been started to a stage allowing execution of the device request; the third device request initiated by the basic input output system is received by the second operating system using the control right of the target bus through the second bus driver; the processing right of the device request is obtained by the second operating system to execute the third device request through the second application program to obtain a third request result; and the third request result is sent to the basic input output system by the second operating system using the control right of the target bus through the second bus driver.
[0082] Through the above steps, in the case that the second operating system has the ability to execute the device request, the acquisition, processing and sending process of the device request corresponding to the request result are transferred to the second operating system to complete, thereby improving the processing efficiency of the device request and the efficiency of data interaction between server devices.
[0083] Optionally, in the embodiment of the present application, the BIOS (Basic Input Output System) in the server host and the BMC (Baseboard Management Controller) are started at the same time when the target server is powered on, and in the case that only one Linux operating system is run on the BMC, the KCS and BT drivers are loaded in the Linux kernel start process, and the IPMI (Intelligent Platform Management Interface) application is run after the Linux kernel is started. The firmware of the BMC starts slowly, and in the BIOS start process of the server host, the IPMI command needs to be transmitted to the BMC to obtain the required data before the start can continue. The nearly ten seconds of BIOS waiting for the BMC to respond to the IPMI command greatly increases the start time of the host operating system. If a real-time operating system is directly run in the cooperative core of the BMC, the KCS / BT driver and the IPMI application are always placed in the real-time operating system, which can improve the start speed of the firmware on the BMC, but when the Linux needs to interact with the BIOS of the server host, the command needs to be sent to the cooperative core first, and then sent to the BIOS by the cooperative core, and the interaction efficiency is affected. According to the scheme provided in the present application, in the early stage of the start of the server, the real-time operating system will take over the control of the KCS / BT bus and respond to the IPMI command, and when the Linux operating system is started to the appropriate stage, the control of the communication bus and the response right of the IPMI are gradually transferred to the Linux system. Both the slow interaction speed between the BMC and the server host in the early stage of the start of the server and the interaction efficiency between the BMC and the server host after the BMC is completely started are ensured, and the effect of improving the interaction efficiency between the server devices is achieved.
[0084] Optionally, FIG. 6 is a structural schematic diagram of a server device start process according to an embodiment of the present application. As shown in FIG. 6, the BIOS sends the IPMI command (i.e., device request) to the BMC through the KCS / BT bus (i.e., target bus), and the KCS / BT driver (i.e., second bus driver and first bus driver) in the Linux and the real-time operating system accesses the KCS / BT controller to obtain the data sent by the BIOS. After the IPMI module obtains the data from the KCS / BT driver, the IPMI module analyzes and executes the IPMI command sent by the BIOS, and sends the command execution result back to the BIOS through the KCS / BT driver. The inter-processor communication (IPI) module and the BMC memory (DDR (Double Data Rate Synchronous Dynamic Random Access Memory)) provide a channel for the interaction between the Linux and the real-time operating system. The permission transfer between the Linux and the real-time operating system in the BMC start process can be realized by the inter-processor communication (IPI) module.
[0085] Optionally, in the embodiments of the present application, the first server device comprises a redundant array of independent disks controller of the target storage system, the second server device comprises a storage system host of the target storage system, and the target bus is a bus allowing transmission of data conforming to the standard protocol of the high-speed serial computer expansion bus; in the case that the first server device is started and the first operating system has been started, the first operating system takes control authority of the target bus, receives a first device request initiated by the second server device, executes the first device request to obtain a first request result by taking processing authority of the device request, and sends the first request result to the second server device by using the control authority of the target bus, comprising: in the case that the target storage system is started, starting the first operating system and the second operating system on the redundant array of independent disks controller; in the case that a third bus driver of the target bus has been loaded on the first operating system and a third application program conforming to the standard protocol of the high-speed serial computer expansion bus has been run, the first operating system takes control authority of the target bus, receives a first device request initiated by a basic input / output system run on the storage system host through the third bus driver; the first operating system takes processing authority of the device request, executes the first device request through the third application program to obtain a first request result; the first operating system sends the first request result to the basic input / output system through the third bus driver by using the control authority of the target bus.
[0086] In some embodiments, in the case that the second operating system starts to the stage allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request to obtain a second request result by taking processing authority of the device request and transmits the second request result to the second operating system, and the second operating system sends the second request result to the second server device by using the control authority of the target bus, comprising: in the case that the second operating system starts to have loaded a fourth bus driver of the target bus, determining that the second operating system has started to the stage allowing communication with the second server device; the second operating system takes control authority of the target bus, receives a second device request initiated by the basic input / output system through the fourth bus driver and transmits the second device request to the first operating system; the first operating system continues to execute the second device request through the third application program to obtain a second request result and transmits the second request result to the second operating system by taking processing authority of the device request; the second operating system sends the second request result to the basic input / output system through the fourth bus driver by using the control authority of the target bus.
[0087] In some embodiments, in the case that the second operating system starts to the stage of allowing execution of the device request, the third device request initiated by the second server device is received by the second operating system using the control right of the target bus, the third device request is executed by the second operating system to obtain a third request result, and the third request result is sent to the second server device by the second operating system using the control right of the target bus, including: in the case that the second operating system starts to the fourth application program of the high-speed serial computer expansion bus standard protocol, it is determined that the second operating system has started to the stage of allowing execution of the device request; the third device request initiated by the basic input output system is received by the second operating system using the control right of the target bus through the fourth bus driver; the third device request is executed by the second operating system to obtain a third request result; and the third request result is sent to the basic input output system by the second operating system using the control right of the target bus through the fourth bus driver.
[0088] As an optional implementation, the second device request initiated by the second server device is received by the second operating system using the control right of the target bus and transmitted to the first operating system, the second device request is continued to be executed by the first operating system using the processing right of the device request to obtain a second request result and transmitted to the second operating system, and the second request result is sent to the second server device by the second operating system using the control right of the target bus, including: the control right of the target bus is obtained by the second operating system from the first operating system; the second server device initiates the second device request on the target bus by the second operating system using the control right of the target bus; the second device request is sent to the first operating system by the second operating system; the second device request is continued to be executed by the first operating system using the processing right of the device request to obtain a second request result of the second device request; the second request result is sent to the second operating system by the first operating system; and the second request result is sent to the second server device by the second operating system using the control right of the target bus.
[0089] As an optional implementation, sending the second device request from the second operating system to the first operating system comprises: writing, by the second operating system, the second device request into a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system; triggering, by the second operating system, a first interrupt to the first operating system; reading, by the first operating system, the second device request from the target storage space in response to the first interrupt; sending, by the first operating system, a second request result to the second operating system, comprising: writing, by the first operating system, the second request result into the target storage space; triggering, by the first operating system, a second interrupt to the second operating system; reading, by the second operating system, the second request result from the target storage space in response to the second interrupt.
[0090] Through the above steps, the second device request is processed by the first operating system and the second operating system cooperatively, the whole processing process of the device request is gradually implemented by the second operating system, and a new solution is provided for the case that the first operating system and the second operating system cannot independently process the device request, and the interaction efficiency of the server device is improved.
[0091] Optionally, in the embodiment of the present application, FIG. 7 is a flow chart of a BMC startup process according to the embodiment of the present application, as shown in FIG. 7, the BMC startup process can be divided into three stages: an RTOS response stage, a Linux proxy KCS / BT stage, and a Linux response stage. When the KCS / BT driver of the Linux system and the IPMI process are not loaded, the process is in the RTOS response stage, in which the KCS / BT driver control and the IPMI command response right are both in the RTOS; when the Linux KCS / BT driver is loaded but the IPMI process is not loaded, the process is in the Linux proxy KCS / BT stage, in which the KCS / BT control is in the Linux and the IPMI command response right is in the RTOS; when the Linux KCS / BT driver and the IPMI process are both loaded, the KCS / BT control and the IPMI command response right are both in the Linux. Among them,
[0092] RTOS response stage (i.e. the first bus driver of the target bus has been loaded on the first operating system and the first application program of the intelligent platform management interface protocol has been run): Since the RTOS starts much faster than Linux, the RTOS first obtains the control right of the KCS / BT and the processing right of the IPMI command. When the KCS / BT driver in Linux starts running, it requests the control right of the KCS / BT from the RTOS. After the RTOS receives the request, it releases the control right of the KCS / BT and returns a handover message to Linux, so that Linux can obtain the control right of the KCS / BT. If the Linux requests the control right of the KCS / BT from the RTOS for a period of time and the RTOS still does not return, it is considered that the RTOS is abnormal, and Linux forcibly obtains the control right of the KCS / BT. After Linux obtains the control right of the KCS / BT, it enters the Linux proxy KCS / BT stage.
[0093] Linux proxy KCS / BT stage (i.e. the second operating system starts to load the second bus driver of the target bus): In this stage, the processing right of the IPMI command is in the RTOS, and the control right of the KCS / BT is in Linux. When Linux receives the KCS / BT data packet, it parses and structures the KCS / BT data packet, and then sends it to the real-time operating system through the IPI module. After the real-time operating system receives the data, it parses and executes the command. After execution is completed, the IPMI reply packet is organized, and then sent to Linux through the IPI module. Linux sends the IPMI reply packet to the BIOS through the KCS / BT bus. After the Linux IPMI process is started, Linux sends a request for the IPMI command response right to the RTOS, the RTOS releases the IPMI command response right, and enters the Linux control stage.
[0094] Linux response stage (i.e. the second operating system starts to run the second application program of the intelligent platform management interface protocol): Linux responds to the IPMI command, and the RTOS enters the abnormal monitoring mode. The RTOS regularly sends a state query command to Linux to inquire about the state of Linux and the state of the IPMI process. If Linux does not respond or the Linux IPMI process is abnormal, the RTOS enters the abnormal processing state.
[0095] As an optional implementation, the receiving and transmitting of the second device request initiated by the second server device by the second operating system taking the control right of the target bus comprises: requesting the control right of the target bus by the second operating system to the first operating system; in the case that the control right of the target bus has been requested by the second operating system, accessing the target bus by the second operating system to obtain the second device request initiated by the second server device through the target bus; and transmitting the second device request to the first operating system through the target storage space on the first server device by the second operating system, wherein the target storage space allows the first operating system to access and also allows the second operating system to access.
[0096] As an optional implementation, the requesting of the control right of the target bus by the second operating system to the first operating system comprises: sending a first control request by the second operating system to the first operating system, wherein the first control request is used to request the control right of the target bus; releasing the control right of the target bus by the first operating system in response to the first control request, and sending first response information to the second operating system, wherein the first response information is used to indicate that the second operating system is allowed to take the control right of the target bus; determining that the control right of the target bus has been requested by the second operating system in response to the first response information, or determining that the control right of the target bus has been requested by the second operating system in the case that the first response information is not received by the second operating system within a first time period after the first control request is sent.
[0097] Optionally, in the embodiment of the present application, the sending of the first control request by the second operating system to the first operating system comprises but is not limited to that a service process deployed by an application layer of the second operating system sends the first control request to an inter-core communication driver loaded in a kernel layer of the second operating system through a system call; the first control request is written into a target memory area in the memory of the first server device by the inter-core communication driver, the target memory area is divided and set to allow access by an interrupt receiving thread deployed in the first operating system and also allow access by the inter-core communication driver, and a fifth inter-core soft interrupt is sent to the first operating system; the first interrupt service function deployed in the first operating system is triggered after the fifth inter-core soft interrupt is received by the first operating system; the interrupt receiving thread is woken up by the first interrupt service function; the first control request is read from the target memory area by the interrupt receiving thread, and the first control request is sent to a service module deployed in the first operating system.
[0098] Optionally, in the embodiments of the present application, sending the first response information to the second operating system includes, but is not limited to, sending, by the service module in the first operating system, the first response information to an interrupt sending thread in the first operating system; writing, by the interrupt sending thread, the first response information into a target memory region in the memory of the first server device, the target memory region being divided and set to be accessible by both the interrupt receiving thread and the inter-core communication driver loaded in the kernel layer of the second operating system, and sending a sixth inter-core soft interrupt to the inter-core communication driver; triggering, by the inter-core communication driver, a second interrupt service function deployed in the inter-core communication driver; reading, by the second interrupt service function, the first response information from the target memory region, and sending, by the second interrupt service function, the first response information to a service process deployed in the application layer of the second operating system through a system call.
[0099] As an optional implementation, sending, by the second operating system, the first control request to the first operating system includes: writing, by the second operating system, the first control request into a target storage space on the first server device, wherein the target storage space is accessible by both the first operating system and the second operating system; triggering, by the second operating system, a third interrupt to the first operating system; releasing, by the first operating system, the control authority of the target bus in response to the first control request, and sending first response information to the second operating system, including: reading, by the first operating system, the first control request from the target storage space in response to the third interrupt; releasing, by the first operating system, the control authority of the target bus in response to the first control request, and writing first response information into the target storage space; triggering, by the first operating system, a fourth interrupt to the second operating system; determining, by the second operating system, that the control authority of the target bus has been requested in response to the first response information, including: reading, by the second operating system, the first response information from the target storage space in response to the fourth interrupt; determining, by the second operating system, that the control authority of the target bus has been requested according to the first response information.
[0100] Through the above steps, the control authority of the target bus is transferred from the first operating system to the second operating system, ensuring that the device request from the second server device can be processed by the second operating system after the first server device is normally started, avoiding the influence of insufficient operation capability of the first operating system on the processing efficiency of the device request, and improving the interaction efficiency between server devices.
[0101] Optionally, in the embodiments of the present application, FIG. 8 is a flow chart of a control right / process right handover process according to the embodiments of the present application, and the process flow of Linux requesting KCS / BT control right (i.e. control right of the target bus) or IPMI command response right (i.e. process right of the device request) from the real-time operating system is shown in FIG. 8. After Linux loads the KCS / BT driver (i.e. the second bus driver), it requests the control right of KCS / BT from the real-time operating system. After Linux starts the IPMI process (i.e. the second application of the intelligent platform management interface protocol), it also requests the IPMI command response right from the real-time operating system. When the request for the control right fails, it waits for a period of time, requests the control right again, and forcibly obtains the control right if the number of repeated requests is not less than the set number of times.
[0102] As an optional implementation, the second operating system obtains the process right of the device request to execute the third device request and obtain a third request result, including: the second operating system requests the process right of the device request from the first operating system.
[0103] In the case where the second operating system has requested the process right of the device request, the application program of the device request is executed by the second operating system to execute the third device request and obtain a third request result.
[0104] As an optional implementation, the second operating system requests the process right of the device request from the first operating system, including: the second operating system sends a second control request to the first operating system, wherein the second control request is used to request the process right of the device request; the first operating system releases the process right of the device request in response to the second control request and sends second response information to the second operating system, wherein the second response information is used to indicate that the second operating system is allowed to obtain the process right of the device request; the second operating system determines that the process right of the device request has been requested in response to the second response information, or the second operating system determines that the process right of the device request has been requested when it is detected that the second response information has not been received within a second time period after the second control request is sent.
[0105] Optionally, in the embodiments of the present application, the second control request sent by the second operating system to the first operating system includes but is not limited to: a service process deployed by an application layer of the second operating system sending the second control request to an inter-core communication driver loaded in a kernel layer of the second operating system through a system call; the inter-core communication driver writing the second control request into a target memory area in the memory of the first server device, which is set to be accessible by an interrupt receiving thread deployed in the first operating system and accessible by the inter-core communication driver, and sending a seventh inter-core soft interrupt to the first operating system; the first operating system triggering a first interrupt service function deployed in the first operating system after receiving the seventh inter-core soft interrupt; the first interrupt service function waking up the interrupt receiving thread; the interrupt receiving thread reading the second control request from the target memory area and sending the second control request to a service module deployed in the first operating system.
[0106] Optionally, in the embodiments of the present application, sending the second response information to the second operating system includes but is not limited to: the service module in the first operating system sending the second response information to an interrupt sending thread in the first operating system; the interrupt sending thread writing the second response information into a target memory area in the memory of the first server device, which is set to be accessible by the interrupt receiving thread and accessible by an inter-core communication driver loaded in the kernel layer of the second operating system, and sending an eighth inter-core soft interrupt to the inter-core communication driver; the inter-core communication driver triggering a second interrupt service function deployed in the inter-core communication driver; the second interrupt service function reading the second response information from the target memory area and sending the second response information to a service process deployed in the application layer of the second operating system through a system call.
[0107] As an optional implementation, the second control request sent by the second operating system to the first operating system includes: the second operating system writing the second control request into a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and accessible by the second operating system; the second operating system triggering a fifth interrupt to the first operating system; the first operating system releasing a processing right requested by the device in response to the second control request and sending second response information to the second operating system, including: the first operating system reading the second control request from the target storage space in response to the fifth interrupt; the first operating system releasing the processing right requested by the device in response to the second control request and writing the second response information into the target storage space; the first operating system triggering a sixth interrupt to the second operating system; the second operating system determining that the processing right requested by the device has been requested in response to the second response information, including: the second operating system reading the second response information from the target storage space in response to the sixth interrupt; the second operating system determining that the processing right requested by the device has been requested according to the second response information.
[0108] By the above steps, the processing authority of the device request is transferred from the first operating system to the second operating system, so that the device request from the second server device can be processed by the second operating system after the first server device is normally started, the processing efficiency of the device request is improved, and the interaction efficiency between the server devices is improved.
[0109] As an optional implementation, after the third device request initiated by the second server device is received by the second operating system using the control authority of the target bus, the method further includes: monitoring, by the first operating system, a running state of the processing authority of the device request on the second operating system; in a case where the running state is monitored to indicate that the processing authority of the device request on the second operating system is running abnormally, acquiring the control authority of the target bus and the processing authority of the device request from the second operating system; and controlling, by the first operating system, the second operating system to restart.
[0110] By the above steps, after the second operating system is started to the stage of allowing the device request to be executed and the third device request initiated by the second server device is received by the second operating system using the control authority of the target bus, the running state of the processing authority of the device request on the second operating system is monitored by the first operating system, and in a case where the running state is abnormal, the control authority of the bus and the processing authority of the request are temporarily taken over by the first operating system and the second operating system is controlled to restart, so that the first server device cannot process the device request from the second server device in time due to problems in the subsequent running process of the second operating system, and the interaction efficiency between the server devices is improved.
[0111] As an optional implementation, monitoring, by the first operating system, the running state of the processing authority of the device request on the second operating system includes: sending, by the first operating system, a heartbeat command to the second operating system, where the heartbeat command is used to instruct the second operating system to send a system state of the second operating system and a function state of the processing authority of the device request to the first operating system, and the running state of the processing authority of the device request on the second operating system includes the system state and the function state; and the method further includes: listening, by the second operating system, to the heartbeat command; and in a case where a time length during which the heartbeat command is not listened to is greater than or equal to a target time length, determining that the first operating system is running abnormally, and restarting, by the second operating system, the first operating system.
[0112] By the above steps, while the first operating system monitors the running of the second operating system, the second operating system also monitors the running of the first operating system, so that the monitoring of the second operating system is not invalid due to the abnormal running of the first operating system, and the first server device is completely unable to process the device request from the second server device.
[0113] Optionally, in the embodiment of the present application, FIG. 9 is a flow diagram of a first operating system monitoring a running state of a second operating system according to the embodiment of the present application. As shown in FIG. 9, after the Linux (i.e., the second operating system) and the real-time operating system (i.e., the first operating system) complete the handover of the IPMI command response right (i.e., the processing right of the device request), the real-time operating system sends a state query command (i.e., a heartbeat command) to the Linux at a time interval, and the Linux returns the state of the Linux (i.e., the system state) and the state of the IPMI process (i.e., the function state of the processing right) to the real-time operating system. When the Linux does not return or the state of the IPMI process is abnormal, an exception handling in the real-time operating system is triggered. The above monitoring process includes the following steps:
[0114] Step S901, the real-time operating system periodically sends a state query command to the Linux, and the Linux returns the system state of the Linux and the state of the IPMI process to the real-time operating system after receiving the command;
[0115] Step S902, if the real-time operating system receives the reply of the Linux and the state of the IPMI process is normal, the real-time operating system sleeps for a period of time and then sends the state query command again;
[0116] Step S903, if the real-time operating system does not receive the reply of the Linux or the state of the IPMI process is abnormal (when the state of the IPMI process is abnormal, the Linux system attempts to restart the IPMI process), and the number of retries is less than a set value, the real-time operating system sleeps for a period of time and then sends the state query command again;
[0117] Step S904, if the number of retries is greater than the set value, the Linux still does not reply or the state of the IPMI process is still abnormal, it is considered that the Linux system is abnormal and cannot be recovered;
[0118] Step S905, in the case that the Linux system is abnormal and cannot be recovered, the real-time operating system requests the IPMI command response right from the Linux. If the request fails, the real-time operating system retries. When the number of retries reaches a specific number and the request is still unsuccessful, the real-time operating system forcibly acquires the IPMI command response right and the control right of the KCS / BT and restarts the Linux system.
[0119] Optionally, in the embodiment of the present application, while the first operating system monitors the running of the second operating system, the second operating system also monitors the running state of the first operating system. FIG. 10 is a flow diagram of a second operating system monitoring a running state of a first operating system according to the embodiment of the present application. As shown in FIG. 10, in the Linux (i.e., the second operating system), the following steps are performed:
[0120] Step S1001, the Linux listens to the heartbeat command sent by the real-time operating system (i.e. the first operating system);
[0121] Step S1002, if the command is received, the device sleeps for a specified time and then listens again;
[0122] Step S1003, if the heartbeat command is not received, it is determined whether the time has been exceeded, if not, the device waits for a specified time and then listens for the heartbeat command again;
[0123] Step S1004, if the time has been exceeded, it is considered that the real-time operating system has a problem, and the real-time operating system is restarted.
[0124] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on this understanding, the technical solutions of the present application or the part that contributes to the related art can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the method of each embodiment of the present application.
[0125] In the present embodiment, a starting device of a server device is also provided, the first server device is deployed with a first operating system and a second operating system, the response speed of the first operating system is greater than that of the second operating system, the first server device is connected with the second server device through a target bus, the device is applied to the first server device, and the device is used to implement the above embodiments and optional implementation manners, which have been described and will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.
[0126] FIG. 11 is a structural block diagram of a starting device of a server device according to an embodiment of the present application, as shown in FIG. 11, the device includes:
[0127] The first running module 1102 is configured to, when the first server device is started and the first operating system is started, acquire, by the first operating system, a control right of a target bus, receive a first device request initiated by the second server device, execute the first device request to obtain a first request result by the first operating system using a processing right of the device request, and send the first request result to the second server device by the first operating system using the control right of the target bus.
[0128] The second running module 1104 is configured to, when the second operating system is started to a stage of allowing communication with the second server device, acquire, by the second operating system, a control right of a target bus, receive a second device request initiated by the second server device, and transmit the second device request to the first operating system, continue, by the first operating system, to execute the second device request to obtain a second request result by using a processing right of the device request, and transmit the second request result to the second operating system, and send the second request result to the second server device by the second operating system using the control right of the target bus.
[0129] The third running module 1106 is configured to, when the second operating system is started to a stage of allowing execution of a device request, receive, by the second operating system using a control right of a target bus, a third device request initiated by the second server device, execute the third device request to obtain a third request result by the second operating system using a processing right of the device request, and send the third request result to the second server device by the second operating system using the control right of the target bus.
[0130] Through the above steps, in the case that the first server device is started and the first operating system is started at a faster response speed, the first operating system can obtain the control right of the target bus and the processing right of the device request, so as to respond to the request of the second server device faster and avoid long-time waiting of the request of the second device; in the case that the second operating system is started to the stage that communication can be performed, the control right of the target bus is obtained by the second operating system, the process of communication of the first server device and the second server device is executed by the second operating system, and the first operating system continues to use the processing right of the device request, so as to gradually transfer the interactive process of the server device to the second operating system; in the case that the second operating system is started to the stage that the device request is allowed to be executed, the control right of the target bus and the processing right of the device request are used by the second operating system, and finally the interactive process of the server device is completed by the second operating system, so that the above interactive process of the server device not only makes the starting process of the second operating system not become an obstacle to the interaction between the second server device and the first server device, but also makes the second operating system take over the interactive process of the server device when the second operating system has more operation ability, so as to improve the efficiency of the interactive process. Therefore, the problem of low interaction efficiency between server devices can be solved, and the effect of improving the interaction efficiency between server devices is achieved.
[0131] As an optional implementation, the first server device includes a baseboard management controller of a target server, the second server device includes a server host of the target server, and the target bus is a bus allowing transmission of data conforming to an intelligent platform management interface protocol; the first running module includes: a starting unit configured to start the first operating system and the second operating system on the baseboard management controller in the case that the target server is started; a first receiving unit configured to obtain, by the first operating system, the control right of the target bus in the case that the first operating system has loaded a first bus driver of the target bus and has run a first application program of the intelligent platform management interface protocol, and receive, by the first bus driver, a first device request initiated by a basic input output system running on the server host; a first executing unit configured to obtain, by the first operating system, the processing right of the device request, and execute the first device request by the first application program to obtain a first request result; and a first sending unit configured to send, by the first operating system, the first request result to the basic input output system by the first bus driver using the control right of the target bus.
[0132] As an optional implementation, the second running module comprises: a first determining unit configured to determine that the second operating system has started to a stage of allowing communication with the second server device in a case that the second operating system has started to the second bus driver of the target bus; a second receiving unit configured to obtain, by the second operating system, the control right of the target bus, receive a second device request initiated by the basic input output system through the second bus driver, and transmit the second device request to the first operating system; a second executing unit configured to continue, by the first operating system, using the processing right of the device request, execute the second device request through the first application program to obtain a second request result, and transmit the second request result to the second operating system; and a second sending unit configured to use, by the second operating system, the control right of the target bus, send the second request result to the basic input output system through the second bus driver.
[0133] As an optional implementation, the third running module comprises: a second determining unit configured to determine that the second operating system has started to a stage of allowing execution of a device request in a case that the second operating system has started to the second application program of the intelligent platform management interface protocol; a third receiving unit configured to use, by the second operating system, the control right of the target bus, receive a third device request initiated by the basic input output system through the second bus driver; a third executing unit configured to obtain, by the second operating system, the processing right of the device request, execute the third device request through the second application program to obtain a third request result; and a third sending unit configured to use, by the second operating system, the control right of the target bus, send the third request result to the basic input output system through the second bus driver.
[0134] As an optional implementation, the second running module further comprises: an obtaining unit configured to obtain, by the second operating system, the control right of the target bus from the first operating system; a first accessing unit configured to access, by the second operating system, the target bus using the control right of the target bus to obtain a second device request initiated by the second server device on the target bus;
[0135] a fourth sending unit configured to send, by the second operating system, the second device request to the first operating system; a fourth executing unit configured to continue, by the first operating system, using the processing right of the device request to execute the second device request to obtain a second request result of the second device request; a fifth sending unit configured to send, by the first operating system, the second request result to the second operating system; and a second accessing unit configured to access, by the second operating system, the target bus using the control right of the target bus to send the second request result to the second server device.
[0136] As an optional implementation, the fourth sending unit is further configured to: write, by the second operating system, the second device request into a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system; trigger, by the second operating system, a first interrupt to the first operating system; and read, by the first operating system, the second device request from the target storage space in response to the first interrupt.
[0137] As an optional implementation, the fifth sending unit is further configured to: write, by the first operating system, the second request result into the target storage space; trigger, by the first operating system, a second interrupt to the second operating system; and read, by the second operating system, the second request result from the target storage space in response to the second interrupt.
[0138] As an optional implementation, the second running module further comprises: a first requesting unit configured to request, by the second operating system, a control right of the target bus from the first operating system; a third accessing unit configured to, in a case where the second operating system has requested the control right of the target bus, access, by the second operating system, the target bus to obtain a second device request initiated by the second server device through the target bus; and a transmission unit configured to transmit, by the second operating system, the second device request to the first operating system through a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system.
[0139] As an optional implementation, the first requesting unit is further configured to: send, by the second operating system, a first control request to the first operating system, wherein the first control request is used to request the control right of the target bus; release, by the first operating system, the control right of the target bus in response to the first control request, and send first response information to the second operating system, wherein the first response information is used to indicate that the second operating system is allowed to obtain the control right of the target bus; and determine, by the second operating system, that the control right of the target bus has been requested in response to the first response information, or determine, by the second operating system, that the control right of the target bus has been requested in a case where the second operating system detects that the first response information is not received within a first time period after the first control request is sent.
[0140] As an optional implementation, the first request unit is further configured to: write, by the second operating system, the first control request to a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and the second operating system; trigger, by the second operating system, a third interrupt to the first operating system; read, by the first operating system, the first control request from the target storage space in response to the third interrupt; release, by the first operating system, the control right of the target bus in response to the first control request, and write first response information to the target storage space; trigger, by the first operating system, a fourth interrupt to the second operating system; read, by the second operating system, the first response information from the target storage space in response to the fourth interrupt; and determine, by the second operating system, that the control right of the target bus has been requested according to the first response information.
[0141] As an optional implementation, the third running module further comprises: a second request unit configured to request, by the second operating system, the processing right of the device request from the first operating system; and a running unit configured to run, by the second operating system, the device-requested application to execute the third device request and obtain a third request result in a case where the second operating system has requested the processing right of the device request.
[0142] As an optional implementation, the second request unit is further configured to: send, by the second operating system, a second control request to the first operating system, wherein the second control request is used to request the processing right of the device request; release, by the first operating system, the processing right of the device request in response to the second control request, and send second response information to the second operating system, wherein the second response information is used to indicate that the second operating system is allowed to obtain the processing right of the device request; and determine, by the second operating system, that the processing right of the device request has been requested in response to the second response information, or determine, by the second operating system, that the processing right of the device request has been requested in a case where the second operating system does not receive the second response information within a second time period after sending the second control request.
[0143] As an optional implementation, the second request unit is further configured to: write, by the second operating system, the second control request to a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and the second operating system; trigger, by the second operating system, a fifth interrupt to the first operating system; read, by the first operating system, the second control request from the target storage space in response to the fifth interrupt; release, by the first operating system, the processing right of the device request in response to the second control request, and write second response information to the target storage space; trigger, by the first operating system, a sixth interrupt to the second operating system; read, by the second operating system, the second response information from the target storage space in response to the sixth interrupt; and determine, by the second operating system, that the processing right of the device request has been requested according to the second response information.
[0144] As an optional implementation, the memory of the first server device is divided into a target memory area, the first operating system is deployed with a first interrupt service function, an interrupt receiving thread and a service module, the second operating system is divided into a kernel layer and an application layer, the kernel layer is loaded with an inter-core communication driver, the application layer is deployed with a service process, the target memory area is set to be accessible by both the interrupt receiving thread and the inter-core communication driver, and the apparatus further comprises: a calling module configured to send, by the service process, first data to the inter-core communication driver through a system call in a case where the service process generates the first data to be sent to the service module; a first writing module configured to write, by the inter-core communication driver, the first data into the target memory area and send a first inter-core soft interrupt to the first operating system; a receiving module configured to trigger the first interrupt service function after the first operating system receives the first inter-core soft interrupt; a waking module configured to wake up the interrupt receiving thread by the first interrupt service function; and a first reading module configured to read, by the interrupt receiving thread, the first data from the target memory area and send the first data to the service module.
[0145] As an optional implementation, the memory of the first server device is divided into a target memory area, the first operating system is deployed with an interrupt sending thread and a service module, the second operating system is divided into a kernel layer and an application layer, the kernel layer is loaded with an inter-core communication driver, the inter-core communication driver is deployed with a second interrupt service function, the application layer is deployed with a service process, the target memory area is set to be accessible by both the interrupt sending thread and the inter-core communication driver, and the apparatus further comprises: a sending module configured to send, by the service module, second data to the interrupt sending thread in a case where the service module generates the second data to be sent to the service process; a second writing module configured to write, by the interrupt sending thread, the second data into the target memory area and send a second inter-core soft interrupt to the inter-core communication driver; a triggering module configured to trigger, by the inter-core communication driver, the second interrupt service function; and a second reading module configured to read, by the second interrupt service function, the second data from the target memory area and send the second data to the service process through a system call.
[0146] As an optional implementation, the apparatus further comprises: a monitoring module configured to monitor, by the first operating system, a running state of the processing authority requested by the device on the second operating system; an obtaining module configured to obtain, from the second operating system, the control authority of the target bus and the processing authority requested by the device in a case where the running state is monitored to indicate that the processing authority requested by the device on the second operating system is running abnormally; and a control module configured to control, by the first operating system, the second operating system to restart.
[0147] As an optional implementation, the monitoring module comprises a sixth sending unit configured to send a heartbeat command from the first operating system to the second operating system, wherein the heartbeat command is used to instruct the second operating system to send a system state and a function state of a processing authority of the device request of the second operating system to the first operating system, and the running state of the processing authority of the device request on the second operating system comprises the system state and the function state.
[0148] As an optional implementation, the apparatus further comprises a listening module configured to listen to the heartbeat command by the second operating system; and a determining module configured to determine that the first operating system is abnormal in a case where a time length during which the heartbeat command is not listened to is greater than or equal to a target time length, and restart the first operating system by the second operating system.
[0149] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all of the above modules are located in the same processor; or the above modules are located in different processors in any combination.
[0150] Embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.
[0151] In an example embodiment, the above computer readable storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0152] Embodiments of the present application further provide an electronic device comprising a memory storing a computer program and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
[0153] In an example embodiment, the above electronic device can further comprise a transmission device connected to the processor and an input and output device connected to the processor.
[0154] Embodiments of the present application further provide a computer program product comprising a computer program, and the computer program is executed by a processor to implement the steps in any of the above method embodiments.
[0155] The embodiment of the present application further provides another computer program product, comprising a nonvolatile computer readable storage medium, the nonvolatile computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps in any of the method embodiments.
[0156] The embodiment of the present application further provides a computer program, comprising computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the steps in any of the method embodiments.
[0157] The specific examples in the embodiment can refer to the examples described in the above embodiments and exemplary embodiments, and the embodiment will not be described here again.
[0158] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be concentrated on a single computing device or distributed on a network composed of multiple computing devices, and they can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
[0159] The above only describes optional embodiments of the present application and is not used to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application should be included in the protection scope of the present application.
Claims
1. A starting method of a server device, characterized in that, a first server device is deployed with a first operating system and a second operating system, the first operating system has a faster response speed than the second operating system, the first server device is connected with a second server device through a target bus, the method is applied to the first server device, and the method comprises: in a case where the first server device is started and the first operating system is started, the first operating system acquires a control right of the target bus, receives a first device request initiated by the second server device, executes the first device request to obtain a first request result by using a processing right of the device request, and sends the first request result to the second server device by using the control right of the target bus; in a case where the second operating system is started to a stage of allowing communication with the second server device, the second operating system acquires the control right of the target bus, receives a second device request initiated by the second server device and transmits the second device request to the first operating system, the first operating system continues to execute the second device request to obtain a second request result by using the processing right of the device request and transmits the second request result to the second operating system, and the second operating system sends the second request result to the second server device by using the control right of the target bus; in a case where the second operating system is started to a stage of allowing execution of a device request, the second operating system receives a third device request initiated by the second server device by using the control right of the target bus, executes the third device request to obtain a third request result by using a processing right of the device request, and sends the third request result to the second server device by using the control right of the target bus. 2.The method of claim 1, characterized in that, the first server device comprises a baseboard management controller of a target server, the second server device comprises a server host of the target server, and the target bus is a bus allowing transmission of data conforming to an intelligent platform management interface protocol; in the case where the first server device is started and the first operating system is started, the first operating system acquires the control right of the target bus, receives the first device request initiated by the second server device, executes the first device request to obtain the first request result by using the processing right of the device request, and sends the first request result to the second server device by using the control right of the target bus, comprising: in a case where the target server is started, starting the first operating system and the second operating system on the baseboard management controller. In a case that a first bus driver of the target bus has been loaded on the first operating system and a first application program of the intelligent platform management interface protocol has been run, the first operating system takes control authority of the target bus, receives the first device request initiated by the basic input output system running on the server host through the first bus driver; The first operating system takes processing authority of device request, and executes the first device request through the first application program to obtain a first request result; The first operating system uses the control authority of the target bus to send the first request result to the basic input output system through the first bus driver.
3. The method of claim 2, wherein, in a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: In a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: In a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: In a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: In a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: In a case that the second operating system starts to a stage of allowing communication with the second server device, the second operating system takes control authority of the target bus to receive a second device request initiated by the second server device and transmit the second device request to the first operating system, the first operating system continues to execute the second device request using processing authority of device request to obtain a second request result and transmit the second request result to the second operating system, and the second operating system uses the control authority of the target bus to send the second request result to the second server device, comprising: receiving, by the second operating system using the control right of the target bus, the third device request initiated by the basic input output system through the second bus driver; obtaining, by the second operating system, the processing right of device request, executing the third device request through the second application program to obtain a third request result; sending, by the second operating system using the control right of the target bus, the third request result to the basic input output system through the second bus driver.
5. The method of claim 1, wherein the receiving, by the second operating system using the control right of the target bus, the second device request initiated by the second server device and transmitting the second device request to the first operating system, and the continuing, by the first operating system using the processing right of device request, to execute the second device request to obtain a second request result and transmitting the second request result to the second operating system, and the sending, by the second operating system using the control right of the target bus, the second request result to the second server device, comprise: obtaining, by the second operating system, the control right of the target bus from the first operating system; accessing, by the second operating system using the control right of the target bus, the target bus to obtain the second device request initiated by the second server device on the target bus; sending, by the second operating system, the second device request to the first operating system; continuing, by the first operating system using the processing right of device request, to execute the second device request to obtain the second request result of the second device request; sending, by the first operating system, the second request result to the second operating system; sending, by the second operating system using the control right of the target bus, the second request result to the second server device by accessing the target bus.
6. The method of claim 5, wherein the sending, by the second operating system, the second device request to the first operating system, comprises: writing, by the second operating system, the second device request to a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system; triggering, by the second operating system, a first interrupt to the first operating system; and reading, by the first operating system, the second device request from the target storage space in response to the first interrupt; the sending, by the first operating system, the second request result to the second operating system, comprises: writing, by the first operating system, the second request result to the target storage space; triggering, by the first operating system, a second interrupt to the second operating system; and reading, by the second operating system, the second request result from the target storage space in response to the second interrupt.
7. The method of claim 1, wherein The second operating system receiving the second device request initiated by the second server device and transmitting the second device request to the first operating system when the second operating system has obtained the control right of the target bus, comprises: The second operating system requesting the control right of the target bus from the first operating system; The second operating system accessing the target bus to obtain the second device request initiated by the second server device through the target bus when the second operating system has requested the control right of the target bus; The second operating system transmitting the second device request to the first operating system through the target storage space on the first server device, wherein the target storage space allows the first operating system to access and also allows the second operating system to access.
8. The method of claim 7, wherein the second operating system requesting the control right of the target bus from the first operating system, comprises: The second operating system sending a first control request to the first operating system, wherein the first control request is used to request the control right of the target bus; The first operating system releasing the control right of the target bus in response to the first control request and sending first response information to the second operating system, wherein the first response information is used to indicate that the second operating system is allowed to obtain the control right of the target bus; The second operating system determining that the control right of the target bus has been requested in response to the first response information, or determining that the control right of the target bus has been requested when the second operating system does not receive the first response information within a first time period after detecting that the first control request is sent.
9. The method of claim 8, wherein the second operating system sending a first control request to the first operating system, comprises: The second operating system writing the first control request to a target storage space on the first server device, wherein the target storage space allows the first operating system to access and also allows the second operating system to access; and The first operating system reading the first control request from the target storage space in response to the third interrupt; the first operating system releasing the control right of the target bus in response to the first control request and writing the first response information to the target storage space; and the first operating system triggering a fourth interrupt to the second operating system. The determining, by the second operating system, that the control right to the target bus has been requested in response to the first response information comprises: reading, by the second operating system, the first response information from the target storage space in response to the fourth interrupt; and determining, by the second operating system, that the control right to the target bus has been requested according to the first response information.
10. The method of claim 1, wherein, The executing, by the second operating system, the third device request using the processing right of the device request to obtain a third request result comprises: requesting, by the second operating system, the processing right of the device request from the first operating system; executing, by the second operating system, the third device request using the application program of the device request in response to the second operating system having requested the processing right of the device request to obtain a third request result.
11. The method of claim 10, wherein, The requesting, by the second operating system, the processing right of the device request from the first operating system comprises: sending, by the second operating system, a second control request to the first operating system, wherein the second control request is used to request the processing right of the device request; releasing, by the first operating system, the processing right of the device request in response to the second control request and sending second response information to the second operating system, wherein the second response information is used to indicate that the second operating system is allowed to obtain the processing right of the device request; determining, by the second operating system, that the processing right of the device request has been requested in response to the second response information, or determining, by the second operating system, that the processing right of the device request has been requested in response to the second operating system not receiving the second response information within a second time period after detecting that the second control request is sent.
12. The method of claim 11, wherein, The sending, by the second operating system, the second control request to the first operating system comprises: writing, by the second operating system, the second control request to a target storage space on the first server device, wherein the target storage space is accessible by the first operating system and also accessible by the second operating system; and triggering, by the second operating system, a fifth interrupt to the first operating system; The releasing, by the first operating system, the processing right of the device request in response to the second control request and sending the second response information to the second operating system comprises: reading, by the first operating system, the second control request from the target storage space in response to the fifth interrupt; releasing, by the first operating system, the processing right of the device request in response to the second control request and writing the second response information to the target storage space; and triggering, by the first operating system, a sixth interrupt to the second operating system; The determining, by the second operating system, that the processing right of the device request has been requested in response to the second response information comprises: reading, by the second operating system, the second response information from the target storage space in response to the sixth interrupt; and determining, by the second operating system, that the processing right of the device request has been requested according to the second response information.
13. The method of claim 1, wherein, The memory of the first server device is divided into a target memory area, the first operating system is deployed with a first interrupt service function, an interrupt receiving thread and a service module, the second operating system is divided into a kernel layer and an application layer, the kernel layer is loaded with an inter-core communication driver, the application layer is deployed with a service process, the target memory area is set to be accessible by both the interrupt receiving thread and the inter-core communication driver, and the method further comprises: In a case where the service process generates first data to be sent to the service module, sending, by the service process, the first data to the inter-core communication driver through a system call; writing, by the inter-core communication driver, the first data into the target memory area and sending a first inter-core soft interrupt to the first operating system; triggering, by the first operating system, the first interrupt service function after receiving the first inter-core soft interrupt; waking up, by the first interrupt service function, the interrupt receiving thread; reading, by the interrupt receiving thread, the first data from the target memory area and sending the first data to the service module.
14. The method of claim 1, wherein, The memory of the first server device is divided into a target memory area, the first operating system is deployed with an interrupt sending thread and a service module, the second operating system is divided into a kernel layer and an application layer, the kernel layer is loaded with an inter-core communication driver, the inter-core communication driver is deployed with a second interrupt service function, the application layer is deployed with a service process, the target memory area is set to be accessible by both the interrupt sending thread and the inter-core communication driver, and the method further comprises: In a case where the service module generates second data to be sent to the service process, sending, by the service module, the second data to the interrupt sending thread; writing, by the interrupt sending thread, the second data into the target memory area and sending a second inter-core soft interrupt to the inter-core communication driver; triggering, by the inter-core communication driver, the second interrupt service function; reading, by the second interrupt service function, the second data from the target memory area and sending the second data to the service process through a system call.
15. The method of claim 1, wherein, after receiving, by the second operating system, a third device request initiated by the second server device using the control right of the target bus, the method further comprises: monitoring, by the first operating system, a running state of the processing right of the device request on the second operating system; acquire the control right of the target bus and the processing right of the device request from the second operating system in a case where it is monitored that the running state of the processing right of the device request on the second operating system indicates that the processing right of the device request runs abnormally; restart the second operating system by the first operating system.
16. The method of claim 15, wherein the monitoring, by the first operating system, of the running state of the processing right of the device request on the second operating system comprises sending, by the first operating system, a heartbeat command to the second operating system, wherein the heartbeat command is used to instruct the second operating system to send, to the first operating system, a system state of the second operating system and a functional state of the processing right of the device request, and wherein the running state of the processing right of the device request on the second operating system comprises the system state and the functional state; the method further comprises listening, by the second operating system, for the heartbeat command, and in a case where a time duration during which the heartbeat command is not listened to is greater than or equal to a target time duration, determining that the first operating system runs abnormally, and restarting, by the second operating system, the first operating system.
17. An apparatus for starting a server device, wherein a first operating system and a second operating system are deployed on a first server device, a response speed of the first operating system is greater than a response speed of the second operating system, the first server device is connected with a second server device through a target bus, the apparatus is applied to the first server device, and the apparatus comprises: a first running module configured to, in a case where the first server device is started and the first operating system has been started, acquire, by the first operating system, a control right of the target bus, receive a first device request initiated by the second server device, execute the first device request by the first operating system using a processing right of the device request to obtain a first request result, and send, by the first operating system, the first request result to the second server device using the control right of the target bus; a second running module configured to, in a case where the second operating system is started to a stage at which communication with the second server device is allowed, acquire, by the second operating system, a control right of the target bus, receive a second device request initiated by the second server device, and transmit the second device request to the first operating system, continue, by the first operating system, to execute the second device request using the processing right of the device request to obtain a second request result, and transmit the second request result to the second operating system, and send, by the second operating system, the second request result to the second server device using the control right of the target bus. A third operation module is configured to, in a case that the second operating system is started to a stage of allowing execution of a device request, receive, by the second operating system using the control right of the target bus, a third device request initiated by the second server device, execute the third device request to obtain a third request result by the second operating system using the processing right of the device request, and send, by the second operating system using the control right of the target bus, the third request result to the second server device.
18. A computer non-volatile readable storage medium, comprising a computer program, wherein the computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 16.
19. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method in any one of claims 1 to 16 when executing the computer program.
20. A computer program product, comprising a computer program, wherein the computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 16.
21. A computer program product, comprising a computer program, wherein the computer program is executed by a processor to implement the steps of the method in any one of claims 1 to 16.
Citation Information
Patent Citations
Service operation switching method and device, storage medium and electronic device
CN116243996A
Start control method and device of embedded system, storage medium and electronic equipment
CN116830082A
Operation control method and device of operation system, embedded system and chip
CN116868167A
Server equipment starting method and device
CN119025171A
Communicating commands to an embedded controller of a system
US20170177058A1