CN117075973A - Novel Linux boot starting and guiding method and system based on RISC-V server CPU - Google Patents

Novel Linux boot starting and guiding method and system based on RISC-V server CPU Download PDF

Info

Publication number
CN117075973A
CN117075973A CN202310948503.0A CN202310948503A CN117075973A CN 117075973 A CN117075973 A CN 117075973A CN 202310948503 A CN202310948503 A CN 202310948503A CN 117075973 A CN117075973 A CN 117075973A
Authority
CN
China
Prior art keywords
linux
kernel
boot
starting
loads
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
CN202310948503.0A
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.)
Shandong University
Original Assignee
Shandong University
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 Shandong University filed Critical Shandong University
Priority to CN202310948503.0A priority Critical patent/CN117075973A/en
Publication of CN117075973A publication Critical patent/CN117075973A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a novel Linux boot starting and guiding method and system based on a RISC-V server CPU, comprising the following steps: ZSBL is first executed, loaded and jumped to FSBL. Then, the FSBL loads DTB, openSBI and LinuxBoot into the memory; the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel; the LinuxBoot kernel loads u-root as initrimfs; the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started. The invention improves the efficiency and the flexibility of system starting; the quick, reliable and flexible starting of the server system is realized.

Description

Novel Linux boot starting and guiding method and system based on RISC-V server CPU
Technical Field
The invention relates to the field of computers, in particular to a novel LinuxBoot boot method and system based on a RISC-V server CPU.
Background
UEFI is a firmware interface standard that replaces the conventional BIOS (basic input/output system) for initializing hardware and booting an operating system. UEFI provides an extensible firmware environment with greater functionality and flexibility. It supports the loading and execution of multiple operating systems, drivers, and applications. The UEFI boot program is responsible for initializing system hardware, loading operating system images and device drivers, and initiating the execution of the operating system.
The LinuxBoot is an open source item, and aims to replace traditional firmware (such as BIOS and UEFI) with a Linux kernel to serve as a start-up guide of a system. The method adopts the Linux kernel as a guide environment, and realizes faster, reliable and flexible system start by loading the Linux kernel and the user space tool set in the guide process. The LinuxBoot provides a lightweight, highly flexible boot solution by simplifying the boot process and reducing complex boot layers.
In modern computer systems, the boot process is one of the key steps in operating system startup. Conventional boot processes rely on complex boot layers and conventional BIOS/UEFI, which may introduce additional complexity and instability in some cases. Along with the wider application of RISC-V architecture in the field of servers, the demand for a faster, reliable and flexible LinuxBoot boot method is also becoming urgent.
Disclosure of Invention
Aiming at the dependence on a complex guide layer and the traditional BIOS/UEFI in the existing starting process and the requirement in the application of a RISC-V server CPU, the invention provides a novel LinuxBoot starting and guiding method based on the RISC-V server CPU. The method realizes faster, reliable and flexible Linux kernel starting by simplifying the starting process and reducing the dependence on the traditional BIOS/UEFI.
The invention also provides a novel LinuxBoot starting and guiding system based on the RISC-V server CPU.
Term interpretation:
1. RISC-V: RISC-V is an open-source instruction set architecture that employs the concepts of reduced instruction sets, modular design, and scalability. This allows the RISC-V processor to be simple in design, low in cost, and flexible in extension as desired. RISC-V has full platform support, is widely applied to various fields, and is continuously developed in an open ecosystem.
2. OpenSBI: openSBI is an open source, standardized binary interface of a hypervisor, aims at simplifying the development and the transplantation of RISC-V system software, and provides a universal basis, a standard interface and expandability so as to promote the development and innovation of a RISC-V ecological system.
3. EXT4 File System: the EXT4 file system is a high-performance and high-reliability Linux file system, and meets the requirements of the file system in the modern computing environment by increasing the capacity of the file system, improving the performance and introducing more powerful functions.
4. EXT4 file system driver: the EXT4 file system driver is a module in the Linux operating system and is used for interacting and managing with the EXT4 file system. It provides functions of creating, reading, writing, deleting and modifying files, directories and file attributes, and provides consistency protection and hard disk space management.
5. Hart (hardware thread): in RISC-V, hart refers to a processor core that can execute an instruction stream. Each Hart has a unique identifier, called the Hart ID. Initializing Hart involves setting an initial state, configuring registers, and initiating execution of an instruction stream.
6. Console (Console): console is a standard input output device of the system for interacting with a user and displaying debug information. Initializing Console involves configuring the input and output interfaces and ensuring the correct input and output channels.
7. PMU (Performance Monitoring Unit, hardware performance monitoring unit): PMU is a hardware component used to monitor and record performance data of the system, such as instruction execution times, cache hit rates, etc. Initializing a PMU involves configuring counters and event selections for performance analysis and optimization.
8. IRQ (Interrupt Request ): an IRQ refers to an interrupt request that informs the processor that some external event has occurred, such as a device input or a clock interrupt. Initializing the IRQ involves configuring the interrupt controller and interrupt handlers to ensure that the system is able to respond and handle interrupt requests in good time.
9. IPI (Inter-Processor Interrupt, inter-core interrupt): IPI refers to an inter-processor interrupt for communication and collaboration between processors. Initializing IPI involves configuring the IPI controller and processing the IPI's interrupt handlers to enable synchronization and data sharing between processors.
10. TLB (Translation Lookaside Buffer, address translation lookaside buffer): a TLB is a hardware cache that stores virtual to physical address translation mappings. Initializing a TLB involves configuring and populating TLB entries to ensure proper address translation and memory access rights.
11. Timer (Timer): timer is a Timer device in the system that provides a time reference and timing function. Initializing Timer involves configuring the frequency and mode of the Timer and setting interrupts to implement the Timer interrupt function.
12. ecll (Environment Call, system Call): ecall is a special machine instruction for requesting services provided by the operating system from a user mode program. Initializing an ecall involves setting up an ecall handler and system call interface so that a user program can interact with the operating system through ecall instructions.
13. Domain: domain refers to the privilege level and privilege Domain of a processor to isolate and protect different software entities. Initializing Domain involves configuring the privilege level and privilege mode of the processor to ensure proper privilege switching and access control.
14. PMP (Physical Memory Protection ): PMP is a hardware mechanism for protecting access rights of physical memory. Initializing PMP involves setting PMP registers and rules to ensure proper protection and access restriction to memory regions.
15. The platform is finally initialized: this refers to the last initialization process performed after the initialization of the hardware device is completed. This may involve initializing other platform-specific devices, configuring system startup options, loading an operating system or application programs, etc.
The technical scheme adopted by the invention is as follows:
a novel LinuxBoot starting and guiding method based on a RISC-V server CPU comprises the following steps:
after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
the LinuxBoot kernel loads u-root as initrimfs;
the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
According to the invention, preferably, ZSBL is firstly executed, and is responsible for loading and jumping to FSBL; then, the FSBL loads the DTB, the OpenSBI and the LinuxBoot into the memory, including:
a ZSBL initialization processor's basic environment comprising: setting a register, an interrupt vector table and an initialization memory;
ZSBL loads and jumps to FSBL, and the FSBL loads DTB, openSBI and LinuxBoot into the memory from the storage medium;
the FSBL initializes the memory controller, the peripheral controller and the clock controller, sets a memory mapping table, and is also responsible for loading and executing a boot loader of the next stage from the storage medium.
According to the invention, the OpenSBI performs first the underlying initialization, then the platform early initialization, the related hardware device initialization, including Hart, console, PMU, IRQ, IPI, TLB, timer, ecall, domain, PMP, and the platform final initialization.
According to the preferred embodiment of the invention, the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so as to start the Linux kernel, including:
the Linux boot kernel loads a real Linux kernel image and a device tree, and performs hardware initialization and configuration according to description information of the device tree, wherein the description object comprises: the system comprises a processor, a memory, a bus, a clock, an interrupt controller, a timer, a serial port, power management, storage equipment and a connection relation among the controller, input/output equipment, interrupt mapping and equipment nodes;
the Linux boot kernel transfers control to the Linux kernel, thereby starting the complete environment of the operating system.
According to the invention, preferably, the DTB, the OpenSBI and the LinuxBoot are loaded into the memory through the FSBL, and then the method further comprises the following steps:
the FSBL is responsible for building a memory map, initializing a portion of CPU functions, and then transferring control to OpenSBI via a jump instruction.
According to the invention, the LinuxBoot kernel loads u-root as initrimfs, and then further comprises:
the u-root uses the EXT4 file system drive to initialize and manage the EXT4 file system, including operations of creating partitions, formatting, mounting, unloading files and catalog management, checking and repairing the file system and configuring parameters of the file system;
the u-root searches and analyzes a starting configuration file of the Linux kernel in the EXT4 file system, wherein the configuration file comprises a plurality of starting options, each starting option is a row of commands, and the commands comprise paths and starting parameters of the Linux kernel.
According to the preferred embodiment of the invention, the Linux boot kernel loads a real Linux kernel image and a device tree, sets hardware configuration and parameters, and further comprises:
the method comprises the steps that a Linux boot kernel loads a real Linux kernel image into a memory, and necessary starting parameters are set for the Linux kernel according to the attribute 'bootars' in a device tree;
the Linux boot kernel uses kexec command to run a new kernel and transfers control right to the real Linux kernel, thereby starting the complete function of the Linux operating system.
A computer device comprising a memory and a processor, said memory storing a computer program, said processor implementing the steps of a novel linux boot method based on a RISC-V server CPU when executing said computer program.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a novel linux boot method based on a RISC-V server CPU.
A novel LinuxBoot starting and guiding system based on a RISC-V server CPU comprises:
a first loading module configured to: after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
a critical component initialization module configured to: the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
a second loading module configured to: the LinuxBoot kernel loads u-root as initrimfs;
a third loading module configured to: the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
The invention has the beneficial effects that:
1. by optimizing the starting flow and reducing unnecessary links, the invention can realize faster system starting, reduce starting time and improve user experience and production efficiency. The LinuxBoot boot method can complete the server boot in 20 seconds, while the UEFI takes several minutes.
2. The invention can ensure the stability and reliability of the system by introducing reliable starting components and frameworks such as OpenSBI and LinuxBoot. Meanwhile, the device tree is used for describing the system hardware configuration and the device driving relation, so that the hardware compatibility problem can be reduced, and the compatibility and stability of the system are improved.
3. The present invention provides flexible file system initialization and management capabilities by using u-root as initrimfs. The u-root can perform operations such as initializing, formatting, mounting and unloading of the EXT4 partition file system, and meanwhile, the starting configuration file of the Linux kernels is analyzed, so that a system administrator can flexibly configure and manage starting parameters and paths of a plurality of Linux kernels.
4. The invention improves the efficiency and the flexibility of system starting by simplifying the starting process, reducing the dependence on the traditional BIOS/UEFI. The invention can be applied to the server field of RISC-V architecture, and provides a beneficial technical solution for quick, reliable and flexible starting of a server system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a LinuxBoot boot method based on a RISC-V server CPU.
FIG. 2 is a sample diagram of a startup profile.
Detailed Description
The invention is further defined by, but is not limited to, the following drawings and examples in conjunction with the specification. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Example 1
A novel LinuxBoot starting and guiding method based on a RISC-V server CPU is shown in figure 1, and comprises the following steps:
s110: after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
s120: the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
s130: the LinuxBoot kernel loads u-root as initrimfs;
s140: the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
Example 2
The novel linux boot method based on the RISC-V server CPU according to embodiment 1 is different in that:
in this embodiment, an SG2042 EVB-based development board designed by beijing computing corporation is taken as an example;
after the SG2042 EVB development board is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads the DTB, the OpenSBI and the LinuxBoot into the memory, including:
ZSBL is the zeroth stage of the starting of the CPU system of RISC-V server, it is the Boot firmware (Boot ROM) solidified in the processor, locate at the reset vector address of the processor;
a ZSBL initialization processor's basic environment comprising: setting a register, an interrupt vector table and an initialization memory;
ZSBL loads and jumps to FSBL, and the FSBL loads DTB, openSBI and LinuxBoot into the memory from a storage medium (such as a flash memory, a hard disk and the like);
ZSBL is a key component in the RISC-V start-up process. It is a simple firmware program located at the processor reset vector address responsible for initializing the processor and peripherals and loading the more complex boot loader. The main task of ZSBL is to build a basic hardware environment, including setting registers, interrupt vector table, and initialization memory, etc. ZSBL typically runs during the initial phase of the boot process and then gives care-of control to higher level bootloaders, which can further load the operating system or other applications.
FSBL is the second phase of the bootloader, also known as the master bootloader. It is typically located in a non-volatile memory (e.g., flash memory), loaded and executed by the ZSBL. The main task of FSBL is to accomplish more complex system initialization and configuration. The FSBL initializes the memory controller, peripheral controller, clock controller, and sets the memory map so that the operating system or firmware can properly access and manage the system resources. The FSBL is also responsible for loading and executing the boot loader of the next phase from the storage medium.
DTB is a data structure that describes computer hardware device information. In RISC-V server systems, DTB is used to provide hardware configuration information to the operating system. ZSBL loads DTB files to specific addresses in memory so that subsequent software components can read and parse the device information in DTB.
The OpenSBI first performs the underlying initialization, then performs the platform early initialization, related hardware device initialization, including Hart, console, PMU, IRQ, IPI, TLB, timer, ecall, domain, PMP, and the platform final initialization. Once these component initializations are completed, the OpenSBI will jump to the LinuxBoot kernel, giving control to the latter, thus continuing the startup process of the system. This process ensures that the hardware and basic operating environment are properly initialized, ready for subsequent operating system boots.
During the starting process of the SG2042 EVB development board, the FSBL and OpenSBI function as the SEC and PEI phases of the UEFI, and the minimum necessary hardware initialization is carried out, and the latter hardware initialization is finished by virtue of the drive of the Linux kernel.
The LinuxBoot kernel loads u-root as initrimfs; specifically, openSBI runs out and transfers control to the LinuxBoot kernel, which can replace a specific UEFI function with a Linux kernel function, and then starts the actual production kernel on the computer. The Linux boot-specific kernel configuration file provides the required Linux kernel functions without expanding the size of the BIOS due to unnecessary drivers. The LinuxBoot loads u-root as initrimfs, which will become the user space of the LinuxBoot. u-root provides various commands and tools for performing various tasks during startup. It may be used to load and configure device drivers, mount file systems, execute system initialization scripts, and the like. When the LinuxBoot kernel completes all necessary initialization and configuration tasks, it will transfer control to the first process in the root file system, typically the init process. This process will continue the system startup process, load the kernel components of the operating system, and start the complete environment of the user space.
When Linux boots it requires a root file system that provides the boot and startup utilities. u-root is one such file system written in Go language, and u-root is a user space environment that can provide a basic library and utility that work in Linux environment. The LinuxBoot uses the u-root to create an initrimfs for this purpose. initrimfs is the root file system embedded in the firmware image itself. It is intended to be placed in a flash device with the Linux kernel as part of the Linux boot firmware image. u-root is a Go user space. It contains a toolset of standard Linux applications and commands. u-root can create initrimfs in two different modes: a source mode comprising: go tool chain binary, a simple shell, go source code through shell dynamic compilation tools; busybox (bb) mode: this is a busy-box-like binary file containing all requested utilities.
The Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started, and the method comprises the following steps:
the Linux boot kernel loads a real Linux kernel image and a device tree, and performs hardware initialization and configuration according to description information of the device tree, wherein the description object comprises: the system comprises a processor, a memory, a bus, a clock, an interrupt controller, a timer, a serial port, power management, storage equipment and a connection relation among the controller, input/output equipment, interrupt mapping and equipment nodes;
the Linux boot kernel transfers control to the Linux kernel, thereby starting the complete environment of the operating system. This process ensures proper interaction and configuration between the Linux kernel and hardware, providing the necessary basis for proper operation of the operating system.
The practical comparison shows that: by adopting the traditional starting mode, the time consumption of the SG2042 EVB development board from the system power-up to the operating system login interface is about 105s, and by adopting the scheme of the invention, the time consumption of the SG2042 EVB development board from the system power-up to the operating system login interface is about 50 s.
Example 3
The novel LinuxBoot boot method based on the RISC-V server CPU according to embodiment 1 or 2 is different in that:
the DTB, openSBI and LinuxBoot are loaded into the memory through the FSBL, and then the method further comprises the following steps:
the FSBL is responsible for building a memory map, initializing a portion of CPU functions, and then transferring control to OpenSBI via a jump instruction.
The Linux boot kernel loads u-root as initrimfs, supports a driver of the EXT4 file system, supports larger file size and partition capacity by EXT4 partitions, and provides flexible initialization and management capability of the file system. The existing SG2042 EVB development board uses UEFI implemented by the open source framework EDK2 in the starting process, does not support a driver of the EXT4 file system, and needs to boot the GRUB to support the EXT4 file system, which increases the starting time undoubtedly. Meanwhile, the UEFI guides the GRUB in the FAT file system, so that the driver of the SD card is needed to be realized in the UEFI, and the SD card driver supported by the Linux kernel can be reused. And then further comprises:
the u-root uses the EXT4 file system drive to initialize and manage the EXT4 file system, including operations of creating partitions, formatting, mounting, unloading files and catalog management, checking and repairing the file system and configuring parameters of the file system;
the u-root searches and analyzes a starting configuration file of the Linux kernel in the EXT4 file system, wherein the configuration file comprises a plurality of starting options, each starting option is a row of commands, and the commands comprise paths and starting parameters of the Linux kernel. To ensure that the Linux operating system is properly booted.
Specifically, fig. 2 is a sample of a startup profile. The starting configuration file of fig. 2 contains a plurality of kernel versions of the operating system, and can also include starting configuration information of a plurality of platforms, so that the service efficiency of the server is improved.
The Linux boot kernel loads a real Linux kernel image and a device tree, sets hardware configuration and parameters, and further comprises:
the method comprises the steps that a Linux boot kernel loads a real Linux kernel image into a memory, and necessary starting parameters are set for the Linux kernel according to the attribute 'bootars' in a device tree;
the Linux boot kernel uses kexec command to run a new kernel and transfers control right to the real Linux kernel, thereby starting the complete function of the Linux operating system.
Specifically, in the starting process of the existing SG2042 EVB development board, the linux boot will default to select the first starting option of the starting configuration file, and obtain the target position and the kernel starting parameter of the starting file (initrd. Img file and vmlinuz file).
The invention provides a novel Linux boot starting and guiding method based on a RISC-V server CPU, which can provide an efficient and reliable server CPU starting process, ensure the correct initialization and configuration of key components such as a processor, a memory, equipment and the like, and realize the reliable starting of a Linux operating system. The method can reduce the dependence on the traditional BIOS or UEFI firmware, provides a more flexible and customizable booting mode, and is suitable for a server CPU of a RISC-V architecture.
Example 4
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the novel linux boot method based on a RISC-V server CPU of any of embodiments 1-3 when executing the computer program.
Example 5
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the novel linux boot method of any of embodiments 1-3 based on a RISC-V server CPU.
Example 6
A novel LinuxBoot starting and guiding system based on a RISC-V server CPU comprises:
a first loading module configured to: after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
a critical component initialization module configured to: the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
a second loading module configured to: the LinuxBoot kernel loads u-root as initrimfs;
a third loading module configured to: the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (10)

