CN116820728A - Startup sequence management method and device, computer equipment and storage medium - Google Patents

Startup sequence management method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN116820728A
CN116820728A CN202310915604.8A CN202310915604A CN116820728A CN 116820728 A CN116820728 A CN 116820728A CN 202310915604 A CN202310915604 A CN 202310915604A CN 116820728 A CN116820728 A CN 116820728A
Authority
CN
China
Prior art keywords
sequence
starting
kernel
driving
module
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
CN202310915604.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.)
Shenzhen Corerain Technologies Co Ltd
Original Assignee
Shenzhen Corerain Technologies 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 Shenzhen Corerain Technologies Co Ltd filed Critical Shenzhen Corerain Technologies Co Ltd
Priority to CN202310915604.8A priority Critical patent/CN116820728A/en
Publication of CN116820728A publication Critical patent/CN116820728A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The present application relates to the field of operating system kernel technologies, and in particular, to a method and apparatus for managing a startup sequence, a computer device, and a storage medium. The starting sequence management method comprises a starting sequence setting step and a kernel starting step, wherein the starting sequence setting step comprises the step of additionally establishing a starting sequence for a driving module needing to be sequenced and started; the kernel starting step comprises the step of reading a starting sequence in the starting process of the kernel of the operating system; and calling a starting sequence after the driving modules are matched, and sequentially executing corresponding detection functions according to the starting sequence. According to the method, the starting sequence is additionally established for the driving modules which need to be sequenced and started, the starting sequence is read and executed in the kernel starting process, and the detection function of the corresponding driving module is sequentially executed according to the starting sequence, so that the flexible control and management of the kernel starting process are realized, the correct initialization sequence is ensured, and the method is convenient for a user to adjust and use.

Description

