A method and device for starting a domestic operating system based on UEFI and Linux

By embedding the Linux operating system in UEFI and adding adaptive components, the problems of high UEFI firmware development threshold and insufficient device driver robustness are solved, efficient startup of domestic operating systems and rich file system support are achieved, and development difficulty is reduced .

CN115033296BActive Publication Date: 2024-11-05KUNLUN TECH (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210523816.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2024-11-05
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

The existing UEFI firmware development threshold is high, the device driver is not robust enough, and it cannot support EXT4 file system write operations and multiple startup devices.

Method used

Embed the Linux operating system in UEFI, add processor adapter components and kernel boot components, omit the DXE stage, use the Linux operating system to load the domestic operating system loader, and extend file system support.

Benefits of technology

It realizes efficient and flexible startup of domestic operating systems, enhances device driver robustness and file system support, and lowers development thresholds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033296B_ABST
    Figure CN115033296B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for starting a domestic operating system based on UEFI and Linux. The Linux operating system is embedded in the UEFI, the traditional UEFI jump DXE stage is omitted, the DXE driver is loaded and the initialization step is completed, so that the startup method of the domestic operating system is more efficient and flexible. A domestic processor adapter component is added to the Linux operating system to expand the support function for the domestic processor. A kernel boot component is added to the Linux operating system to expand the support function for the domestic operating system. When the computer starts, the user can choose UEFI firmware boot or embedded Linux boot mode, wherein the embedded Linux boot mode only needs to execute the SEC stage and PEI stage in the UEFI, and does not need to execute the UEFI jump driver execution environment DXE stage; when the UEFI jump boot device selects the BDS stage, the Linux operating system embedded in the UEFI is first loaded, and then the Linux operating system embedded in the UEFI is used to load the domestic operating system loader, thereby realizing the startup of different computer operating systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer firmware, and in particular to a method and device for starting a domestic operating system based on UEFI and Linux. Background Art

[0002] The existing UEFI (Unified Extensible Firmware Interface) firmware implementation is divided into seven stages according to UEFI and PI specifications: SEC (Security), PEI (Pre-EFI Initialization), DXE (Driver Execution Environment), BDS (Boot Device Selection), TSL (Transient System Load), RT (Run Time), and AL (After Life) .

[0003] The UEFI implementation currently has the following problems: 1) There are few people researching and developing UEFI firmware, and the threshold is high; 2) UEFI has limited support for boot devices and file systems, such as not supporting write operations for the EXT4 file system; 3) UEFI's device driver is not robust enough, that is, the software is not capable of handling input conditions outside of the specification requirements. The UEFI device driver code does not consider error handling and recovery. Summary of the invention

[0004] In view of this, the present invention provides a method and device for starting a domestic operating system based on UEFI and Linux, which can efficiently and flexibly start the domestic operating system, while expanding the system's support capabilities for startup devices and file systems.

[0005] The specific technical solution adopted by the present invention is as follows:

[0006] A method for starting a domestic operating system based on UEFI and Linux, embedding a Linux operating system in the unified extensible firmware interface UEFI, and adding a processor adapter component and a kernel boot component to the Linux operating system;

[0007] In the process of starting the domestic operating system, there is no need to execute the UEFI jump driver execution environment DXE stage; when the UEFI jump startup device selects the BDS stage, the Linux operating system is loaded first, and then the Linux operating system is used to load the domestic operating system loader, thereby realizing the startup of different domestic operating systems.

[0008] Furthermore, the steps of starting the domestic operating system include:

[0009] Step 1: The UEFI security SEC phase starts, and CPU interrupt exception initialization and temporary memory initialization are performed;

[0010] Step 2: UEFI jumps to the early initialization PEI stage to complete CPU initialization, memory initialization, and motherboard initialization;

[0011] Step 3. Select and confirm whether the boot mode is the traditional boot mode or the embedded Linux boot mode. If it is the traditional boot mode, go to step 4, otherwise go to step 5;

[0012] Step 4: Jump to the driver execution environment DXE stage to complete the initialization of peripherals such as PCI, USB, and graphics card;