1. The novel Linux boot starting and guiding method based on the RISC-V server CPU is characterized by comprising the following steps:
after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
the LinuxBoot kernel loads u-root as initrimfs;
the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
2. The novel linux boot method based on a RISC-V server CPU according to claim 1, wherein ZSBL is executed first, and is responsible for loading and jumping to FSBL; then, the FSBL loads the DTB, the OpenSBI and the LinuxBoot into the memory, including:
a ZSBL initialization processor's basic environment comprising: setting a register, an interrupt vector table and an initialization memory;
ZSBL loads and jumps to FSBL, and the FSBL loads DTB, openSBI and LinuxBoot into the memory from the storage medium;
the FSBL initializes the memory controller, the peripheral controller and the clock controller, sets a memory mapping table, and is also responsible for loading and executing a boot loader of the next stage from the storage medium.
3. The novel linux boot method based on the RISC-V server CPU of claim 1, wherein OpenSBI first performs a bottom layer initialization, then performs a platform early stage initialization, related hardware device initialization, including Hart, console, PMU, IRQ, IPI, TLB, timer, ecall, domain, PMP, and a platform final initialization.
4. The novel Linux boot method based on the RISC-V server CPU according to claim 1, wherein the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, thereby starting the Linux kernel, comprising:
the Linux boot kernel loads a real Linux kernel image and a device tree, and performs hardware initialization and configuration according to description information of the device tree, wherein the description object comprises: the system comprises a processor, a memory, a bus, a clock, an interrupt controller, a timer, a serial port, power management, storage equipment and a connection relation among the controller, input/output equipment, interrupt mapping and equipment nodes;
the Linux boot kernel transfers control to the Linux kernel, thereby starting the complete environment of the operating system.
5. The novel linux boot method based on the RISC-V server CPU according to claim 1, wherein DTB, openSBI and linux boot are loaded into a memory through FSBL, and further comprising:
the FSBL is responsible for building a memory map, initializing a portion of CPU functions, and then transferring control to OpenSBI via a jump instruction.
6. The novel linux boot method based on the RISC-V server CPU according to claim 1, wherein the linux boot kernel loads u-root as initrimfs, and further comprising:
the u-root uses the EXT4 file system drive to initialize and manage the EXT4 file system, including operations of creating partitions, formatting, mounting, unloading files and catalog management, checking and repairing the file system and configuring parameters of the file system;
the u-root searches and analyzes a starting configuration file of the Linux kernel in the EXT4 file system, wherein the configuration file comprises a plurality of starting options, each starting option is a row of commands, and the commands comprise paths and starting parameters of the Linux kernel.
7. The method for starting and guiding a novel Linux boot based on a RISC-V server CPU according to any one of claims 1 to 6, wherein a Linux kernel loads a real Linux kernel image and a device tree, sets hardware configuration and parameters, and further comprises:
the method comprises the steps that a Linux boot kernel loads a real Linux kernel image into a memory, and necessary starting parameters are set for the Linux kernel according to the attribute 'bootars' in a device tree;
the Linux boot kernel uses kexec command to run a new kernel and transfers control right to the real Linux kernel, thereby starting the complete function of the Linux operating system.
8. A computer device comprising a memory and a processor, said memory storing a computer program, characterized in that said processor, when executing said computer program, implements the steps of the novel linux boot initiation boot method based on a RISC-V server CPU according to any of claims 1-7.
9. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the novel linux boot initiation method based on a RISC-V server CPU of any of claims 1-7.
10. The novel LinuxBoot starting and guiding system based on the RISC-V server CPU is characterized by comprising the following components:
a first loading module configured to: after the CPU of the server is electrified, ZSBL is firstly executed, and the ZSBL is responsible for loading and jumping to FSBL; then, the FSBL loads DTB, openSBI and LinuxBoot into the memory;
a critical component initialization module configured to: the OpenSBI firstly executes bottom layer initialization, then executes early stage initialization of a platform, initializes related hardware equipment, finally initializes the platform, and finally executes second-stage boot jump to a LinuxBoot kernel;
a second loading module configured to: the LinuxBoot kernel loads u-root as initrimfs;
a third loading module configured to: the Linux boot kernel loads a real Linux kernel image and a device tree, and sets hardware configuration and parameters, so that the Linux kernel is started.
CN202310948503.0A 2023-07-31 2023-07-31 Novel Linux boot starting and guiding method and system based on RISC-V server CPU Pending CN117075973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310948503.0A CN117075973A (en) 2023-07-31 2023-07-31 Novel Linux boot starting and guiding method and system based on RISC-V server CPU

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310948503.0A CN117075973A (en) 2023-07-31 2023-07-31 Novel Linux boot starting and guiding method and system based on RISC-V server CPU