Startup sequence management method and device, computer equipment and storage medium
Technical Field
The present application relates to the technical field of operating system kernels, and in particular, to a method and apparatus for managing a startup sequence of an operating system kernel, a computer device, and a storage medium.
Background
The operating system kernel is a core part of an operating system, such as the Linux operating system, responsible for managing computer hardware and software resources, and providing interfaces for interacting with hardware devices and user programs, as well as providing many key functions such as process management, memory management, file systems, network protocol stacks, etc.
The driver module is a software component that extends the functionality of the kernel, allowing the operating system kernel to communicate and interact with the hardware device. For example, in Linux systems, a driver module is usually in the form of a dynamic link library, and can be loaded and unloaded at runtime, and the driver module is used to expose specific functions and characteristics of a hardware device to an operating system kernel, so that the operating system kernel can properly communicate with the hardware device.
The loading order of the driver modules may be affected by a number of factors, such as kernel configuration, device tree configuration, and module dependencies, and the specific loading order may vary from system to system and configuration to configuration.
The method for changing the starting sequence of the Linux driving module comprises the following steps:
1. changing the registration level of the driver modules, the driver modules in the operating system kernel may determine the start-up order based on their registration level, and by changing the registration level of the driver modules, may change their start-up order, and may be implemented by modifying the kernel source code or related configuration files. 2. Changing the device position in the device tree, which is a data structure describing the hardware devices, changes the matching sequence of the driving module and the devices by changing the position of the devices in the device tree, thereby changing the starting sequence of the driving module and the devices. 3. The order of compiling the driving modules is changed, the order of the driving modules when the kernel is loaded can be changed by changing the compiling order of the driving modules, and the kernel is recompiled by modifying the construction files or related compiling configuration in the source code of the kernel.
However, the above-described approaches all require modification and recompilation of the kernel or device tree, and thus require careful operation, with the following risks: 1. the inability of a device to boot, upgrading the kernel or device tree version may result in some devices being incorrectly identified or initialized, thereby resulting in the device being unable to boot. 2. The running is unstable, and the new version of the kernel or the device tree may have some unknown problems or compatibility problems, so that the system crashes, crashes or other unstable situations occur in the running process.
Disclosure of Invention
The technical problem to be solved by the application is to provide a starting sequence management method, a device, a computer device and a storage medium for solving the problems that the loading sequence of a driving module is easy to generate risk and the flow for changing the loading sequence is complex aiming at the defects in the prior art.
The technical scheme adopted for solving the technical problems is as follows: the method for managing the starting sequence of the operating system kernel comprises a plurality of driving modules for supporting corresponding hardware devices, wherein the starting sequence management method comprises a starting sequence setting step and a kernel starting step, and the starting sequence setting step comprises the additional establishment of a starting sequence for the driving modules needing to be sequenced and started;
the kernel starting step comprises the following steps:
reading a starting sequence in the starting process of the kernel of the operating system;
matching the driving modules and storing the corresponding detection function;
and calling a starting sequence after the driving modules are matched, and sequentially executing corresponding detection functions according to the starting sequence.
Among them, the preferred scheme is: the starting sequence setting step further includes:
setting a storage partition in the storage space;
the starting sequence of the driving modules which need to be started in sequence is stored in the storage partition.
Among them, the preferred scheme is: the starting sequence setting step further includes:
establishing communication connection with a network interface or a remote tool;
according to the operation instruction of the network interface or the remote tool, selecting and changing the starting sequence among the driving modules needing to be sequenced and started;
restarting the system after the change is completed;
and directly entering a kernel starting step after restarting the system.
Among them, the preferred scheme is: the step of restarting the system includes: and directly entering a kernel starting step after restarting the system.
Among them, the preferred scheme is: the starting process of the operating system kernel at least comprises a kernel initialization stage, and the kernel starting step is executed in the kernel initialization stage.
Among them, the preferred scheme is: each driving module is respectively matched with at least one hardware device, and the step of matching each driving module comprises the following steps:
loading each driving module;
each driving module is matched with corresponding hardware equipment when being loaded, and a corresponding detection function is stored after the matching is successful;
and each driving module detects whether other driving modules are matched after the matching is finished.
The preferred scheme is that the steps of matching each driving module and storing the corresponding detection function further comprise:
the kernel of the operating system loads all driving modules;
each driving module tries to match with corresponding hardware equipment when loading, and the driving module matches with the hardware equipment through an identifier, an equipment ID or an information attribute;
the probe function is associated with the successfully matched hardware device to execute the probe function during a subsequent boot-up process.
Among them, the preferred scheme is: presetting a conventional sequence;
presetting a selected marker bit;
before the kernel of the operating system is started, reading the selected flag bit, and judging whether the normal sequence is started normally or the starting sequence is read.
Among them, the preferred scheme is: the step of the starting sequence management method further comprises the following steps:
retrieving and discovering the activated driver module;
selecting a driving module needing to start sequence management from all driving modules;
sequencing the selected drive modules to form starting information;
and in the starting process of the kernel of the operating system, reading starting information with a starting sequence.
The technical scheme adopted for solving the technical problems is as follows: the utility model provides a starting sequence management device of an operating system kernel, which is used for realizing the steps of the method, comprising the following steps: a start sequence setting unit for storing the start sequence of the driving module; the kernel starting unit comprises a reading module, a matching module and an executing module, wherein the reading module reads a starting sequence in the starting process of the kernel of the operating system, the matching module matches each driving module and stores the corresponding detection function, and the executing module calls the starting sequence after each driving module is matched, and sequentially executes the detection function of the corresponding driving module according to the starting sequence.
The technical scheme adopted for solving the technical problems is as follows: there is provided a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of a method.
The technical scheme adopted for solving the technical problems is as follows: there is provided a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method.
Compared with the prior art, the method has the advantages that the starting sequence is additionally established for the driving modules which need to be sequenced and started through the starting sequence setting and the kernel starting management, the starting sequence is read and executed in the kernel starting process, and the detection function of the corresponding driving module is sequentially executed according to the starting sequence, so that the kernel starting process is flexibly controlled and managed, the correct initialization sequence is ensured, the user can conveniently adjust and use, the starting performance is optimized, and further, the pairing and initialization of the driving module and the hardware equipment are ensured to be carried out according to the correct sequence, so that the system can normally use the corresponding hardware equipment.
Drawings
The application will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a method for managing boot sequence of an operating system kernel according to the present application;
FIG. 2 is a flow chart of the start-up sequence setting step of the present application;
FIG. 3 is a flow chart of the kernel initiation step of the present application;
FIG. 4 is a schematic flow chart of the matching of the driving module according to the present application;
FIG. 5 is a flow chart of the start-up sequence setting step of the present application;
FIG. 6 is a flow chart of the present application for selecting a flag bit;
FIG. 7 is a flow chart of the present application for setting the start-up sequence of the drive module;
FIG. 8 is a schematic diagram of a boot sequence management apparatus of an operating system kernel of the present application;
FIG. 9 is a schematic diagram of a computer device according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application.
Detailed Description
Preferred embodiments of the present application will now be described in detail with reference to the accompanying drawings.
As shown in FIG. 1, the present application provides a preferred embodiment of a method for boot sequence management of an operating system kernel.
A starting sequence management method of an operating system kernel comprises a plurality of driving modules for supporting corresponding hardware devices, each hardware device needs a corresponding driving program to communicate and interact with the operating system kernel, the driving modules are responsible for managing and controlling functions and operations of the hardware devices, interfaces and functions interacted with the hardware devices are provided, and the operating system can correctly identify, configure and operate the hardware devices. For example, the network adapter, the graphics card, the sound card, the storage controller and the like all have corresponding driving modules, and the driving modules are used for realizing the communication with the hardware device by operating the register of the hardware device, transmitting data and executing specific operation, and the operating system is preferably a Linux system.
The starting sequence management method comprises the following steps:
step S100, starting a sequence setting step;
step S200, a kernel starting step.
In one embodiment, referring to fig. 2, regarding the start-up sequence setting step, the start-up sequence setting step includes additionally establishing a start-up sequence for a driving module that needs to be sequentially started, and the specific steps are as follows:
step S110, setting a storage partition in a storage space;
step S120, storing the starting sequence of the driving modules needing to be sequenced and started in the storage partition.
Specifically, the storage partition may be a partition of a hard disk storage space, or may be a partition of a flash memory or other available storage device; by storing the start-up sequence information of the drive modules in the storage partition, the start-up sequence information can be read and used at system start-up to manage the loading sequence of the drive modules.
Further, an embodiment is provided for storing start-up sequence information. The driver module identifiers are set, and each driver module is assigned a unique identifier, including the name, path, or other unique identifier of the driver module, through which each driver module has a unique identifier for identification and association during the start-up sequence setting process. And then, carrying out starting sequence association, associating the identifier of each driving module with the corresponding starting sequence, and creating a starting sequence table or file to ensure that the stored starting sequence information corresponds to the identifier and the starting sequence value of the driving module. During system start-up, it is ensured that they start in the order specified.
In one embodiment, there are other ways to store the boot sequence in addition to the storage partition, including in the form of configuration files, databases, and registries, which may be stored in specific locations in the file system and read and parsed at kernel boot; the kernel may be connected to the database at startup and retrieve and sort the driver modules according to predefined rules; and reading information in the registry, and loading and starting the driving module according to the setting in the registry.
However, all three of the above methods have disadvantages including poor flexibility, poor maintainability, and poor compatibility.
The starting sequence of the driving module can be flexibly adjusted under the condition of not modifying the kernel code by using the storage partition; and the starting sequence is stored in an independent storage partition, so that the management and maintenance of the starting sequence are more convenient, and the starting sequence of the driving module is managed by editing file content or data information in the storage partition without modifying the kernel itself; and, different hardware devices and driver modules may require different boot sequences, and a specific boot sequence may be defined for each device or module through the memory partition, thereby ensuring normal boot of the system under different configurations.
In one embodiment, referring to FIG. 3, the kernel launch step includes:
step S210, reading a starting sequence in the starting process of the kernel of the operating system;
step S220, matching the driving modules and storing the corresponding detection functions;
step S230, after the driving modules are matched, a starting sequence is called, and the detection functions of the corresponding driving modules are sequentially executed according to the starting sequence.
Specifically, during the booting process of the operating system kernel, the operating system kernel may read the booting information of the booting sequence. The startup parameters include paths specifying the storage partition and startup sequence information so that startup sequence information in the storage partition can be accessed quickly and accurately. After all the driving modules are matched, the kernel can execute corresponding detection functions in sequence according to the starting sequence information, so that pairing and initialization of the driving modules and the hardware equipment are ensured to be carried out according to the correct sequence.
Step S210 and step S220 are not sequentially associated, and may be performed simultaneously or sequentially, and generally, the calculation time spent in step S220 is longer than that spent in step S210. Of course, step S210 may be performed first and then step S220 may be performed, and once the kernel reads the start sequence information, the kernel starts to match each driving module, and on the basis of acquiring the start sequence, the driving module to be matched may be obtained. And after the matching is successful, storing the corresponding detection function.
The Probe Function (Probe Function) is a special Function in a driver, and is used for initializing and configuring a hardware device related to the driver during the system starting process. The instrumentation function is a portion of code in the driver, written by the developer, and called by the kernel when the driver module is loaded and initialized. The probe function is typically invoked during system start-up to detect and identify the hardware devices associated with the driver and to perform corresponding initialization and configuration, primarily to ensure pairing and proper initialization between the driver and the hardware devices so that the system can use these hardware devices properly. The execution of the probe functions comprises an identification device, an initialization device and a registration device, a developer needs to realize corresponding probe functions according to the requirements of specific hardware devices and a driving model, register and call the functions when the driving module loads and initializes, and the driver can ensure that the pairing and the initialization with the hardware devices are performed according to the correct sequence through the execution of the probe functions, so that the system can normally use the hardware devices.
The driver module may be loaded by a kernel module management tool (e.g., modprobe) or compiled as part of the kernel in the operating system kernel configuration. The operating system kernel loads and matches the driver modules in the specified order according to the start-up order information and saves their probe functions.
In one embodiment, the boot process of the operating system kernel includes at least a kernel initialization phase in which the kernel boot step is performed. Specifically, the starting process of the kernel of the operating system includes loading the kernel by a boot loader, booting the kernel, initializing the kernel, loading hardware detection and driving modules, initializing a user space and preparing the user space, wherein the kernel initialization stage is a key stage of the starting process of the kernel of the operating system. In the kernel initialization stage, the kernel performs a series of initialization operations including setting up kernel data structures, initializing memory management, initializing process management, initializing device driver frameworks, etc.
In particular, embodiments are provided in which the kernel initiation step is performed in a kernel initialization phase: 1. the read start sequence, the kernel reads the start sequence. The information of the start-up sequence describes the initialization sequence of the devices and even also the dependency between the devices. 2. And loading the driving modules, wherein the corresponding driving modules are sequentially loaded by the inner cores according to the starting sequence, the driving modules are pluggable modules in the inner cores and are used for supporting specific hardware equipment or providing specific functions, and the inner cores can select and load the corresponding driving modules according to the hardware identification of the equipment or the names of driving programs. 3. And matching the driving module with the loaded driving module according to the hardware identification or other characteristics of the device, and if the matched driving module is found, associating the device with the driving program by the kernel so as to initialize and operate the subsequent device.
In one embodiment, referring to fig. 4, step S220 further includes:
step S221, loading each driving module;
step S222, each driving module is matched with corresponding hardware equipment when being loaded, and a corresponding detection function is stored after the matching is successful;
in step S223, each driving module detects whether the other driving modules complete the matching after the matching is completed.
Specifically, the focus is on step S223, where each driving module detects whether other driving modules complete matching after matching is completed, so as to determine whether all driving modules complete matching, and thus enter the next link. The matching process is ensured to be completed by all the driving modules, so that the system can normally interact and communicate with the hardware equipment, and omission or errors cannot occur. In the detection process, each driving module traverses other driving modules and checks the matching state of the driving modules, and of course, the successful configuration record of all driving modules can be performed through the kernel of the operating system.
When all the driving modules are matched, or after a certain waiting time, the driving modules continue to execute subsequent operations, which is helpful to improve the stability and reliability of the system and ensure that the hardware devices can be used and managed correctly. If the match fails, a retry match may be performed, and if the retry match still fails, the system may take appropriate error handling measures, in some cases, the system may decide to ignore the failure of the match of a particular driver module to the hardware device and proceed with subsequent operations.
Each driving module tries to match with corresponding hardware equipment when loading, and the driving module matches with the hardware equipment through an identifier, an equipment ID or an information attribute; the probe function is associated with the successfully matched hardware device to execute the probe function during a subsequent boot-up process. When the driver module successfully matches the hardware device, it will associate a probe function with the hardware device, where the probe function is a function executed in a subsequent starting process, and is used to initialize the hardware device, register a device driver, set device parameters, and the like.
As shown in fig. 5, the present application provides a preferred embodiment of the start-up sequence setting step.
Suggesting a communication connection with a network interface or a remote tool, the step of initiating a sequence setting further comprises:
step S310, selecting and changing the starting sequence among the driving modules needing to be sequenced and started through a network interface or a remote tool;
step S320, restarting the system after the change is completed, and directly entering a kernel starting step after restarting the system.
Specifically, a user may log into the Linux operating system using a web interface or a remote tool, and the user may access the web interface of the system through related software, such as a browser, or log into the Linux operating system using a remote tool, such as SSH. After logging in, the setting interface should provide kernel starting parameters and configuration options of the driving modules, and change the starting sequence between the driving modules and add, delete or replace the corresponding driving modules by a preset modification mode, such as a dragging, selecting or inputting mode. The Web interface, i.e. the Web interface, is usually constructed by front-end technologies such as HTML, CSS, javaScript, etc., and it can present various elements such as text, images, forms, buttons, menus, etc., so that the user can perform various operations in the browser, such as inputting data, submitting forms, clicking links, etc.
After the operation is finished, restarting the system, verifying the modified starting sequence, after restarting the system, loading the driving module by the kernel according to the new starting sequence and initializing, and enabling a user to observe log information in the starting process of the system or use a system tool to verify whether the modified starting sequence is effective or not.
In one embodiment, when the kernel is started, the driving module is loaded according to a preset starting sequence. This start-up sequence is determined prior to system start-up and does not change dynamically during system operation. Therefore, the user modifies the start-up sequence of the driver modules, and the system needs to be restarted to effect the modification so that the kernel loads the driver modules in the new sequence. Meanwhile, the loading sequence of the driving module is not only the sequence of determining loading, but also the process of initializing and configuring is involved, the driving module needs to perform some initializing operations, such as memory allocation, registration equipment and the like, when loading, if a user modifies the starting sequence of the driving module, the system needs to be restarted to execute the initializing and configuring operations again so as to ensure that the driving module can work correctly.
In one embodiment, the step of restarting the system includes: and directly entering a kernel starting step after restarting the system. After the system is restarted, the boot loader is called, the boot loader is responsible for loading the kernel of the operating system, the boot loader loads the kernel of the operating system into the memory and transfers control to the kernel, and the kernel starting process comprises initializing hardware equipment, loading a driving module, setting system parameters and the like.
As shown in fig. 6, the present application provides a preferred embodiment of selecting a flag bit.
The starting sequence management method comprises the following steps:
step S410, presetting a conventional sequence;
step S420, a selected flag bit is preset;
step S430, before the kernel of the operating system is started, reading the selected flag bit, and judging whether the normal sequence is started normally or the starting sequence is read.
When the external equipment is accessed to load the corresponding driving module or autonomously downloads the corresponding driving module, the Linux Kernel operating system can form the conventional sequence of all the driving modules according to the preset rule, namely the normal driving starting sequence; and setting a selection marker bit, wherein the selection marker bit must be browsed and executed before the kernel of the operating system of the system is started, for example, the conventional sequence or starting sequence is called by selecting the content of the marker bit, or a calling rule is set, if the selection marker bit is not activated, the system cannot browse the selection marker bit, normal starting is selected, namely, starting is performed by adopting the conventional sequence, and if the selection marker bit is not activated, the starting sequence is called and read.
In one embodiment, the select flag bit is a variable or flag that indicates whether the system chooses to use a regular sequence or a custom startup sequence at startup. Specifically, the selected flag bit may be a binary variable having a value of 0 or 1, or a boolean variable having a value of true or false. When the value of the selected flag bit is 0 or false, the system selects normal start, namely, the system starts by adopting a preset normal sequence, and loads the driving module according to a default start sequence formed by a preset rule. When the value of the selected flag bit is 1 or true, the system will call the custom starting sequence and read, and the system will load the specific driving module according to the custom rule or setting to meet the specific requirement or configuration.
The specific implementation of the selection of the flag bit may vary depending on the system design, and may be a parameter in a file, an environment variable, a register value, or other form of flag or variable. The key is that the selection flag can be read before the system is started and the selection of the starting sequence is determined according to the value of the selection flag.
Preferably, the selection flag bit also comprises address information which points to the storage partition, and the system reads the starting sequence in the corresponding address information according to the address information, so that address change is realized or a plurality of sets of starting sequences are adopted, and the compatibility and operability of the whole system are improved.
As shown in fig. 7, the present application provides a preferred embodiment for setting the start-up sequence of the drive module.
The step of the starting sequence management method further comprises the following steps:
step S510, searching and finding the activated driving module;
step S520, selecting a driving module needing to start sequence management from all driving modules;
step S530, sorting the selected plurality of driving modules to form starting information;
step S540, during the starting process of the operating system kernel, the starting mechanism information with the starting sequence is read.
Specifically, the installed or available drive modules are searched, and which drive modules are activated is determined so as to be successfully started later. Meanwhile, an efficient driving module management mechanism is adopted, for example, a hash table or an index structure is used for storing and managing the activated driving modules, so that the searching and retrieving speed is improved. And indexing or adding metadata for the drive modules to quickly locate and identify the activated drive modules.
In step S520 and step S530, not all driving modules need to set a starting sequence, mainly, some driving modules have a starting relationship with each other, and the starting sequence needs to be set so that all driving modules can be started smoothly, and driving modules not listed in the starting sequence can be started according to the original driving sequence or random sequence. A user establishes a list or a storage space through a preset operation interface or an operation system, marks or sorts the driving modules needing to be set with the starting sequence, forms the starting sequence and stores the starting sequence, and is convenient for calling the storage partition or replacing files in the storage partition.
The system also performs proper analysis according to preset matched information, and analyzes the starting association between activated driving modules, including dependency relationship, sequence requirement or other specific starting constraint conditions, so as to enable a user to acquire the information.
A preferred embodiment is provided: creating a starting sequence list or a storage space, namely setting a storage partition in the storage space in step S110, wherein the storage partition is used for storing the starting sequence information of the driving module; ranking the selected driver modules to determine their loading order during startup, which may be based on predefined rules, dependencies, priorities, or other startup constraints; the ordered driving modules are sequentially updated into a starting sequence list or a storage partition, and of course, the storage partition starting sequence list can also be stored into the storage partition, and the driving modules are loaded and initialized according to a specific sequence according to the information in the list or the storage space; and forming a starting file or starting information according to the starting sequence list or the information in the storage space, wherein the starting file or the starting information guides the system to load and initialize the driving modules according to a preset sequence, and starting the driving modules which are not listed in the starting sequence according to the original driving sequence or the random sequence.
As shown in FIG. 8, the present application provides a preferred embodiment of a boot sequence management apparatus for an operating system kernel.
A boot sequence management apparatus 10 for an operating system kernel, for implementing the steps of a method, comprising: a start-up sequence setting unit 11 that stores a start-up sequence of the drive module; the kernel starting unit 12 comprises a reading module 121, a matching module 122 and an executing module 123, wherein the reading module 121 reads a starting sequence in the starting process of the kernel of the operating system, the matching module 122 matches each driving module and stores the corresponding detection function, and the executing module 123 calls the starting sequence after each driving module is matched, and sequentially executes the corresponding detection function according to the starting sequence.
In the process of starting the kernel of the operating system, different flow stages are executed, in the process of initializing the kernel, the kernel starting step is realized through the reading module 121, the matching module 122 and the executing module 123 respectively, after all the driving modules are matched, the kernel can execute corresponding detection functions in sequence according to starting sequence information, and pairing and initializing of the driving modules and the hardware equipment are ensured to be carried out according to the correct sequence. Meanwhile, in cooperation with the tool, the start-up sequence setting unit 11 realizes storage of the start-up sequence, preferably provides a storage space, sets a storage partition to store the start-up sequence.
Wherein, the reading module 121, the matching module 122 and the executing module 123 may be virtual modules in the operating system kernel processor.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the application. The computer device 20 comprises a processor 21, a memory 22. The processor 21 is coupled to the memory 22. The memory 22 has stored therein a computer program which is executed by the processor 21 in operation to implement the method as described above. The detailed steps are referred to above and will not be described herein.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an embodiment of a computer readable storage medium according to the present application. The computer readable storage medium 30 stores at least one computer program 31, and the computer program 31 is configured to be executed by a processor to implement the above method, and the detailed steps are referred to above and will not be repeated herein. In one embodiment, the computer readable storage medium 30 may be a memory chip, a hard disk or a removable hard disk in a terminal, or other readable and writable storage means such as a flash disk, an optical disk, etc., and may also be a server, etc.
Those skilled in the art will appreciate that the processes implementing all or part of the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a non-volatile computer readable storage medium, and the program may include the processes of the embodiments of the methods as above when executed. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others. The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing is only illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (11)