[0013] Step 5. UEFI jumps to the BDS boot device selection stage. If it is a traditional boot, select the boot device, otherwise load the Linux operating system. If the Linux operating system fails to load, it will report an error and jump to BDS to load the Linux operating system again until it is loaded successfully;

[0014] Step 6. UEFI jumps to the temporary system loading TSL stage, loads the domestic operating system loader from the selected boot device or Linux operating system and runs it;

[0015] Step 7. UEFI jumps to the RT stage and loads the domestic operating system to run.

[0016] Furthermore, the Linux operating system also includes a Linux kernel and an Initramfs root file system; the processor adapter component and the kernel boot component are loaded into the Linux kernel.

[0017] Furthermore, in step seven, if a hardware or software catastrophic error occurs during the operation of the domestic operating system, the process jumps to the disaster recovery AL stage for disaster recovery processing.

[0018] Furthermore, the domestic operating systems supported by the domestic operating system startup method include: Feiteng 2004 system, Feiteng D2000 system, Feiteng 2000PLUS system, Tengyun S2500 system, Kylin OS and UOS system.

[0019] A domestic operating system boot device based on UEFI and Linux, in which a Linux module is embedded in UEFI, and the Linux module includes a domestic processor adapter component unit and a kexec kernel boot tool unit;

[0020] When starting the domestic operating system, first load and run the Linux module, and then use the Linux module to load the domestic operating system adapter component, so as to realize the startup of different domestic operating systems.

[0021] Furthermore, the step of starting the domestic operating system using the domestic operating system starting device includes:

[0022] Step 1: The UEFI security SEC phase starts, and CPU interrupt exception initialization and temporary memory initialization are performed;

[0023] Step 2: UEFI jumps to the early initialization PEI stage to complete CPU initialization, memory initialization, and motherboard initialization;

[0024] Step 3. Select and confirm whether the boot mode is the traditional boot mode or the embedded Linux boot mode. If it is the traditional boot mode, go to step 4, otherwise go to step 5;

[0025] Step 4: Jump to the driver execution environment DXE stage to complete the initialization of peripherals such as PCI, USB, and graphics card;

[0026] Step 5. UEFI jumps to the BDS boot device selection stage. If it is a traditional boot, select the boot device, otherwise load the Linux operating system. If the Linux operating system fails to load, it will report an error and jump to BDS to load the Linux operating system again until it is loaded successfully;

[0027] Step 6. UEFI jumps to the temporary system loading TSL stage, loads the domestic operating system loader from the selected boot device or Linux operating system and runs it;

[0028] Step 7. UEFI jumps to the RT stage and loads the domestic operating system to run.

[0029] Furthermore, the Linux module also includes a Linux kernel unit and an Initramfs root file unit.

[0030] Furthermore, in step five, if a hardware or software catastrophic error occurs during the operation of the domestic operating system, the process jumps to the disaster recovery AL stage for disaster recovery processing.

[0031] Furthermore, the domestic operating systems supported by the domestic operating system startup device include: Feiteng 2004 system, Feiteng D2000 system, Feiteng 2000PLUS system, Tengyun S2500 system, Kylin OS and UOS system.

[0032] Beneficial effects:

[0033] (1) A method for booting a domestic operating system based on UEFI and Linux, embedding a Linux operating system in UEFI, and switching from booting the operating system by UEFI to booting the domestic operating system by using the Linux operating system embedded in UEFI, omitting the traditional steps of UEFI jumping to the DXE stage, loading the DXE driver and completing the initialization, making the booting method of the domestic operating system more efficient and flexible. A domestic processor adapter component is added to the Linux operating system to expand the support functions for domestic processors. A kernel boot component is added to the Linux operating system to expand the support functions for domestic operating systems.

[0034] (2) During the computer startup process, users can choose to boot from the traditional UEFI firmware or the embedded Linux boot method. The embedded Linux boot method only needs to execute the SEC and PEI stages in UEFI, and does not need to execute the UEFI jump driver execution environment DXE stage; when the UEFI jump boot device selects the BDS stage, the UEFI embedded Linux operating system is loaded first. This achieves the purpose of providing users with more flexible boot options.