Publications (1)

Publication Number Publication Date
CN117075973A true CN117075973A (en) 2023-11-17

Family

ID=88716220

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310948503.0A Pending CN117075973A (en) 2023-07-31 2023-07-31 Novel Linux boot starting and guiding method and system based on RISC-V server CPU

Country Status (1)

Country Link
CN (1) CN117075973A (en)

Similar Documents

Publication Publication Date Title
US7134007B2 (en) Method for sharing firmware across heterogeneous processor architectures
CN109478135B (en) Computer system and method for rebooting a computer system
US9483639B2 (en) Service partition virtualization system and method having a secure application
US8407396B2 (en) Providing block data access for an operating system using solid-state memory
US8533735B2 (en) System for execution context isolation in response to invoking a BIOS kernel function during a driver execution environment (DXE) phase of boot-up of a computer
US10007546B2 (en) Operating-system exchanges using memory-pointer transfers
US9304794B2 (en) Virtual machine control method and virtual machine system using prefetch information
US7434224B2 (en) Plural operating systems having interrupts for all operating systems processed by the highest priority operating system
JP2011100431A (en) Device and method for controlling virtual machine
US10725770B2 (en) Hot-swapping operating systems using inter-partition application migration
US7454547B1 (en) Data exchange between a runtime environment and a computer firmware in a multi-processor computing system
US20150261952A1 (en) Service partition virtualization system and method having a secure platform
US20090265708A1 (en) Information Processing Apparatus and Method of Controlling Information Processing Apparatus
US20160239321A1 (en) Supporting multiple operating system environments in computing device without contents conversion
US10983847B2 (en) Dynamically loadable unikernel binaries
US10620963B2 (en) Providing fallback drivers for IO devices in a computing system
US10853259B2 (en) Exitless extended page table switching for nested hypervisors
US7111200B2 (en) Apparatus and method for debugging a logical partition
US7484083B1 (en) Method, apparatus, and computer-readable medium for utilizing BIOS boot specification compliant devices within an extensible firmware interface environment
CN111782335A (en) Extended application mechanism through in-process operating system
US20160077847A1 (en) Synchronization of physical functions and virtual functions within a fabric
US8713545B2 (en) Architecture for accelerated computer processing
CN117075973A (en) Novel Linux boot starting and guiding method and system based on RISC-V server CPU
Banik et al. Understanding the BIOS and Minimalistic Design
US8555046B2 (en) Computer system and its HW abstraction method

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