1. The method for managing the starting sequence of the operating system kernel is characterized in that the operating system kernel comprises a plurality of driving modules for supporting corresponding hardware equipment, the starting sequence management method comprises a starting sequence setting step and a kernel starting step, and the starting sequence setting step comprises additionally establishing a starting sequence for the driving modules needing to be sequenced and started;
the kernel starting step comprises the following steps:
reading a starting sequence in the starting process of the kernel of the operating system;
matching the driving modules and storing the corresponding detection function;
and calling a starting sequence after the driving modules are matched, and sequentially executing the detection functions of the corresponding driving modules according to the starting sequence.
2. The startup sequence management method according to claim 1, wherein the startup sequence setting step further comprises:
setting a storage partition in the storage space;
storing the starting sequence of the driving modules which need to be sequenced and started in the storage partition;
and in the starting process of the kernel of the operating system, directly calling and reading the starting sequence in the storage partition.
3. The startup sequence management method according to claim 1 or 2, wherein the startup sequence setting step further comprises:
establishing communication connection with a network interface or a remote tool;
according to the operation instruction of the network interface or the remote tool, selecting and changing the starting sequence among the driving modules needing to be sequenced and started;
restarting the system after the change is completed;
and directly entering a kernel starting step after restarting the system.
4. The boot sequence management method according to claim 1, wherein the boot process of the operating system kernel includes at least a kernel initialization phase, and the kernel boot step is performed in the kernel initialization phase.
5. The method for managing a start-up sequence according to claim 1, wherein each of the driving modules is paired with at least one hardware device, respectively, and the step of matching each of the driving modules comprises:
loading each driving module;
each driving module is matched with corresponding hardware equipment when being loaded, and a corresponding detection function is stored after the matching is successful;
and each driving module detects whether other driving modules complete matching after the matching is completed.
6. The method of claim 5, wherein the step of matching each of the driving modules and storing the corresponding probe function further comprises:
the kernel of the operating system loads all the driving modules;
each driving module tries to match with corresponding hardware equipment when being loaded, and the driving module matches with the hardware equipment through an identifier, an equipment ID or an information attribute;
the probe function is associated with the successfully matched hardware device to execute the probe function during a subsequent boot-up process.
7. The startup sequence management method according to claim 1 or 4, characterized in that the step of the startup sequence management method further comprises:
presetting a conventional sequence;
presetting a selected marker bit;
before the kernel of the operating system is started, reading the selected flag bit, and judging whether the normal sequence is started normally or the starting sequence is read.
8. The startup sequence management method according to claim 1 or 2, characterized in that the step of the startup sequence management method further comprises:
retrieving and discovering the activated driver module;
selecting a driving module needing to start sequence management from all driving modules;
sequencing the selected drive modules to form starting information;
and in the starting process of the kernel of the operating system, reading starting information with a starting sequence.
9. A boot sequence management apparatus for an operating system kernel, characterized by comprising the steps of implementing the method of any one of claims 1 to 7:
a start-up sequence setting unit that stores a start-up sequence of the driving module;
the kernel starting unit comprises a reading module, a matching module and an executing module, wherein the reading module reads a starting sequence in the starting process of the kernel of the operating system, the matching module matches each driving module and stores the corresponding detection function, and the executing module calls the starting sequence after each driving module is matched, and sequentially executes the detection function of the corresponding driving module according to the starting sequence.
10. A computer-readable storage medium, characterized in that a computer program is stored, which, when being executed by a processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.
11. A computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any one of claims 1 to 7.
CN202310915604.8A 2023-07-24 2023-07-24 Startup sequence management method and device, computer equipment and storage medium Pending CN116820728A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310915604.8A CN116820728A (en) 2023-07-24 2023-07-24 Startup sequence management method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310915604.8A CN116820728A (en) 2023-07-24 2023-07-24 Startup sequence management method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116820728A true CN116820728A (en) 2023-09-29

