Operating system starting method and device and storage medium
By delaying scanning of PCIe devices during the operating system initialization phase and creating a root main bridge device node, the problem of the long startup time of the operating system in the chip verification device is solved, and faster operating system startup and chip verification efficiency improvement is achieved.
Patent Information
- Application Number
- CN202311841733.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
In chip verification devices, the startup time of the operating system is too long, especially because the PCIe device initialization stage takes too long, resulting in inefficient chip verification.
By setting startup parameters, the PCIe device is indicated to delay scanning, create a root main bridge device node, and skip the PCIe device scanning process during the operating system initialization phase, and scan the PCIe device as needed after the system is started.
It significantly reduces the startup time of the operating system, improves the efficiency of chip verification devices, and is suitable for operating system startup acceleration for terminal devices such as personal computers.
Smart Images

Figure CN120234049A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer devices, and in particular, to an operating system startup method, device, and storage medium. Background Art
[0002] In the process of chip R & D, in order to ensure that the functions and performance of the chip meet the requirements, it is necessary to verify and test the chip to verify whether the software and hardware functions in the chip can operate normally. Conventional chip verification devices include Field Programmable Gate Array (FPGA for short) verification devices, Emulator (EMU for short) verification devices, etc. Briefly speaking, in the process of verifying the chip through the chip verification device, the chip verification device is equivalent to an emulator, which is used to simulate the software and hardware environment of the chip to be verified. For example, it builds the hardware environment of the chip and runs the relevant software code on the chip. In order to ensure the stability and accuracy of the verification process, the chip verification device will set a lower clock frequency. At the same time, factors such as the complex logic of the chip design and the resource limitations of the verification device will cause the operating speed of the chip verification device to be much lower than the operating speed of the chip in actual applications.
[0003] For example, when verifying a System on chip (SoC for short) chip, it is necessary to test functions such as the Basic Input / Output System (BIOS for short), Unified Extensible Firmware Interface (UEFI for short), firmware, device driver, operating system startup, and diagnostic tools. Sometimes, it is even necessary to optimize the entire software stack for specific middleware frameworks, workloads, and applications. All these processes require running an Operating System (OS for short) on the chip verification device.
[0004] Due to reasons such as the operating speed limitation of the chip verification device and the excessive load of the operating system, it takes a long time to start the operating system and enter the user login interface. If the startup time of the operating system can be reduced as much as possible, the chip verification efficiency can be improved. Summary of the Invention
[0005] Embodiments of the present invention provide an operating system startup method, device, and storage medium to improve the startup speed of the operating system.
[0006] In a first aspect, an operating system startup method provided by an embodiment of the present invention includes:
[0007] Upon initialization of the operating system, read startup parameters;
[0008] If the startup parameter indicates a delayed scan of the PCIe device, create a root complex device node.
[0009] Perform initialization processing for other hardware devices and software.
[0010] Display a user login interface.
[0011] If an instruction to scan the PCIe device is received from the user, perform PCIe device scan processing.
[0012] In a second aspect, an embodiment of the present invention provides an operating system startup device, the device includes:
[0013] An acquisition module, configured to read startup parameters in response to the initialization of the operating system;
[0014] A first initialization module, configured to create a root complex device node if the startup parameter indicates a delayed scan of the PCIe device;
[0015] A second initialization module, configured to perform initialization processing for other hardware devices and software;
[0016] A display module, configured to display a user login interface;
[0017] The first initialization module is further configured to perform PCIe device scan processing if an instruction to scan the PCIe device is received from the user.
[0018] In a third aspect, an embodiment of the present invention provides an operating system startup method, applied to a chip verification device for verifying a chip, the chip verification device simulates the software and hardware environment of the chip, including the operating system corresponding to the chip and other software, and various PCIe devices including a root complex device and other hardware devices; the method includes:
[0019] Read startup parameters in response to the initialization of the operating system;
[0020] If the startup parameter indicates a delayed scan of the PCIe device, create a root complex device node;
[0021] Perform initialization processing for other hardware devices and software;
[0022] Display a user login interface;
[0023] If an instruction to scan the PCIe device is received from the user, perform PCIe device scan processing.
[0024] Fourthly, an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a communication interface; wherein, an executable code is stored on the memory, and when the executable code is executed by the processor, the processor can at least implement the operating system startup method as described in the first aspect or the third aspect.
[0025] Fifthly, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which an executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the operating system startup method as described in the first aspect or the third aspect.
[0026] In an embodiment of the present invention, the startup steps of the operating system include several stages: power-on self-test, startup BIOS, bootloader loading, operating system loading, system initialization (initialization of the operating system), and user login. Among them, the operating system initialization stage can be further divided into hardware initialization and software initialization such as starting system services and loading third-party application programs. Among them, the hardware initialization stage includes performing initialization of Peripheral Component Interconnect Express (PCIe) devices and other hardware initializations. When performing PCIe device initialization, first read the startup parameters. If the startup parameters indicate delayed scanning (or enumeration) of PCIe devices, then create a root host bridge node, and then perform initialization processing of other hardware devices and software to complete the system initialization stage and display the user login interface. After the user login interface is displayed, the user can trigger the scanning process of PCIe devices as needed. When receiving an instruction to scan PCIe devices input by the user, perform PCIe device scanning processing. By setting the startup parameters to control the execution of the PCIe device scanning process, skip the PCIe device scanning process during the operating system startup stage, and scan PCIe devices as needed after the operating system starts, thereby reducing the startup time of the operating system. Description of the Drawings
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0028] Figure 1 It is a schematic diagram of an operating system startup process provided by an embodiment of the present invention;
[0029] Figure 2Schematic diagram of the PCIe device topology visible to the CPU after scanning the PCIe device provided by the embodiment of the present invention;
[0030] Figure 3 Flowchart of a method for starting an operating system provided by the embodiment of the present invention;
[0031] Figure 4 Flowchart of a method for starting an operating system provided by the embodiment of the present invention;
[0032] Figure 5 Schematic diagram of the process of starting an operating system provided by the embodiment of the present invention;
[0033] Figure 6 Schematic diagram of the PCIe device topology visible to the CPU during the initialization stage of the PCIe device provided by the embodiment of the present invention;
[0034] Figure 7 Schematic diagram of the structure of an operating system startup device provided by the embodiment of the present invention;
[0035] Figure 8 Schematic diagram of the structure of an electronic device provided by the embodiment of the present invention. Detailed implementation manners
[0036] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0037] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.
[0038] The following will describe in detail some embodiments of the present invention with reference to the accompanying drawings. Without conflict between the embodiments, the embodiments and the features in the embodiments can be combined with each other. In addition, the step timings in the following method embodiments are only examples and are not strictly limited.
[0039] First, the terms or concepts involved in the embodiments of the present invention will be explained:
[0040] Chip: A chip refers to a System on Chip (SoC), which is an integrated circuit integrating multiple functional modules such as a processor, memory, and peripherals.
[0041] Operating System: During the chip verification phase, developers need to run an operating system on the verification device. An operating system is a software that manages hardware and software resources and provides services for application programs. In the chip verification scenario, the operating system runs on the verification device, that is, the operating system runs in the environment provided by the verification device. When the chip is applied to a certain terminal device, the operating system runs in the terminal device and is started by the chip.
[0042] Verification Device: A verification device is a hardware device used to verify the functions and performance of a chip. It can be a customizable hardware device such as an FPGA, which is used to simulate the behavior of the chip. The verification device provides an environment that enables developers to test and debug software and hardware resources such as BIOS / UEFI, firmware, device drivers, operating system startup, and diagnostic tools.
[0043] CPU: The CPU is a core component in the chip, responsible for executing instructions, processing data, and controlling the operation of the computer. On the verification device, the CPU can be an analog processor implemented in the FPGA, which is used to execute the instructions for operating system startup and various software.
[0044] A chip verification device is a hardware device that verifies the functions of a chip before mass production. The verification device is used to test and verify the design and functions of the chip to ensure the correctness and reliability of the chip in actual applications. During the chip verification phase, the verification device usually uses customizable hardware devices such as FPGAs to simulate the behavior of the chip. Developers will load the design code, verification code, and test programs of the chip into the verification device and verify by simulating the behavior of the chip. The code and test programs running on the verification device are used to verify the design and functions of the chip to ensure that the chip can correctly execute the required operations and functions. Therefore, the verification device is not only used to verify the hardware design of the chip but also used to verify the functions and performance of the chip. By verifying the chip, developers can discover and solve potential problems, optimize the design and performance of the chip to ensure that the chip meets the expected requirements before mass production.
[0045] During the process of verifying the chip, the verification device first needs to start the operating system in the simulated software and hardware environment of the chip, and then verify other functions. Such as Figure 1As shown, the startup steps of the operating system include power-on self-test, starting the BIOS, loading the bootloader, loading the operating system, initializing the operating system, and user login. Among them, the operating system initialization stage can be further divided into a hardware initialization stage and a software initialization stage such as starting system services and loading third-party applications. Among them, the hardware initialization stage includes PCIe device initialization and other hardware device initialization.
[0046] In the PCIe device initialization stage, as Figure 1 shown, the following steps can be included:
[0047] (1) Create a root host bridge device node;
[0048] (2) Create a root bus node (i.e., bus 0), which can be completed by executing the pci_create_root_bus function;
[0049] (3) Scan all PCIe devices under the root bus node. This can be completed by executing the pci_scan_child_bus function. The scanning process of PCIe devices traverses all PCIe devices in a depth-first traversal manner. Therefore, during the startup process of the operating system, the main time-consuming operation is here.
[0050] (4) Allocate resources for PCIe devices. For example, allocate resources such as memory and registers.
[0051] After executing the complete PCIe device scanning process, the CPU will see the complete PCIe device topology, as Figure 2 shown. After completing other initialization processes, the user login interface will be displayed. In Figure 2 , it is assumed that the created root bus node: bus 0 is connected under the root host bridge device node, and it is assumed that two PCIe devices: PCIe bridge1 and PCIe bridge2 are obtained by scanning the PCIe devices connected under bus0. In addition, as Figure 2 shown, it is assumed that a sub-bus bus1 is connected under the PCIe bridge1 device, and a PCIe device leaf node: endpoint device1 is connected under the bus1 bus; it is assumed that a sub-bus bus2 is connected under the PCIe bridge2 device, and a PCIe device leaf node: endpoint device2 is connected under the bus2 bus.
[0052] In a chip verification device, the total startup time of the operating system is relatively long, and the time consumption during the initialization phase of PCIe devices accounts for a high proportion. During the initialization phase of PCIe devices, it mainly traverses all PCIe devices through a depth-first traversal algorithm, and resources need to be allocated for PCIe devices and drivers need to be loaded. All these lead to a long time consumption in the PCIe device initialization process, slow down the startup of the operating system, and reduce the chip verification efficiency.
[0053] During the chip verification process, it is required to quickly start the operating system. In many cases, it does not depend on PCIe devices. Therefore, spending too much time in the initialization phase of PCIe devices when the operating system starts will increase the chip verification cycle.
[0054] Based on this, the embodiments of the present invention propose a method for accelerating the startup of the operating system by delaying the scanning of PCIe devices. This method can not only accelerate the startup of the operating system during the chip verification phase and improve the chip verification efficiency, but also can be used to accelerate the startup of the operating system in terminal devices such as personal computers (such as PCs) that are not very dependent on PCIe devices.
[0055] The following introduces the operating system startup solution provided by the embodiments of the present invention.
[0056] The following details the execution process of the operating system startup method provided by the embodiments of the present invention with reference to the accompanying drawings. This operating system startup method can be executed by the above verification device or by other computer devices, and is not limited to being applied in the chip verification scenario.
[0057] Figure 3 It is a flowchart of an operating system startup method provided by the embodiments of the present invention. As Figure 3 shown, the method includes the following steps:
[0058] 301. In response to the initialization of the operating system, read the startup parameters.
[0059] 302. If the startup parameters indicate to delay the scanning of PCIe devices, create a root host bridge device node.
[0060] 303. Perform initialization processing of other hardware devices and software.
[0061] 304. Display the user login interface.
[0062] 305. If an instruction to scan PCIe devices is received from the user, perform PCIe device scanning processing.
[0063] In the embodiment of the present invention, the improved operating system startup method specifically starts to execute when entering the operating system initialization phase, specifically in the PCIe device initialization phase of the hardware initialization phase. Therefore, in step 301, in response to the initialization of the operating system, reading the startup parameters means that when starting the PCIe device initialization process, based on the executed kernel code, it is first necessary to read the set startup parameters. These startup parameters are used during the process of starting the operating system, specifically in the PCIe device initialization phase. The startup parameters are used to indicate whether it is necessary to delay the scanning of PCIe devices.
[0064] In the embodiment of the present invention, before starting the operating system, a user (such as a chip developer) can set the startup parameters by modifying the configuration file of the bootloader. The bootloader will pass these startup parameters to the operating system kernel so that the kernel can perform relevant processing according to the configuration during startup, such as initializing the operating system according to this configuration file when the kernel starts. The parameter values of the startup parameters include two types: one is the first parameter value indicating delaying the scanning of PCIe devices: delay; the other is the second parameter value indicating not delaying the scanning of PCIe devices: no_delay.
[0065] Thus, when entering the operating system initialization phase and detecting the first parameter value, in the PCIe device initialization process, after creating the root host bridge device node, it directly returns, skipping the processes of creating the root bus, scanning PCIe devices, and allocating resources, and directly completing other operations for initializing the operating system (such as initializing other hardware and software (such as loading third-party application programs and system service programs)), thus completing the startup of the operating system, and then displaying the user login interface.
[0066] During specific implementation, after detecting the first parameter value, it will first parse the Advanced Configuration and Power Interface (ACPI for short) to obtain the Differentiated System Description Table (DSDT for short).
[0067] The DSDT table is generated by the ACPI compiler in the system BIOS or UEFI firmware. The DSDT table is a large binary data structure used to describe the characteristics, configurations, and control methods of system hardware devices. The DSDT table contains ACPI-defined device objects and methods for operating and managing system hardware.
[0068] In short, the DSDT table describes information about many system hardware devices, and the root host bridge device is one of them. The DSDT table may contain the device identifier of the root host bridge device. If the DSDT table can contain the device identifier of the root host bridge device, it indicates that the root host bridge device actually exists. Then, based on this device identifier, the driver program of the root host bridge device can be called. The PCIe device initialization process can be performed through the attach function included in the driver program of the root host bridge device. Specifically, in this embodiment, the root host bridge device node is created through the attach function.
[0069] In the above solution, during the PCIe device initialization process, only the operation of creating the root host bridge device node needs to be performed, and other operations are not performed. Therefore, the startup time of the operating system can be shortened.
[0070] After the operating system is started, in the chip verification scenario, other software and hardware functions in the chip that do not depend on the PCIe device can be verified. When the PCIe device needs to be started, the user can scan the PCIe device as needed under the started operating system. At this time, the user can input an instruction to indicate the scanning of the PCIe device, thereby triggering the scanning process of the PCIe device.
[0071] Among them, the scanning process of the PCIe device includes: creating a root bus node, scanning the PCIe devices connected under the root bus node, and allocating resources for the scanned PCIe devices. It is also possible to load the driver program for the scanned PCIe devices.
[0072] Optionally, in the embodiment of the present invention, if a startup instruction triggered by the user for the first file mounted under the first file interface directory is received, the PCIe device scanning process is performed according to the first file. Among them, the first file is used to complete "creating a root bus node, scanning the PCIe devices connected under the root bus node, and allocating resources for the scanned PCIe devices".
[0073] The first file interface directory is, for example: / sys / acpi / firmware / . As a file interface, the first file is mounted under this directory to form an interface file. The first file is, for example, named "force_rescan" to form the following file interface: / sys / acpi / firmware / force_rescan. The user can call the first file by inputting an instruction to enable the first file in the command line.
[0074] In practical applications, the above interface file can be created after calling the driver program of the root host bridge device and completed before the user login interface is displayed.
[0075] In summary, by setting startup parameters to control the execution of the PCIe device scanning process, the PCIe device scanning process is skipped during the operating system startup phase, and the PCIe devices are scanned as needed after the operating system starts, thereby reducing the startup time of the operating system.
[0076] Figure 4 FIG. is a flowchart of an operating system startup method provided by an embodiment of the present invention. As Figure 4 shown, the method includes the following steps:
[0077] 401. In response to the initialization of the operating system, read the startup parameters.
[0078] 402. If the startup parameters indicate to delay scanning the PCIe devices, create a root host bridge device node and create a root bus node.
[0079] 403. Perform initialization processing of other hardware devices and software.
[0080] 404. Display the user login interface.
[0081] 405. If a command to scan the PCIe devices is received from the user, scan the PCIe devices connected under the root bus node and allocate resources to the scanned PCIe devices.
[0082] In this embodiment, optionally, in the case of delaying the PCIe device scanning, after creating the root host bridge device node and the root bus node through the attach function, return, then perform the initialization of other hardware and software, and then display the user login interface.
[0083] After the user login interface is displayed, the user can trigger the PCIe device scanning command as needed. At this time, based on this command, scan the PCIe devices connected under the root bus node and allocate resources to the scanned PCIe devices.
[0084] Specifically, if a startup command triggered by the user for a second file mounted in the second file interface directory is received, scan the PCIe devices connected under the root bus node according to the second file and allocate resources to the scanned PCIe devices.
[0085] Among them, the second file is used to complete "scanning the PCIe devices connected under the root bus node and allocating resources to the scanned PCIe devices".
[0086] The second file interface directory is, for example, / sys / bus / pci / . This directory serves as a file interface, which can only be used after the root bus has been initialized. The second file is mounted under this directory to form an interface file. For example, the second file is named "rescan", thus forming the following file interface: / sys / bus / pci / rescan. Users can call the second file by entering an enabling instruction for the second file at the command line.
[0087] In practical applications, the above interface file can be created after calling the driver program of the root host bridge device and completed before the user login interface is displayed.
[0088] The above embodiments provide different ways of delaying the scanning of PCIe devices. It can be understood that if the startup parameter indicates immediate scanning of PCIe devices, then in the PCIe device initialization stage, it is necessary to completely execute the steps of creating the root host bridge device node, creating the root bus node, scanning the PCIe devices connected under the root bus node, and allocating resources for the scanned PCIe devices. After that, initialize other hardware devices and software, and then display the user login interface.
[0089] Figure 5 A schematic diagram of an operating system startup process provided by an embodiment of the present invention is shown in Figure 5 which shows the operating system startup processes with the startup parameter values of delay and no_delay in the foregoing embodiments. In addition, as shown in Figure 6 when only the root host bridge device node is created in the PCIe device initialization stage, the CPU can only see the root host bridge device node and cannot see other buses and PCIe devices connected to it.
[0090] In summary, by setting the startup parameter to control the execution of the PCIe device scanning process, the PCIe device scanning process is skipped in the operating system startup stage, thereby reducing the startup time of the operating system. Delayed PCIe device scanning can be achieved every time the operating system starts to accelerate the startup of the operating system. Moreover, after the operating system starts, on-demand scanning of PCIe devices can be achieved through the system file interface.
[0091] The operating system startup device of one or more embodiments of the present invention will be described in detail below. Those skilled in the art can understand that these devices can all be configured by using commercially available hardware components through the steps taught by this solution.
[0092] Figure 7 A schematic structural diagram of an operating system startup device provided by an embodiment of the present invention is shown in Figure 7As shown in the figure, the device includes: an acquisition module 11, a first initialization module 12, a second initialization module 13, and a display module 14.
[0093] The acquisition module 11 is used to read startup parameters in response to the initialization of the operating system.
[0094] The first initialization module 12 is used to create a root host bridge device node if the startup parameters indicate a delayed scan of PCIe devices.
[0095] The second initialization module 13 is used to perform initialization processing of other hardware devices and software.
[0096] The display module 14 is used to display a user login interface.
[0097] The first initialization module 12 is further used to perform PCIe device scan processing if an instruction to scan PCIe devices input by the user is received.
[0098] Optionally, the first initialization module 12 is specifically used to: parse the Advanced Configuration and Power Interface to obtain a differentiated system description table; call the driver of the root host bridge device according to the identifier of the root host bridge device in the differentiated system description table; create a root host bridge device node through the connection function in the driver.
[0099] Optionally, the first initialization module 12 is specifically used to: create a root bus node under the root host bridge device node; scan PCIe devices connected under the root bus node; allocate resources for the scanned PCIe devices.
[0100] Optionally, the first initialization module 12 is specifically used to: perform PCIe device scan processing according to the first file if a startup instruction triggered by the first file mounted in the first file interface directory is received by the user.
[0101] Optionally, the first initialization module 12 is specifically used to: create a root host bridge device node if the startup parameters indicate an immediate scan of PCIe devices, create a root bus node under the root host bridge device node, scan PCIe devices connected under the root bus node, allocate resources for the scanned PCIe devices; perform initialization processing of other hardware devices and software; display a user login interface.
[0102] Optionally, the first initialization module 12 is specifically configured to: if the startup parameter indicates a delayed scan of the PCIe device, create a root host bridge device node, and create a root bus node under the root host bridge device node; perform initialization processing of other hardware devices and software; display a user login interface; if a command to scan the PCIe device is received from the user, scan the PCIe devices connected under the root bus node, and allocate resources for the scanned PCIe devices.
[0103] Optionally, the first initialization module 12 is specifically configured to: if a startup command triggered by a user for a second file mounted in a second file interface directory is received, scan the PCIe devices connected under the root bus node according to the second file, and allocate resources for the scanned PCIe devices.
[0104] Figure 7 The device shown can execute the steps provided in the foregoing embodiments. For the detailed execution process and technical effects, refer to the descriptions in the foregoing embodiments, which will not be elaborated herein.
[0105] In a possible design, the structure of the foregoing Figure 7 shown operating system startup device can be implemented as an electronic device. As Figure 8 shown, the electronic device may include: a processor 21, a memory 22, and a communication interface 23. Among them, executable code is stored on the memory 22. When the executable code is executed by the processor 21, the processor 21 can at least implement the operating system startup method provided in the foregoing embodiments.
[0106] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium. Executable code is stored on the non-transitory machine-readable storage medium. When the executable code is executed by a processor of an electronic device, the processor can at least implement the operating system startup method provided in the foregoing embodiments.
[0107] The device embodiments described above are merely illustrative. The network elements described as separate components may or may not be physically separated. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding necessary general hardware devices, and of course, can also be implemented by the combination of hardware and software. Based on such understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for starting an operating system, characterized in that, It includes: Upon initialization of the operating system, read the startup parameters; If the startup parameters indicate a delayed scan of PCIe devices, create a root host bridge device node; Perform initialization processing for other hardware devices and software; Display the user login interface; If an instruction to scan PCIe devices is received from the user, perform PCIe device scan processing.
2. The method according to claim 1, wherein The creating of the root host bridge device node includes: Parse the Advanced Configuration and Power Interface to obtain the Differentiated System Description Table; According to the identifier of the root host bridge device in the Differentiated System Description Table, call the driver of the root host bridge device; Create a root host bridge device node through the connection function in the driver.
3. The method according to claim 1 or 2, characterized in that, The performing of PCIe device scan processing includes: Create a root bus node under the root host bridge device node; Scan the PCIe devices connected under the root bus node; Allocate resources for the scanned PCIe devices.
4. The method according to claim 3, characterized in that, The "if an instruction to scan PCIe devices is received from the user, perform PCIe device scan processing" includes: If a startup instruction is triggered by the user for the first file mounted in the first file interface directory, perform PCIe device scan processing according to the first file.
5. The method according to claim 1, wherein The method further includes: If the startup parameters indicate an immediate scan of PCIe devices, create a root host bridge device node, create a root bus node, scan the PCIe devices connected under the root bus node, and allocate resources for the scanned PCIe devices; Perform initialization processing for other hardware devices and software; Display the user login interface.
6. The method according to claim 1 or 2, characterized in that, After creating the root host bridge device node, it further includes: Create a root bus node under the root host bridge device node; The performing of PCIe device scan processing includes: Scan the PCIe devices connected under the root bus node and allocate resources for the scanned PCIe devices.
7. The method according to claim 6, wherein The "scan the PCIe devices connected under the root bus node and allocate resources for the scanned PCIe devices" includes: If a startup instruction is triggered by the user for the second file mounted in the second file interface directory, scan the PCIe devices connected under the root bus node according to the second file and allocate resources for the scanned PCIe devices.
8. A method for starting an operating system, characterized in that Applied to a chip verification device for verifying a chip, the chip verification device simulates the software and hardware environment of the chip, and includes: Upon initialization of the operating system, read the startup parameters; If the startup parameters indicate a delayed scan of PCIe devices, create a root host bridge device node; Perform initialization processing for other hardware devices and software; Display the user login interface; If an instruction to scan PCIe devices is received from the user, perform PCIe device scan processing.
9. An electronic device, characterized in that, It includes: A memory, a processor, and a communication interface; wherein, executable code is stored on the memory, and when the executable code is executed by the processor, the processor executes the operating system startup method according to any one of claims 1 to 8.
10. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to execute the operating system startup method according to any one of claims 1 to 8.