[0035] (3) The Linux operating system includes the Linux kernel and the Initramfs root file system. By using the EXT file system module of the Linux kernel, UEFI can be extended to the EXT series of file systems including EXT2, EXT3, EXT4, etc., and its support for boot devices will be richer. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a schematic diagram of the framework of a domestic operating system startup device based on UEFI and Linux of the present invention.

[0037] Figure 2 This is a flow chart of the method for users to dynamically select a traditional UEFI boot method or a domestic operating system boot method of UEFI and Linux in the present invention.

[0038] Figure 3 This is the traditional UEFI boot flow chart.

[0039] Figure 4 This is a flow chart of a method for starting a domestic operating system based on UEFI and Linux according to the present invention. DETAILED DESCRIPTION

[0040] A method and device for starting a domestic operating system based on UEFI and Linux, wherein a Linux operating system is embedded in UEFI, and the steps of traditional UEFI jumping to the DXE stage, loading the DXE driver and completing initialization are omitted, making the startup method of the domestic operating system more efficient and flexible. A domestic processor adapter component is added to the Linux operating system to expand the support function for domestic processors. A kernel boot component is added to the Linux operating system to expand the support function for domestic operating systems. When starting a domestic operating system, the Linux operating system is first loaded, and then the Linux operating system is used to load the domestic operating system loader, thereby realizing the startup of different domestic operating systems.

[0041] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0042] First, the existing UEFI boot process is introduced, such as Figure 3 As shown, including:

[0043] Step 1: Power on the computer, start the UEFI SEC phase, and initialize the CPU interrupt exception and temporary memory;

[0044] Step 2: UEFI jumps to the PEI stage to complete CPU initialization, memory initialization, and motherboard initialization;

[0045] Step 3: UEFI jumps to the DXE stage, loads the DXE driver and completes initialization;

[0046] Step 4: UEFI jumps to the BDS stage, selects the device that needs to start the operating system, and loads the domestic operating system loader on it. If the loading fails, run SHELL. If running SHELL fails, jump to the DXE stage and execute again, otherwise run SHELL to interact with the user;

[0047] Step 5: UEFI jumps to the TSL stage and runs the domestic operating system loader;

[0048] Step 6. UEFI jumps to the RT stage and loads the domestic operating system to run. The supported domestic operating systems include Kylin operating system and UOS operating system;

[0049] Step 7: During the operation of the domestic operating system in the RT stage, if a hardware or software catastrophic error occurs, such as a software crash or hardware anomaly, jump to the AL stage for disaster recovery processing.

[0050] The present invention provides a method for starting a domestic operating system based on UEFI and Linux, wherein a Linux operating system is embedded in a unified extensible firmware interface UEFI, and a domestic processor adapter component and a kexec kernel boot tool are added to the Linux operating system. The Linux operating system itself also includes a Linux kernel and an Initramfs root file system.

[0051] When starting the domestic operating system, first load the Linux operating system, and then use the Linux operating system to load the domestic operating system loader, thereby realizing the startup of different domestic operating systems.

[0052] like Figure 4 As shown, it is a flow chart of a method for starting a domestic operating system based on UEFI and Linux of the present invention. The method for starting a domestic operating system of the present invention comprises the following steps:

[0053] Step 1: The UEFI security SEC phase starts, and CPU interrupt exception initialization and temporary memory initialization are performed;

[0054] Step 2: UEFI jumps to the early initialization PEI stage to complete CPU initialization, memory initialization, and motherboard initialization;

[0055] Step 3: UEFI selects whether to start in traditional mode or in embedded Linux mode according to the boot mode configured by the user (configured in the SETUP configuration interface and stored in the flash). If it is started in traditional mode, go to step 4, otherwise go to step 5;

[0056] Step 4: Jump to the driver execution environment DXE stage to complete the initialization of peripherals such as PCI, USB, and graphics card;

[0057] Step 5. UEFI jumps to the BDS stage of boot device selection. If it is a traditional boot, select the boot device (such as SSD hard disk, NVME hard disk, network, etc.), otherwise load the Linux operating system. If the loading of the Linux operating system fails, it will report an error and jump to BDS to load the Linux operating system again until it is loaded successfully;

[0058] Step 6. UEFI jumps to the temporary system loading TSL stage, loads the domestic operating system loader from the selected boot device or Linux operating system and runs it;