Family

ID=88112906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310915604.8A Pending CN116820728A (en) 2023-07-24 2023-07-24 Startup sequence management method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116820728A (en)

Similar Documents

Publication Publication Date Title
EP1224543B1 (en) Fixing applications that are incompatible to the operating system by providing stubs for apis
US6529966B1 (en) Booting a computer system using a last known good set of configuration data
US6618857B1 (en) Method and system for installing software on a computer system
US8751783B2 (en) Booting computing devices with EFI aware operating systems
US7237238B2 (en) Method and apparatus for automated operating systems upgrade
US6553490B1 (en) Computer system including local computer with capability to automatically update operating system or application program from network server
US8464242B2 (en) Virtualization of configuration settings
US20070006222A1 (en) Software installation method and computer system
US20190138417A1 (en) Device configuration with cached pre-assembled driver state
US6430706B1 (en) Tracking and managing failure-susceptible operations in a computer system
CN111562934A (en) Software system upgrading method based on hot patch, terminal and storage medium
CN113254089B (en) System boot method correction method, device, equipment and storage medium
US20060026415A1 (en) Method of updating a portion BIOS
CN116880877A (en) Virtual machine enhancement tool upgrading method and device, computer equipment and storage medium
CN113849200B (en) Installation optimization method and system for android application in android compatible environment
CN116820728A (en) Startup sequence management method and device, computer equipment and storage medium
CN114610516A (en) Application program repairing method and device, computer equipment and storage medium
US9081727B2 (en) Method, apparatus and computer program for loading files during a boot-up process
CN105278993A (en) Linux system based drive module upgrading method and apparatus
CN117472458B (en) System function optimal configuration method and device, electronic equipment and storage medium
CN114116033B (en) Method and device for modifying server configuration
CN112463240B (en) Method for restarting access to WinPE
CN115840617A (en) Debugging method, system and related device
CN115421761A (en) Method, device, system, equipment and medium for upgrading micro-control unit application program
CN115658643A (en) Data migration method and system during upgrading of distributed database

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