CN117742801A - Starting method and device of operating system - Google Patents

Starting method and device of operating system Download PDF

Info

Publication number
CN117742801A
CN117742801A CN202311630037.8A CN202311630037A CN117742801A CN 117742801 A CN117742801 A CN 117742801A CN 202311630037 A CN202311630037 A CN 202311630037A CN 117742801 A CN117742801 A CN 117742801A
Authority
CN
China
Prior art keywords
target
memory
operating system
function
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311630037.8A
Other languages
Chinese (zh)
Inventor
翁阿曼
朱英澍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311630037.8A priority Critical patent/CN117742801A/en
Publication of CN117742801A publication Critical patent/CN117742801A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a method and a device for starting an operating system, wherein a target operating system is an operating system started by taking a unified boot loader as boot firmware, and the method comprises the following steps: storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target memory is set to be not allowed to be modified in the process of executing the target starting function; and executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function. By the method and the device, the problem that the execution efficiency of the target starting function of the operating system is low in the related art is solved, and the effect of improving the execution efficiency of the target starting function of the operating system is achieved.

Description

Starting method and device of operating system
Technical Field
The embodiment of the application relates to the field of computers, in particular to a starting method and device of an operating system.
Background
As the processor speed, storage capacity, and resource performance of a system become more advanced and complex, the time to restart becomes longer and longer. In an operating system that starts up with uboot (Universal Boot Loader, unified boot loader) as boot firmware, the time of restart is critical to the impact of the production system, with longer restart time meaning reduced uptime. When the system has many loosely distributed buses or physical memory checked by ECC (Error Checking and Correcting), the main reason for the longer restart time is that the devices connected to the system at the firmware (firmware) stage are identified and initialized for too long. If the restart and initialization of the firmware phase can be avoided, the restart time can be greatly reduced, so that the system's fast start-up function is created by the operating system start-up process, by adjusting the entire boot loader phase and jumping directly to the kernel that we wish to boot to. There is no longer a hardware restart, no firmware operation, and no boot loader involved. The weakest loop in the boot sequence, the firmware, is completely avoided.
Currently, on an operating system using uboot as firmware, an interrupt controller with a message interrupt function is used, and under the condition that a message interrupt-based function of a terminal controller is disabled, a quick start function of the system can be normally used, but under the condition that the quick start function is enabled, the message interrupt-based function of the interrupt controller cannot be normally used, because after the quick start function is enabled, configuration information of the message interrupt-based function of the interrupt controller is modified, the message interrupt-based function of the interrupt controller cannot be normally initialized, and further other important equipment mainly including message interrupt cannot use message interrupt for communication, so that the operating system cannot be normally started.
Disclosure of Invention
The embodiment of the application provides a starting method and device of an operating system, which are used for at least solving the problem of low execution efficiency of a target starting function of the operating system in the related art.
According to an embodiment of the present application, there is provided a method for booting an operating system, where a target operating system is an operating system that is booted with a unified boot loader as boot firmware, including: storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target starting function is used for skipping a unified boot loader to realize kernel skip in the starting process of the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target starting function;
and executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function.
Optionally, the storing the target configuration information of the target interrupt controller of the target operating system to the target memory of the target operating system includes:
allocating the target memory for the target boot function in an initial memory of the target operating system, and setting the target memory to be not allowed to be modified in the process of executing the target boot function;
and storing target configuration information of a target interrupt controller of the target operating system in the target memory.
Optionally, the allocating the target memory for the target boot function in the initial memory of the target operating system, and setting the target memory to be not allowed to be modified in the process of executing the target boot function includes:
applying for the target starting function a first memory for storing the target configuration information;
and storing the first memory in a system memory mode to obtain the target memory.
Optionally, the applying for the target starting function for the first memory for storing the target configuration information includes:
calling an initial allocation function used for allocating the memory space in the target operating system;
setting an allocation identifier of the initial allocation function as a target allocation identifier, and setting allocation parameters of the initial allocation function as parameter values matched with the size of the target configuration information to obtain the target allocation function, wherein the target allocation identifier is used for indicating that an atomic allocation operation is required to be used by the allocation function when a memory space is allocated, the atomic allocation operation is used for realizing the atomicity of memory allocation, and the allocation parameters are used for indicating the space size of the memory space to be allocated;
using the target allocation function to allocate a second memory for the target configuration information;
and initializing the second memory to obtain the first memory.
Optionally, after storing the target configuration information of the target interrupt controller of the target operating system in the target memory, the method further includes:
and caching the memory address of the target memory into a register of the target interrupt controller.
Optionally, the executing the target startup function on the target operating system includes:
retrieving the target configuration information from the target memory;
initializing the target interrupt controller by using the target configuration information;
and finishing the starting of the target operating system by the initialized target interrupt controller processing an interrupt request belonging to a message interrupt function in the starting process of the target operating system.
Optionally, the retrieving the target configuration information from the target memory includes:
searching a memory address from a register of the target interrupt controller, wherein the memory address is used for indicating that the target memory exists at a position in an initial memory of the target operating system;
searching the target memory from the initial memory according to the memory address;
and extracting the target configuration information from the target memory.
According to another embodiment of the present application, there is provided a booting device of an operating system, where a target operating system is an operating system that is booted with a unified boot loader as boot firmware, including: the storage module is used for storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target starting function is used for skipping a unified boot loader to realize kernel skipping in the starting process of the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target starting function;
and the execution module is used for executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function.
According to a further embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the present application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the method and the device, on the operating system started by taking the unified boot loader as the boot firmware, the target configuration information of the target interrupt controller is distributed to the target memory which is not allowed to be modified in the process of executing the target starting function, and further under the condition that the target operating system is detected to trigger the target starting function, the target configuration information of the target interrupt controller of the target operating system is stored in the target memory, so that the target configuration information of the target interrupt controller is prevented from being modified in the process of executing the target starting function, and further, in the process of executing the target starting function on the target operating system, the target interrupt controller can be initialized in the process of executing the target starting function according to the target configuration information stored in the target memory, and further, the target starting function of the target operating system can be guaranteed to be completed.
Drawings
FIG. 1 is a hardware block diagram of a server device for a method of booting an operating system according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of booting an operating system according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative interrupt controller according to an embodiment of the present application;
fig. 4 is a block diagram of a boot device of an operating system according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in detail below with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be performed in a server device or similar computing device. Taking the example of running on a server device, fig. 1 is a block diagram of a hardware structure of a server device of a starting method of an operating system according to an embodiment of the present application. As shown in fig. 1, the server device may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU, a programmable logic device FPGA, or the like processing means) and a memory 104 for storing data, wherein the server device may further include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the architecture shown in fig. 1 is merely illustrative and is not intended to limit the architecture of the server apparatus described above. For example, the server device may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, such as software programs of application software and modules, such as computer programs corresponding to the method for starting an operating system in the embodiments of the present application, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, i.e., implement the methods described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located with respect to the processor 102, which may be connected to the server device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is configured to communicate with the internet wirelessly.
In this embodiment, a method for starting an operating system is provided, fig. 2 is a flowchart of a method for starting an operating system according to an embodiment of the present application, and as shown in fig. 2, a target operating system is an operating system started by using a unified boot loader as boot firmware, where the flowchart includes the following steps:
step S202, storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target start function, wherein the target start function is used for skipping a unified boot loader to realize kernel skipping in the process of starting the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target start function;
step S204, executing the target boot function on the target operating system, where the target configuration information stored in the target memory is used to initialize the target interrupt controller during execution of the target boot function.
The method for starting the operating system can be applied to a target interrupt controller but is not limited to the method.
Through the steps, on the operating system started by taking the unified boot loader as the boot firmware, the target configuration information of the target interrupt controller is distributed to the target memory which is not allowed to be modified in the process of executing the target starting function, and further, under the condition that the target operating system is detected to trigger the target starting function, the target configuration information of the target interrupt controller of the target operating system is stored in the target memory, so that the target configuration information of the target interrupt controller is prevented from being modified in the process of executing the target starting function, and further, in the process of executing the target starting function on the target operating system, the target interrupt controller can be initialized in the process of executing the target starting function according to the target configuration information stored in the target memory, and further, the target starting function of the target operating system can be guaranteed to be completed.
In the embodiment provided in step S202 above, the unified Boot loader is a U-Boot loader.
Alternatively, in the embodiment of the present application, the target operating system may be, but is not limited to, a linux system or an AIX system, which is not limited in this aspect.
Optionally, in the embodiment of the present application, the target boot function is used to boot directly from the currently running kernel to a new kernel, skip the entire boot loader phase and jump directly to the kernel that we wish to boot to. There is no longer a hardware restart, no firmware operation, and no boot loader involved. The weakest loop in the boot sequence, firmware, is completely avoided, and in this embodiment the target boot function may be, but is not limited to, kexec of the Linux kernel.
Alternatively, in the embodiment of the present application, the target configuration information is configuration information for implementing the interrupt function of the terminal controller, and the configuration information is stored in the memory, and the target configuration information may be configuration information for indicating the message-based interrupt function of the interrupt controller, and the target terminal controller may be, but not limited to, a V3 version or a V4 version of the GIC (Generic Interrupt Controller, general interrupt controller) interrupt controller.
Optionally, in the embodiment of the present application, the target memory may, but is not limited to, add the target identifier to the memory space for storing the target configuration information in the target operating system, so as to store the memory space for storing the target configuration information as the system memory, thereby obtaining the target memory.
Optionally, in this embodiment of the present invention, the target memory may also be a preconfigured system memory, where the system memory is a memory space where the stored content is not allowed to be modified, where the target interrupt controller applies for a candidate memory for storing target configuration information to the target operating system when the target operating system needs to store target configuration information, stores address information of the candidate memory in a register of the target interrupt controller, when it is detected that the target operating system is to trigger a target start function, screens a target memory for storing target configuration information from a system memory of the target operating system, and uses address information of the target memory to update the candidate memory address information stored in a storage device of the target interrupt controller, where the target memory may be an idle system memory matching a size of the target configuration information in a plurality of system memories of the target operating system, and if in a practical application, in the case that the idle system memory does not exist in the system memory, may release the system memory according to an importance of the configuration information stored in the system memory.
In the embodiment provided in step S204, the target interrupt controller is configured to initialize the interrupt control function of the target interrupt controller corresponding to the target configuration information using the target configuration information stored in the target memory.
FIG. 3 is a schematic diagram of an alternative interrupt controller according to an embodiment of the present application, as shown in FIG. 3: it contains four interrupt types SPI (shared peripheral interrupt), PPI (private peripheral interrupt), SGI (software generated interrupt) and LPI (interrupt-specific peripheral interrupt), and four major components of Distributor, ITS (interrupt translation service) (interrupt delivery service) and CPU interface. The LPI interrupt is a message-based interrupt introduced on the basis of GIC v2, and the peripheral device does not need to be connected to the GIC through a hardware interrupt line, and can write a message to a specific address to trigger the interrupt. Typical applications are MSI (Message Signaled Interrupt, message-based interrupt) and MSI-X (Message Signaled Interrupt eXtended, message-based extended interrupt) interrupts for PCIe. The LPI interrupt management function is mainly implemented in a Redistributor component, which is located between the Redistributor and the CPU interface. Because of the large number of LPI-supported interrupts, the configuration registers of these interrupts require a large amount of register space if they all use the internal registers of gic v3, so that the use of register space by the gic v3 saves its configuration information in memory. These tables include an LPI configuration table, an LPI pending status table, a virtual LPI configuration table, and a virtual LPI status table. When the GICv3 is initialized, the system allocates memory for the LPI configuration table and the LPI pending state table, sets the respective memory base addresses into the registers GICR_PROPBASER and GICR_PENDBASER respectively, and then transfers the management of the section of memory to the GICv3. The LPI support of GICv3 is reconfigured, that is, after the first configuration, the register value can be cached, and the next reconfiguration can directly use the cached data, that is, the base address of the applied LPI configuration table and LPI pending status table is also in the registers GICR_PROPBASER and GICR_PENDBASER. When the GICv3 is initialized, firstly judging whether the pre-loading configuration exists, if not, performing LPI configuration, applying for a memory to store an LPI configuration table and an LPI pending state table, and if so, re-binding the existing LPI configuration table and the LPI pending state table by using pre-loaded configuration information, wherein the kexec quick start is the pre-loading condition. The method comprises the steps of performing quick starting of kexec, skipping the whole boot loader stage and directly jumping to a kernel which we want to boot, continuously storing a new kernel image and an initrd image in a memory, recording the position of the initrd in boot_params, switching to the new kernel, namely jumping to the memory position of the new kernel image, executing the code of the entry by a CPU, and loading the content of a root file system by the new kernel through the initrd position recorded by the boot_params. Other areas of memory are not specifically required to be cleared. For GIC, the memory allocated for the LPI configuration table and the LPI pending state table for the first time is also cleared, which is the root cause of the problem, and the kexec restarting system clears the LPI configuration table and the LPI pending state table stored in the memory by GIC v3, and the GIC v3 finds the LPI configuration table and the LPI pending state table according to the memory address stored in the registers gicr_pro-aser and the gicr_pending state table when starting for the first time, so that a result that the corresponding memory area cannot be found can occur.
As an optional embodiment, the storing, in the target memory of the target operating system, target configuration information of the target interrupt controller of the target operating system includes:
allocating the target memory for the target boot function in an initial memory of the target operating system, and setting the target memory to be not allowed to be modified in the process of executing the target boot function;
and storing target configuration information of a target interrupt controller of the target operating system in the target memory.
Optionally, in the embodiment of the present application, the target memory is a memory space that matches the memory space occupied by the target configuration information, and the allocating the target memory may be by determining, from the initial memory, a real location of the memory space storing the target configuration information according to the memory space occupied by the target configuration information, further calculating, according to the starting location and the occupied memory space, a termination location of the target memory, and determining, as the target memory, a memory area indicated by the starting location and the termination location.
Alternatively, in the embodiment of the present application, the mode that the target memory is set to be not allowed to be modified may be that the target memory is saved in a system memory mode, or the target memory is added with a target tag, which is not limited in this scheme.
Through the above, the distributed target memory is set to be not allowed to be modified in the process of executing the target starting function, so that the integrity of the target configuration information in the process of executing the target starting function is ensured, and the interrupt control function of the target interrupt controller can be effectively initialized.
As an optional embodiment, the allocating the target memory for the target boot function in the initial memory of the target operating system, and setting the target memory not to be allowed to be modified in the process of executing the target boot function, includes:
applying for the target starting function a first memory for storing the target configuration information;
and storing the first memory in a system memory mode to obtain the target memory.
Alternatively, in the embodiment of the present application, the saving of the target memory in the system memory may be that the physical address addr is started by using the function uboot_mem_reserved_iomem, and the size memory area is saved in iomem in the reserved manner, because the reserved area of iomem is applied in the manner of membrane_reserved () in the early stage, this manner may ensure that the added memory is saved in the system memory.
Through the steps, the target memory is stored in the system memory mode, so that the information stored in the target memory is prevented from being deleted in the process of executing the target starting function, the target configuration information is stored in the target memory, and the integrity of the target configuration information in the system starting process is ensured.
As an optional embodiment, the applying for the target startup function for the first memory for storing the target configuration information includes:
calling an initial allocation function used for allocating the memory space in the target operating system;
setting an allocation identifier of the initial allocation function as a target allocation identifier, and setting allocation parameters of the initial allocation function as parameter values matched with the size of the target configuration information to obtain the target allocation function, wherein the target allocation identifier is used for indicating that an atomic allocation operation is required to be used by the allocation function when a memory space is allocated, the atomic allocation operation is used for realizing the atomicity of memory allocation, and the allocation parameters are used for indicating the space size of the memory space to be allocated;
using the target allocation function to allocate a second memory for the target configuration information;
and initializing the second memory to obtain the first memory.
Alternatively, in the present embodiment, the initial allocation function may be, but is not limited to, a kzalloc function.
Alternatively, in embodiments of the present application, the allocation parameter may be, but is not limited to, sizeof ().
As an optional embodiment, after storing the target configuration information of the target interrupt controller of the target operating system in the target memory, the method further includes:
and caching the memory address of the target memory into a register of the target interrupt controller.
Optionally, in the embodiment of the present application, the register of the target interrupt controller is configured to cache a memory address for the target interrupt controller, so that the target interrupt controller obtains the memory address from the register in a process that needs to be initialized, and then finds a target memory storing the target configuration information according to the memory address.
Through the above, the register for storing the memory address is configured on the target interrupt controller, so that the memory address storing the target configuration information is stored in the register, the subsequent acquisition of the target configuration information is facilitated, and the initialization efficiency of the interrupt controller is improved.
As an alternative embodiment, the executing the target boot function on the target operating system includes:
retrieving the target configuration information from the target memory;
initializing the target interrupt controller by using the target configuration information;
and finishing the starting of the target operating system by the initialized target interrupt controller processing an interrupt request belonging to a message interrupt function in the starting process of the target operating system.
Alternatively, in the embodiment of the present application, the message interrupt function is a message-based edge interrupt, and the interrupt information is not transferred through an interrupt line any more, but is transferred through the read and write of the memory. The message interrupt is transmitted through the memory, so that the limit of the limited number of interrupt lines to the use limit of the traditional interrupt mode is eliminated, the interrupt processing speed is greatly improved, the communication efficiency of the equipment is improved, and powerful support is provided for ARM architecture to support PCIe equipment and other equipment using message interrupt.
Alternatively, in the embodiment of the present application, the target configuration information may include, but is not limited to, LPI (Linux Professional Institute) configuration table, LPI pending status table.
As an optional embodiment, the retrieving the target configuration information from the target memory includes:
searching a memory address from a register of the target interrupt controller, wherein the memory address is used for indicating that the target memory exists at a position in an initial memory of the target operating system;
searching the target memory from the initial memory according to the memory address;
and extracting the target configuration information from the target memory.
Optionally, in this embodiment of the present application, when the target configuration information needs to be acquired, the stored memory address may be acquired from the register of the target interrupt controller, and then a storage area corresponding to the memory address may be found in the memory of the target operating system, and when the target configuration information is stored in the storage area, the target configuration information is extracted to initialize the interrupt function of the interrupt controller.
Through the above, the register is arranged in the interrupt controller and is used for storing the storage position of the configuration information in the memory space of the target operating system, so that the reading of the target configuration information is convenient, the storage accuracy of the configuration information in the memory can be ensured, and the error extraction of the configuration information is avoided.
In the application, the memory area where the LPI configuration table and the LPI pending state table are located is saved, so that after the kexec restarts the system, the data in the area also exist, and the system can normally use the data in the memory area. The operation is as follows:
the following function is added to driver\irqchip\irq-gic-v 3-its.c:
the function uboot_mem_reserve_iomem starts with the physical address addr, and the memory area with the size is saved in iomem in reserved mode, because the reserved area of iomem is applied in the mode of membrane_reserve () in early stage, this mode can ensure that the added memory is reserved in the mode of system memory, and kexec starts to reserve the whole system memory, so that after restarting, they are still visible in/proc/iomem, and data can be used normally.
The function gic _reserve_range is a memory area function in which the LPI configuration table and the LPI pending state table are stored in the GICV3, and is originally implemented as:
the EFI _enabled (efi_configuration_tabs) defines that the following function for storing the memory area where the LPI configuration table and the LPI pending state table are located can only be used in the configuration_efi mode, the currently used boot mode is uboot, and Linux does not enable configuration items related to UEFI, so the memory storage function herein is UEFI-specific, and a memory storage mode in the uboot boot mode needs to be added. The method of adding the saving memory of the uboot boot method to the function gic _reserve_range (addr, size) is as follows:
when UEFI is used as a starting mode, an if branch is taken, a efi mode is used for storing, when uboot is used as a starting mode, an else branch is taken, and a just-defined uboot mode is used for storing a related memory.
Through tests, the method can solve the problem that the LPI configuration table and the LPI pending state table of the GICv3 interrupt controller cannot be found after the kexec is restarted quickly under the uboot as a guide mode, and solves the problem that a linux operating system using the GICv3 interrupt controller does not support the kexec quick start function under the arm64 architecture of the uboot guide.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
In this embodiment, a starting device of an operating system is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and will not be described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 4 is a block diagram of a boot device of an operating system according to an embodiment of the present application, where the target operating system shown in FIG. 4 is an operating system that boots with a unified boot loader as boot firmware, the device includes: the storage module is used for storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target starting function is used for skipping a unified boot loader to realize kernel skipping in the starting process of the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target starting function;
and the execution module is used for executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function.
According to the method and the device, on the operating system started by taking the unified boot loader as the boot firmware, the target configuration information of the target interrupt controller is distributed to the target memory which is not allowed to be modified in the process of executing the target starting function, and further under the condition that the target operating system is detected to trigger the target starting function, the target configuration information of the target interrupt controller of the target operating system is stored in the target memory, so that the target configuration information of the target interrupt controller is prevented from being modified in the process of executing the target starting function, and further, in the process of executing the target starting function on the target operating system, the target interrupt controller can be initialized in the process of executing the target starting function according to the target configuration information stored in the target memory, and further, the target starting function of the target operating system can be guaranteed to be completed.
Optionally, the storage module includes: the processing unit is used for distributing the target memory for the target starting function in the initial memory of the target operating system, and setting the target memory to be not allowed to be modified in the process of executing the target starting function; and the storage unit is used for storing the target configuration information of the target interrupt controller of the target operating system in the target memory.
Optionally, the processing unit is configured to: applying for the target starting function a first memory for storing the target configuration information; and storing the first memory in a system memory mode to obtain the target memory.
Optionally, the processing unit is configured to: calling an initial allocation function used for allocating the memory space in the target operating system; setting an allocation identifier of the initial allocation function as a target allocation identifier, and setting allocation parameters of the initial allocation function as parameter values matched with the size of the target configuration information to obtain the target allocation function, wherein the target allocation identifier is used for indicating that an atomic allocation operation is required to be used by the allocation function when a memory space is allocated, the atomic allocation operation is used for realizing the atomicity of memory allocation, and the allocation parameters are used for indicating the space size of the memory space to be allocated; using the target allocation function to allocate a second memory for the target configuration information; and initializing the second memory to obtain the first memory.
Optionally, the apparatus further includes: and the caching unit is used for caching the memory address of the target memory into the register of the target interrupt controller after the target configuration information of the target interrupt controller of the target operating system is stored in the target memory.
Optionally, the execution module includes: the calling unit is used for calling the target configuration information from the target memory; the first processing unit is used for initializing the target interrupt controller by using the target configuration information; and the second processing unit is used for finishing the starting of the target operating system by processing an interrupt request belonging to a message interrupt function in the starting process of the target operating system through the initialized target interrupt controller.
Optionally, the calling unit is configured to: searching a memory address from a register of the target interrupt controller, wherein the memory address is used for indicating that the target memory exists at a position in an initial memory of the target operating system; searching the target memory from the initial memory according to the memory address; and extracting the target configuration information from the target memory.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Embodiments of the present application also provide an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic device may further include a transmission device connected to the processor, and an input/output device connected to the processor.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the same, but rather, various modifications and variations may be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for starting an operating system is characterized in that,
the target operating system is an operating system started by taking a unified boot loader as a boot firmware, and the method comprises the following steps:
storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target starting function is used for skipping a unified boot loader to realize kernel skip in the starting process of the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target starting function;
and executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
storing the target configuration information of the target interrupt controller of the target operating system to a target memory of the target operating system, including:
allocating the target memory for the target boot function in an initial memory of the target operating system, and setting the target memory to be not allowed to be modified in the process of executing the target boot function;
and storing target configuration information of a target interrupt controller of the target operating system in the target memory.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the allocating the target memory for the target boot function in the initial memory of the target operating system, and setting the target memory not to be allowed to be modified in the process of executing the target boot function includes:
applying for the target starting function a first memory for storing the target configuration information;
and storing the first memory in a system memory mode to obtain the target memory.
4. The method of claim 3, wherein the step of,
the applying for the target starting function for the first memory for storing the target configuration information includes:
calling an initial allocation function used for allocating the memory space in the target operating system;
setting an allocation identifier of the initial allocation function as a target allocation identifier, and setting allocation parameters of the initial allocation function as parameter values matched with the size of the target configuration information to obtain the target allocation function, wherein the target allocation identifier is used for indicating that an atomic allocation operation is required to be used by the allocation function when a memory space is allocated, the atomic allocation operation is used for realizing the atomicity of memory allocation, and the allocation parameters are used for indicating the space size of the memory space to be allocated;
using the target allocation function to allocate a second memory for the target configuration information;
and initializing the second memory to obtain the first memory.
5. The method of claim 2, wherein the step of determining the position of the substrate comprises,
after the storing the target configuration information of the target interrupt controller of the target operating system in the target memory, the method further includes:
and caching the memory address of the target memory into a register of the target interrupt controller.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the executing the target boot function on the target operating system includes:
retrieving the target configuration information from the target memory;
initializing the target interrupt controller by using the target configuration information;
and finishing the starting of the target operating system by the initialized target interrupt controller processing an interrupt request belonging to a message interrupt function in the starting process of the target operating system.
7. The method of claim 6, wherein the step of providing the first layer comprises,
the retrieving the target configuration information from the target memory includes:
searching a memory address from a register of the target interrupt controller, wherein the memory address is used for indicating that the target memory exists at a position in an initial memory of the target operating system;
searching the target memory from the initial memory according to the memory address;
and extracting the target configuration information from the target memory.
8. A starting device of an operating system is characterized in that,
the target operating system is an operating system started by taking the unified boot loader as a boot firmware, and the device comprises:
the storage module is used for storing target configuration information of a target interrupt controller of the target operating system to a target memory of the target operating system under the condition that the target operating system is detected to trigger a target starting function, wherein the target starting function is used for skipping a unified boot loader to realize kernel skipping in the starting process of the target operating system, and the target memory is set to be not allowed to be modified in the process of executing the target starting function;
and the execution module is used for executing the target starting function on the target operating system, wherein the target configuration information stored in the target memory is used for initializing the target interrupt controller in the process of executing the target starting function.
9. A computer-readable storage medium comprising,
the computer readable storage medium has stored therein a computer program, wherein the computer program when executed by a processor realizes the steps of the method as claimed in any of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that,
the processor, when executing the computer program, implements the steps of the method as claimed in any one of claims 1 to 7.
CN202311630037.8A 2023-11-29 2023-11-29 Starting method and device of operating system Pending CN117742801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311630037.8A CN117742801A (en) 2023-11-29 2023-11-29 Starting method and device of operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311630037.8A CN117742801A (en) 2023-11-29 2023-11-29 Starting method and device of operating system