[0059] Step 7: UEFI jumps to the RT stage and loads the domestic operating system to run. During the operation of the domestic operating system, if a hardware or software catastrophic error occurs, it jumps to the disaster recovery AL stage for disaster recovery processing.

[0060] In this method, the user can dynamically select two startup modes during the computer startup process. One is that the user can choose to boot from the traditional UEFI firmware during the computer startup process. The other is that during the computer startup process, only the SEC stage and PEI stage in the UEFI need to be executed, and there is no need to execute the UEFI jump driver execution environment DXE stage; when the UEFI jump startup device selects the BDS stage, the Linux operating system embedded in the UEFI is first loaded, and then the domestic operating system loader is loaded using the Linux operating system embedded in the UEFI, thereby realizing the startup of different computer operating systems. Figure 2 As shown, it is a flow chart of the method for users to dynamically select the traditional UEFI boot method or the domestic operating system boot method of UEFI and Linux in the present invention.

[0061] The present invention rewrites the device driver by embedding the Linux operating system in UEFI, enhances fault tolerance and recovery, and strengthens the robustness of the device driver. And uses the file system module of Linux to expand the support of boot devices and file systems. For example, reading and writing the EXT4 file system. At the same time, due to the open source and wide application of the Linux operating system, the number of developers and researchers familiar with Linux is much larger than that of UEFI, which also reduces the development threshold and is conducive to the development of the entire industry.

[0062] According to the above-mentioned method for starting a domestic operating system based on UEFI and Linux, the present invention also provides a device for starting a domestic operating system based on UEFI and Linux, such as Figure 1 The figure shows a schematic diagram of the framework of a domestic operating system startup device based on UEFI and Linux of the present invention.

[0063] The domestic operating system startup device of the present invention embeds a Linux module in UEFI, and the Linux module includes a domestic processor adapter component unit and a kexec kernel boot tool unit;

[0064] When starting the domestic operating system, first load and run the Linux module, and then use the Linux module to load the domestic operating system adapter component, so as to realize the startup of different domestic operating systems.

[0065] like Figure 1 As shown, the domestic operating system startup device of the present invention also includes a startup mode processing module for implementing Figure 2 The user shown dynamically selects the traditional UEFI boot method or the domestic operating system boot method of UEFI and Linux.

[0066] The steps of starting the domestic operating system using the domestic operating system starting device of the present invention are the same as those in the above-mentioned domestic operating system starting method, and will not be repeated here.

[0067] The domestic operating system startup method and device provided by the present invention have made a fundamental change to the way UEFI boots the operating system, adding a Linux boot module in UEFI, which includes a Linux boot DXE driver and a Linux kernel image, and switching from booting the operating system by UEFI to booting the operating system by using the Linux module embedded in UEFI. The startup method is more flexible.

[0068] And support domestic processors. Add domestic processor adapter components to the Linux kernel module, currently can support Feiteng processor platforms such as Feiteng 2004, Feiteng D2000, Feiteng 2000PLUS, Tengyun S2500, etc.

[0069] It also supports domestic operating systems. The kernel boot component is added to the Linux kernel, so that it can boot operating system software including Kylin OS and Tongxin's UOS.

[0070] It also supports the EXT file system (Extended File System). The original UEFI only supports the reading and writing of the FAT (File Allocation Table) file system to the boot device. Using the EXT file system module of the Linux kernel, UEFI can be extended to the EXT series of file systems including EXT2, EXT3, EXT4, etc., and its support for boot devices will be richer.

[0071] And it is more secure. The Linux operating system will perform more stringent checks on device drivers and file systems, and has stronger fault tolerance and recovery capabilities.

[0072] The above specific embodiments only describe the design principle of the present invention. The shapes and names of the components in the description may be different and are not limited. Therefore, those skilled in the art in the field of the present invention may modify or replace the technical solutions recorded in the above embodiments; and these modifications and replacements do not deviate from the creative purpose and technical solutions of the present invention.

Claims

1. A method for starting a domestic operating system based on UEFI and Linux, characterized in that: Embed the Linux operating system in the unified extensible firmware interface UEFI, and add a processor adapter component and a kernel boot component to the Linux operating system; In the process of booting the domestic operating system, there is no need to execute the UEFI jump driver execution environment DXE stage; When the UEFI jump boot device selects the BDS stage, the Linux operating system is first loaded, and then the domestic operating system loader is loaded using the Linux operating system, thereby realizing the startup of different domestic operating systems; The steps to start the domestic operating system include: Step 1: The UEFI security SEC phase starts, and CPU interrupt exception initialization and temporary memory initialization are performed; Step 2: UEFI jumps to the early initialization PEI stage to complete CPU initialization, memory initialization, and motherboard initialization; Step 3. Select and confirm whether the boot mode is the traditional boot mode or the embedded Linux boot mode. If it is the traditional boot mode, go to step 4, otherwise go to step 5; Step 4: Jump to the driver execution environment DXE stage to complete the initialization of peripherals including PCI, USB, and graphics card; Step 5. UEFI jumps to the BDS boot device selection stage. If it is a traditional boot, select the boot device, otherwise load the Linux operating system. If the Linux operating system fails to load, it will report an error and jump to BDS to load the Linux operating system again until it is loaded successfully; Step 6. UEFI jumps to the temporary system loading TSL stage, loads the domestic operating system loader from the selected boot device or Linux operating system and runs it; Step 7. UEFI jumps to the RT stage and loads the domestic operating system to run.

2. The method for starting a domestic operating system as claimed in claim 1, characterized in that: The Linux operating system also includes a Linux kernel and an Initramfs root file system; the processor adapter component and the kernel boot component are loaded into the Linux kernel.

3. The method for starting a domestic operating system as claimed in claim 1, characterized in that: In step seven, if a hardware or software catastrophic error occurs during the operation of the domestic operating system, the process jumps to the disaster recovery AL stage for disaster recovery processing.

4. The method for starting a domestic operating system as described in any one of claims 1 to 3, characterized in that: The domestic operating systems supported by the domestic operating system startup method include: Feiteng 2004 system, Feiteng D2000 system, Feiteng 2000PLUS system, Tengyun S2500 system, Kylin OS and UOS system.

5. A domestic operating system boot device based on UEFI and Linux, characterized in that: Embed a Linux module in UEFI, wherein the Linux module includes a domestic processor adaptation component unit and a kexec kernel boot tool unit; In the process of booting the domestic operating system, there is no need to execute the UEFI jump driver execution environment DXE stage; When the UEFI jump boot device selects the BDS stage, the Linux operating system is first loaded, and then the domestic operating system loader is loaded using the Linux operating system, thereby realizing the startup of different domestic operating systems; The steps of starting the domestic operating system using the domestic operating system starting device include: Step 1: The UEFI security SEC phase starts, and CPU interrupt exception initialization and temporary memory initialization are performed; Step 2: UEFI jumps to the early initialization PEI stage to complete CPU initialization, memory initialization, and motherboard initialization; Step 3. Select and confirm whether the boot mode is the traditional boot mode or the embedded Linux boot mode. If it is the traditional boot mode, go to step 4, otherwise go to step 5; Step 4: Jump to the driver execution environment DXE stage to complete the initialization of peripherals including PCI, USB, and graphics card; Step 5. UEFI jumps to the BDS boot device selection stage. If it is a traditional boot, select the boot device, otherwise load the Linux operating system. If the Linux operating system fails to load, it will report an error and jump to BDS to load the Linux operating system again until it is loaded successfully; Step 6. UEFI jumps to the temporary system loading TSL stage, loads the domestic operating system loader from the selected boot device or Linux operating system and runs it; Step 7. UEFI jumps to the RT stage and loads the domestic operating system to run.

6. The domestic operating system startup device as claimed in claim 5, characterized in that: The Linux module also includes a Linux kernel unit and an Initramfs root file unit.

7. The domestic operating system startup device as claimed in claim 5, characterized in that: In step five, if a hardware or software catastrophic error occurs during the operation of the domestic operating system, the process jumps to the disaster recovery AL stage for disaster recovery processing.

8. The domestic operating system startup device as described in any one of claims 5-7, characterized in that: The domestic operating systems supported by the domestic operating system startup device include: Feiteng 2004 system, Feiteng D2000 system, Feiteng 2000PLUS system, Tengyun S2500 system, Kylin OS and UOS system.