Publications (1)

Publication Number Publication Date
CN117742801A true CN117742801A (en) 2024-03-22

Family

ID=90258332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311630037.8A Pending CN117742801A (en) 2023-11-29 2023-11-29 Starting method and device of operating system

Country Status (1)

Country Link
CN (1) CN117742801A (en)

Similar Documents

Publication Publication Date Title
CN110134446B (en) Method for starting PCIE equipment scanning
RU2639693C1 (en) Method for resource processing, operating system and device
US9223596B1 (en) Virtual machine fast provisioning based on dynamic criterion
US7363480B1 (en) Method, system, and computer-readable medium for updating the firmware of a computing device via a communications network
US8751785B2 (en) Memory tagging and preservation during a hot upgrade
CN110737479A (en) method for starting operating system without disk, server and readable storage medium
US10983847B2 (en) Dynamically loadable unikernel binaries
WO2014120113A1 (en) Assigning processors to memory mapped configuration
US9235426B2 (en) Multicore processor system, computer product, and notification method for updating operating system
CN115357310A (en) System starting method and device, electronic equipment and storage medium
CN113849272A (en) Method and device for adding GPU (graphics processing Unit) resources in virtual machine
CN110647359A (en) Semiconductor device, method of operating the same, and stacked memory device having the same
US7523284B1 (en) Method and apparatus for providing memory management within a system management mode
JP2002288104A (en) Computer system, and method and program for its resource assigning
US20200364040A1 (en) System and Method for Restoring a Previously Functional Firmware Image on a Non-Volatile Dual Inline Memory Module
WO2024113884A1 (en) Resource allocation method and apparatus for peripheral, server, and storage medium
US10572151B2 (en) System and method to allocate available high bandwidth memory to UEFI pool services
CN116627472A (en) Firmware program upgrading method and server of high-speed peripheral component equipment
CN116610370A (en) Starting method, starting device, starting equipment and storage medium
CN111767082A (en) Computing chip starting method and device and computer system
CN117742801A (en) Starting method and device of operating system
CN102455919A (en) Automatic optimization setting method for basic input output system(BIOS)
CN114064128B (en) Kernel restarting method
CN109656720B (en) Address space allocation method and device
CN109408407B (en) Display memory allocation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination