Extensible operating system for RISC-V architecture extended instruction set

The extensible operating system for RISC-V architecture addresses the challenge of managing numerous instruction sets by categorizing software components, enhancing performance with vector extensions and security with scalar encryption, thus optimizing system capabilities.

CN118689471BActive Publication Date: 2024-12-03INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411164761.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-03
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

Existing operating systems for RISC-V architecture struggle to manage and utilize the large number of standard and non-standard extended instruction sets, leading to inefficiencies and increased development workload for users, while missing opportunities for performance and security enhancements.

Method used

An extensible operating system architecture that divides software components into two parts: those unrelated and related to RISC-V extended instruction sets, supporting all instruction sets at each layer, including hardware, kernel, library, and application layers, with specific support for RISC-V vector and scalar encryption extensions.

Benefits of technology

Enables efficient management and utilization of RISC-V extended instruction sets, improving performance through vector extensions and security through scalar encryption, while reducing user development burden and enhancing system capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689471B_ABST
    Figure CN118689471B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of computer software, and provides an extensible operating system for RISC-V architecture extended instruction sets, wherein a general RISC-V processor at a hardware layer comprises a basic instruction set and some standard extended instruction sets, and a diversified RISC-V processor comprises other standard and non-standard extended instruction sets in addition to the instruction sets contained in the general processor; a general operating system kernel at an operating system kernel layer does not support some specific extended instruction sets, and a specific operating system kernel supports some specific extended instruction sets; a basic model at a library layer comprises a library that is not related to the extended instruction set, and an extensible model comprises a library that is not related to the extended instruction set and a library that is related to the extended instruction set; a basic model at an application layer comprises an application that is not related to the extended instruction set, and an extensible model comprises an application that is not related to the extended instruction set and an application that is related to the extended instruction set, and there is no need to leave support for the extended instruction set to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software technology, and in particular to an extensible operating system for a RISC-V architecture extended instruction set. Background Art

[0002] In recent years, the RISC-V architecture has attracted widespread attention in academia and industry. Unlike the x86 and ARM architectures, which only contain a small number of extended instruction sets, the RISC-V architecture contains a large number of standard extended instruction sets and non-standard extended instruction sets, and the number of these standard and non-standard extended instruction sets is increasing. These extended instruction sets involve multiple software components at each layer of the layered architecture of the entire operating system, such as different kernel modules at the kernel layer of the operating system, different basic libraries and application libraries at the library layer, and various applications at the application layer that use different RISC-V extended instruction sets. With the increasing number of RISC-V extended instruction sets, the operating system needs to be able to manage and use these extended instruction sets more reasonably.

[0003] The existing operating system layered architecture design is mainly designed for the x86 and ARM architectures with fewer extended instruction sets. The distribution versions of these operating systems only support RV64GC by default, and give up support for other standard and non-standard RISC-V extended instruction sets, thus leaving support for other standard and non-standard RISC-V extended instruction sets to users who use these extended instruction sets. Summary of the invention

[0004] The present invention provides an extensible operating system for a RISC-V architecture extended instruction set, so as to solve the defects existing in the prior art.

[0005] The present invention provides an extensible operating system for a RISC-V architecture extended instruction set, comprising:

[0006] Hardware layer, operating system kernel layer, library layer, and application layer;

[0007] The hardware layer includes a general RISC-V processor and a diversified RISC-V processor, wherein the general RISC-V processor includes a RISC-V basic instruction set and part of a standard extended instruction set, and the diversified RISC-V processor includes the instruction set of the general RISC-V processor and other RISC-V standards and RISC-V non-standard extended instruction sets;

[0008] The operating system kernel layer includes a general operating system kernel and a specific operating system kernel, the general operating system kernel does not support a part of the specific RISC-V extended instruction set, and the specific operating system kernel supports the part of the specific RISC-V extended instruction set;

[0009] The basic model of the library layer includes libraries unrelated to the RISC-V extended instruction set, and the extensible model of the library layer includes libraries unrelated to the RISC-V extended instruction set and libraries related to the RISC-V extended instruction set;

[0010] The basic model of the application layer includes applications that are not related to the RISC-V extended instruction set, and the extensible model of the application layer includes applications that are not related to the RISC-V extended instruction set and applications that are related to the RISC-V extended instruction set.

[0011] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, the general RISC-V processor is used to execute operating system kernel components, libraries and applications related to the RISC-V basic instruction set and some standard extended instruction sets, and the diversified RISC-V processor is used to execute operating system kernel components, libraries and applications that can be executed by the general RISC-V processor, as well as to execute operating system kernel components, libraries and applications related to other RISC-V standards and RISC-V non-standard extended instruction sets.

[0012] According to the present invention, an extensible operating system for a RISC-V architecture extended instruction set is provided. The RISC-V standard extended instruction set includes a RISC-V vector extended instruction set and a RISC-V scalar encryption extended instruction set. The RISC-V vector extended instruction set is used to write assembly codes for target functions in a core basic library and an application library, and the RISC-V scalar encryption extended instruction set is used to write assembly codes for encryption and decryption algorithms in a secure socket layer cryptographic library.

[0013] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, the extensible operating system runs on a RISC-V processor supporting vector extensions, and the original core base library of the extensible operating system is replaced with a core base library enhanced by vector extensions, and the original application library is replaced with an application library enhanced by vector extensions, the core base library and application library enhanced by vector extensions are implemented based on the RISC-V vector extension instruction set, and are constructed using a compilation tool chain supporting vector extensions.

[0014] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, the RISC-V processor supporting vector extension is used to run an operating system that supports a core basic library and an application library enhanced by vector extension.

[0015] According to the present invention, an extensible operating system for a RISC-V architecture extended instruction set is provided, the extensible operating system supports a secure socket layer cryptographic library enhanced by a scalar encryption extension, the secure socket layer cryptographic library enhanced by the scalar encryption extension is implemented based on the RISC-V scalar encryption extension instruction set, and is constructed based on a compilation tool chain supporting the scalar encryption extension.

[0016] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, a RISC-V processor supporting scalar cryptographic extensions is used to execute an operating system including a secure socket layer cryptographic library enhanced by the scalar cryptographic extensions.

[0017] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, the number of combinations between the RISC-V extended instruction sets is determined based on a directed acyclic graph, and the directed acyclic graph is constructed based on the dependency relationship between the RISC-V extended instruction sets.

[0018] According to an extensible operating system for a RISC-V architecture extended instruction set provided by the present invention, the number of combinations between the RISC-V extended instruction sets is determined based on the combination form of each subgraph in a directed acyclic graph, and the combination form of each subgraph refers to decoupling and splitting each subgraph in the directed acyclic graph into a single extended instruction set that depends on multiple extended instruction sets, or decoupling and splitting into multiple extended instruction sets that depend on a single extended instruction set, or decoupling and splitting into a combination form of a continuous dependency chain of multiple extended instruction sets.

[0019] The extensible operating system for the RISC-V architecture extended instruction set provided by the present invention divides the software components of each layer into two parts: components unrelated to the extended instruction set and components related to the extended instruction set, so that all extended instruction sets of the RISC-V processor can be supported at each layer of the operating system, rather than just supporting RV64GC, and there is no need to leave the support for the RISC-V extended instruction set to the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 It is a schematic diagram of the structure of the extensible operating system for the RISC-V architecture extended instruction set provided by the present invention.

[0022] Figure 2 It is a schematic diagram of the framework of the extensible operating system model for the RISC-V processor with different extended instruction set combinations provided by the present invention.

[0023] Figure 3 It is a flow chart of using the RISC-V extended instruction set to improve the operating system provided by the present invention.

[0024] Figure 4 It is a schematic diagram of the strategy provided by the present invention for improving performance by using the RISC-V standard extended instruction set.

[0025] Figure 5 It is a schematic diagram of a strategy for enhancing security by using the RISC-V non-standard extended instruction set provided by the present invention.

[0026] Figure 6 It is a schematic diagram of the dependency relationship between the RISC-V extended instruction sets provided by the present invention.

[0027] Figure 7 It is a schematic diagram of a subgraph obtained by decoupling and splitting the dependency relationship provided by the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] Compared with x86 and ARM architectures, the number of extended instruction sets of RISC-V architecture is much larger than them, and the number of extended instruction sets has been growing in the past decade. Even when considering the dependencies between extended instruction sets, these RISC-V extended instruction sets still have combinatorial explosion. Therefore, the existing operating system layered architecture method of supporting RISC-V architecture extended instruction sets one by one is no longer applicable. Among them, RISC-V is an open source instruction set architecture (ISA, Instruction Set Architecture) based on the principle of reduced instruction set (RISC, Reduced Instruction Set Computing).

[0030] Generally speaking, users usually do not have professional skills in operating system development. Therefore, directly leaving all other RISC-V extended instruction sets except RV64GC to users to support will bring huge development workload and difficulties to users. Therefore, the existing operating system layered architecture is not user-friendly.

[0031] The increasing number of standard and non-standard extended instruction sets of the RISC-V architecture also brings opportunities to improve the performance and security of systems and applications. However, if the existing operating system architecture abandons support for RISC-V extended instruction sets other than RV64GC in the operating system, it will miss the opportunity to improve performance and security by utilizing the RISC-V extended instruction set.

[0032] Figure 1 : is a schematic diagram of the structure of an extensible operating system for the RISC-V architecture extended instruction set provided by the present invention, such as Figure 1 As shown, the system includes:

[0033] Hardware layer, operating system kernel layer, library layer, and application layer;

[0034] The hardware layer includes general-purpose RISC-V processors and diversified RISC-V processors. General-purpose RISC-V processors include RISC-V basic instruction sets and some RISC-V standard extended instruction sets (such as a few RISC-V standard extended instruction sets). Diversified RISC-V processors also include other RISC-V standards and RISC-V non-standard extended instruction sets in addition to the instruction sets supported by general-purpose RISC-V processors.

[0035] The operating system kernel layer includes a general operating system kernel and a specific operating system kernel for some extended instruction sets. The general operating system kernel does not support the above-mentioned specific RISC-V extended instruction sets, and the specific operating system kernel supports the above-mentioned specific RISC-V extended instruction sets.

[0036] The basic model of the library layer includes libraries unrelated to the RISC-V extended instruction set, and the extensible model of the library layer includes libraries unrelated to the RISC-V extended instruction set and libraries related to the RISC-V extended instruction set;

[0037] The basic model of the application layer includes applications that are not related to the RISC-V extended instruction set, and the extensible model of the application layer includes applications that are not related to the RISC-V extended instruction set and applications that are related to the RISC-V extended instruction set.

[0038] Specifically, at the hardware layer, the RISC-V International Foundation combines the RISC-V basic instruction set and a few RISC-V standard extended instruction sets, defining them as the general RISC-V instruction set architecture (ISA). The hardware layer includes general RISC-V processors and diversified RISC-V processors. General RISC-V processors include the RISC-V basic instruction set and a few RISC-V standard extended instruction sets (i.e., necessary extended instruction sets). Diversified RISC-V processors also include other RISC-V standard and non-standard extended instruction sets in addition to the instruction sets supported by general processors.

[0039] At the operating system kernel layer, if the RISC-V processor does not support certain specific extended instruction sets, a general operating system kernel that does not support these specific extended instruction sets can be used. If the RISC-V processor supports certain specific extended instruction sets, it will switch to a specific operating system kernel that supports these specific extended instruction sets. At the library layer, the basic model only contains libraries that are not related to the RISC-V extended instruction set, while the extensible model integrates libraries that are not related to the RISC-V extended instruction set and libraries that are related to the RISC-V extended instruction set. It is worth noting that a single library can depend on multiple RISC-V extended instruction sets. At the application layer, the basic model only supports applications that are not related to the RISC-V extended instruction set, while the extensible model includes applications that are not related to the RISC-V extended instruction set and applications that are related to the RISC-V extended instruction set. In addition, a single application can depend on multiple RISC-V extended instruction sets.

[0040] The extensible operating system for the RISC-V architecture extended instruction set provided by the embodiment of the present invention divides the software components of each layer into two parts: components unrelated to the extended instruction set and components related to the extended instruction set, thereby being able to support all extended instruction sets of the RISC-V processor at each layer of the operating system, rather than just supporting RV64GC, and there is no need to leave the support for the RISC-V extended instruction set to the user.

[0041] Figure 2 is a schematic diagram of a framework of an extensible operating system model for a RISC-V processor with different extended instruction set combinations provided by the present invention, such as Figure 2As shown, the basic part of the extensible operating system model includes software components that are not related to the RISC-V extended instruction set at each layer in the operating system layered architecture. These software components only need to use the RISC-V basic instruction set. The extensible part of the extensible operating system model includes software components related to the RISC-V extended instruction set at each layer in the operating system layered architecture. Among these software components related to the RISC-V extended instruction set, some can improve performance through the hardware capabilities of the RISC-V extended instruction set, and some can improve security through the hardware capabilities of the RISC-V extended instruction set. In addition, the extensible part can dynamically adapt according to different extended instruction set combinations.

[0042] Based on the above embodiments, the general RISC-V processor is used to execute operating system kernels, libraries and applications related to the RISC-V basic instruction set and some standard extended instruction sets, and the diversified RISC-V processor can also be used to execute operating system kernels, libraries and applications related to other RISC-V standards and non-standard extended instruction sets.

[0043] Specifically, the hardware capabilities of the RISC-V standard extended instruction set are used to improve software components related to the RISC-V standard extended instruction set, and the hardware capabilities of the RISC-V non-standard extended instruction set are used to improve software components related to the RISC-V non-standard extended instruction set.

[0044] Figure 3 is a schematic diagram of using the RISC-V extended instruction set to improve the operating system provided by the present invention, such as Figure 3 As shown, the hardware capabilities of the RISC-V standard extended instruction set are used to improve the software components related to the RISC-V standard extended instruction set. At the same time, the hardware capabilities of the RISC-V non-standard extended instruction set are used to improve the software components related to the RISC-V non-standard extended instruction set.

[0045] Based on any of the above embodiments, the RISC-V standard extended instruction set includes the RISC-V vector extended instruction set and the RISC-V scalar encryption extended instruction set, etc. The RISC-V vector extended instruction set is used to write the assembly code of the target function in the core basic library and the application library, and the RISC-V scalar encryption extended instruction set is used to write the assembly code of the encryption and decryption algorithms in the secure socket layer cryptographic library. Among them, the hardware capabilities of the RISC-V vector extended instruction set are used to improve the performance of the core basic library and the application library, and the RISC-V scalar encryption extended instruction set is used to improve the performance of the secure socket layer cryptographic library.

[0046] Figure 4 is a schematic diagram of a strategy for improving performance by using the RISC-V standard extended instruction set provided by the present invention, such as Figure 4As shown, the RISC-V vector extension instruction set is similar to the AVX extension instruction set of the x86 architecture, and there are more basic libraries and application libraries that can use the hardware capabilities of the RISC-V vector extension instruction set for performance acceleration. In an embodiment of the present invention, the RISC-V vector extension instruction set is used to improve the performance of the standard C library (musl-libc), computer vision library, and high-performance linear algebra library, where musl-libc belongs to the core basic library of the operating system, and the computer vision library and high-performance linear algebra library belong to the application library. At the same time, the RISC-V scalar encryption extension instruction set is used to improve the performance of the secure socket layer cryptographic library.

[0047] Based on any of the above embodiments, the extensible operating system is used for a RISC-V processor that supports vector extensions, and the original core base library of the operating system is replaced with a core base library enhanced with vector extensions, and the original application library (for example, a computer vision library and a high-performance linear algebra library) is replaced with an application library enhanced with vector extensions, and the core base library and application library enhanced with vector extensions are implemented using the RISC-V vector extension instruction set and are built based on a compilation tool chain that supports vector extensions.

[0048] Optionally, the steps to optimize the performance of the musl-libc library using the RISC-V vector extension instruction set are as follows:

[0049] S1. Select functions in the musl-libc library that can be optimized using the RISC-V vector extension instruction set.

[0050] S2. Implement the selected function using assembly instructions of the RISC-V vector extension instruction set.

[0051] S3. Build the implemented musl-libc library using a compilation tool chain that supports the RISC-V vector extension instruction set.

[0052] S4. Develop an operating system for a RISC-V processor that supports the RISC-V vector extension instruction set based on the extensible operating system model.

[0053] S5. Replace the standard C library of the operating system with the musl-libc library enhanced with vector extensions.

[0054] S6. Run the test program on an operating system with a replaced standard C library to test the performance of the optimized function.

[0055] S7. Run the test program on an operating system that uses the unenhanced musl-libc library to test the performance of the unoptimized functions.

[0056] By comparing the test results of S6 and S7, the performance of the operating system with the replaced standard C library is better than that of the operating system with the original standard C library.

[0057] Based on any of the above embodiments, the extensible operating system supports a secure socket layer cryptographic library enhanced by a scalar cryptographic extension, the secure socket layer cryptographic library enhanced by the scalar cryptographic extension is implemented based on a RISC-V scalar cryptographic extension instruction set, and is built based on a compilation tool chain supporting the scalar cryptographic extension. The RISC-V processor supporting the scalar cryptographic extension is used to execute the encryption algorithm in the secure socket layer cryptographic library.

[0058] Optionally, the RISC-V scalar cryptographic extension instruction set optimizes the performance of the Secure Sockets Layer cryptographic library as follows:

[0059] S1. Select algorithms in the Secure Sockets Layer cryptographic library that can be optimized using the RISC-V scalar crypto extension instruction set.

[0060] S2. Use the RISC-V scalar cryptographic extension instruction set to implement encryption and decryption algorithms.

[0061] S3. Build the optimized Secure Sockets Layer cryptographic library using a compilation toolchain that supports the scalar cryptography extension.

[0062] S4. Develop an operating system for a RISC-V processor that supports the RISC-V scalar cryptographic extension instruction set based on the extensible operating system model.

[0063] S5. After the extensible operating system is started, the SSL cryptographic library optimized by the scalar cryptographic extension is run to test the performance of the encryption and decryption algorithms.

[0064] S6. Run the secure socket layer cryptographic library implemented by RISC-V general instructions to test the performance of the encryption and decryption algorithms.

[0065] By comparing the S5 and S6 test results, the performance of the Secure Sockets Layer cryptographic library optimized by the RISC-V scalar cryptographic extension instruction set is better than that of the unoptimized Secure Sockets Layer cryptographic library (i.e., the Secure Sockets Layer cryptographic library implemented by RISC-V general instructions).

[0066] According to the characteristics of different RISC-V extended instruction sets, the embodiment of the present invention proposes a method for improving the performance and security of the operating system by using the standard and non-standard extended instruction sets of the RISC-V architecture, that is, the embodiment of the present invention uses the RISC-V vector extended instruction set to improve the performance of the musl-libc library, the computer vision library, and the high-performance linear algebra library. Compared with the generic instruction set implementation (generic) and the baseline operating system (baseline OS) implementation, the performance of the corresponding library on the operating system is significantly improved after acceleration using the RISC-V vector extended instruction set. In addition, the embodiment of the present invention also uses the RISC-V scalar encryption extended instruction set to improve the performance of the secure socket layer cryptographic library.

[0067] Based on any of the above embodiments, the extensible operating system is used to build an operating system for a RISC-V processor that supports a RISC-V non-standard extended instruction set.

[0068] Figure 5 is a schematic diagram of a strategy for enhancing security by using the RISC-V non-standard extended instruction set provided by the present invention, such as Figure 5 As shown in the figure, Hardware-Assisted Data-Flow Isolation (HDFI) is a mechanism designed to enhance system security and prevent memory-related attacks. HDFI is implemented by customizing the RISC-V non-standard extended instruction set, and six security mechanisms can leverage the hardware capabilities of HDFI to enhance security. The Extensible Operating System Model has adapted the RISC-V processor of HDFI and supports its security mechanisms. Donky is an efficient hardware-software co-design for strong intra-process isolation based on dynamic memory protection domains. It combines non-intrusive RISC-V hardware extensions and a secure software framework. Donky enhances the Ariane RISC-V CPU with user-level interrupt extensions (N extensions) to support secure hardware call gates in user space. The Extensible Operating System Model has adapted the RISC-V processor of Donky and the Donky-related secure software framework (DonkyLib), thereby enhancing the security of the operating system by leveraging non-standard extensions.

[0069] Optionally, the steps to enhance security using the RISC-V non-standard extended instruction set are as follows:

[0070] S1. Select a RISC-V processor that uses the RISC-V non-standard extended instruction set to enhance security.

[0071] S2. Determine the supported security mechanisms or security software frameworks.

[0072] S3. Develop an extensible operating system based on the extensible operating system model for the RISC-V processor with enhanced security for the non-standard extended instruction set.

[0073] S4. Run security mechanisms or security software framework related codes on the developed extensible operating system to test security.

[0074] Based on any of the above embodiments, Figure 2 The number of combinations between the RISC-V extended instruction sets shown is determined based on a directed acyclic graph, which is built based on the dependencies between the RISC-V extended instruction sets.

[0075] Optionally, the number of combinations between RISC-V extended instruction sets is determined based on the combination form of each subgraph in the directed acyclic graph, and the combination form of each subgraph refers to decoupling and splitting each subgraph in the directed acyclic graph into a single extended instruction set that depends on multiple extended instruction sets, or decoupling and splitting into multiple extended instruction sets that depend on a single extended instruction set, or decoupling and splitting into a combination form of a continuous dependency chain of multiple extended instruction sets.

[0076] Assume that there are n RISC-V standard extended instruction sets and m RISC-V non-standard extended instruction sets. If there is no dependency between the RISC-V standard extended instruction sets and the RISC-V non-standard extended instruction sets, the number of combinations between these extended instruction sets is 2. (m+n) However, in fact, there are certain dependencies between these extended instruction sets.

[0077] Figure 6 : is a schematic diagram of the dependency relationship between the RISC-V extended instruction sets provided by the present invention, such as Figure 6 As shown, by modeling the dependency relationship between the above extended instruction sets through a directed acyclic graph (DAG), the dependency relationship can be obtained as follows Figure 6 As shown in Figure 2. In the DAG, the starting vertex of the edge depends on the target vertex, and each vertex represents a different RISC-V extended instruction set. Figure 6 Each subgraph in can decouple dependencies by setting the most connected nodes to 0 and 1.

[0078] Figure 7 It is a schematic diagram of the decoupled split sub-graph provided by the present invention, such as Figure 7 As shown, all subgraphs can be decomposed several times into combinations of (1) a single extended instruction set depends on p extended instruction sets, (2) q extended instruction sets depend on a single extended instruction set, or (3) s extended instruction sets form a continuous dependency chain.

[0079] By applying mathematical induction, Figure 7The number of combinations of the extended instruction set is:

[0080]

[0081]

[0082]

[0083] for Figure 7 (1) If there is no extended instruction set in the RISC-V processor ISA , then the extended instruction set cannot exist; if the extended instruction set Exists in the ISA of the RISC-V processor, then the instruction set is extended have different combinations; therefore, for Figure 7 In the case shown in (1), there are a total of different extended instruction set combinations. Figure 7 (2) and (3) in the above example can be used to obtain the extended instruction set combination by a similar method. and .

[0084] Therefore, the decoupled method is used to calculate Figure 6 The total number of combinations of RISC-V extended instruction sets in . The total number of extended instruction set combinations is:

[0085]

[0086] in, Indicated in RISC-V standard extended instruction set and In addition to the RISC-V non-standard extended instruction set Figure 6 In addition to the 71 RISC-V extended instruction sets with dependencies shown, there are other combinations of RISC-V extended instruction sets that have no dependencies.

[0087] As can be seen from the above, as the RISC-V standard expands the number of instruction sets And RISC-V non-standard extended instruction set number With the increase in the number of extended instruction sets, there is a combinatorial explosion among the extended instruction sets, that is, the number of RISC-V processors with different combinations of extended instruction sets is huge.

[0088] According to the above analysis, since there is a combinatorial explosion in the RISC-V extended instruction set, an operating system model that is extensible at each layer is needed to uniformly manage the software components related to these extended instruction sets.

[0089] In this regard, in the embodiment of the present invention, at the processor hardware layer, the RISC-V architecture processor includes a basic instruction set and many standard or non-standard extended instruction sets, and the number of these RISC-V extended instruction sets is much larger than the number of extended instruction sets included in the x86 and ARM architectures. At the operating system kernel layer, many kernel modules need to use the RISC-V extended instruction set, and the kernel is divided into kernel modules that are not related to the RISC-V extended instruction set and kernel modules that are related to the RISC-V extended instruction set. At the library layer, the operating system basic library and the application library are divided into libraries that are not related to the RISC-V extended instruction set and libraries that are related to the RISC-V extended instruction set. At the application layer, the application is divided into applications that are not related to the RISC-V extended instruction set and applications that are related to the RISC-V extended instruction set. Different from the existing operating system architecture for the x86 / ARM architecture, the operating system architecture for the RISC-V architecture divides the software components in each layer of the operating system into parts that are not related to the RISC-V extended instruction set and parts that are related to the RISC-V extended instruction set by layer, so as to manage the RISC-V extended instruction set in an organized manner rather than sporadically in the operating system.

[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the above technical solution can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a RISC-V development board, or a personal computer running a RISC-V hardware simulator, a server, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0091] 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 it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An extensible operating system for RISC-V architecture extended instruction set, characterized in that: include: Hardware layer, operating system kernel layer, library layer, and application layer; The hardware layer includes a general RISC-V processor and a diversified RISC-V processor, wherein the general RISC-V processor includes a RISC-V basic instruction set and a part of a RISC-V standard extended instruction set, and the diversified RISC-V processor includes the instruction set of the general RISC-V processor and other RISC-V standards and RISC-V non-standard extended instruction sets; The operating system kernel layer includes a general operating system kernel and a specific operating system kernel, the general operating system kernel does not support a part of the specific RISC-V extended instruction set, and the specific operating system kernel supports the part of the specific RISC-V extended instruction set; The basic model of the library layer includes libraries unrelated to the RISC-V extended instruction set, and the extensible model of the library layer includes libraries unrelated to the RISC-V extended instruction set and libraries related to the RISC-V extended instruction set; The basic model of the application layer includes applications that are not related to the RISC-V extended instruction set, and the extensible model of the application layer includes applications that are not related to the RISC-V extended instruction set and applications that are related to the RISC-V extended instruction set; The general RISC-V processor is used to execute operating system kernel components, libraries and applications that are independent of the extended instruction set and related to some standard extended instruction sets, and the diversified RISC-V processor is used to execute operating system kernel components, libraries and applications that are independent of the extended instruction set, and is used to execute operating system kernel components, libraries and applications related to other RISC-V standards and RISC-V non-standard extended instruction sets; The RISC-V standard extended instruction set includes a RISC-V vector extended instruction set and a RISC-V scalar encryption extended instruction set. The RISC-V vector extended instruction set is used to write assembly codes for target functions in a core basic library and an application library, and the RISC-V scalar encryption extended instruction set is used to write assembly codes for encryption and decryption algorithms in a secure socket layer cryptographic library.

2. The extensible operating system for the RISC-V architecture extended instruction set according to claim 1, characterized in that: The extensible operating system runs on a RISC-V processor that supports vector extensions. The original core base library of the extensible operating system is replaced with a core base library enhanced with vector extensions, and the original application library is replaced with an application library enhanced with vector extensions. The core base library and application library enhanced with vector extensions are implemented based on the RISC-V vector extension instruction set and are built using a compilation tool chain that supports vector extensions.

3. The extensible operating system for the RISC-V architecture extended instruction set according to claim 2, characterized in that: The RISC-V processor supporting vector extensions is used to run an operating system that supports core basic libraries and application libraries enhanced by vector extensions.

4. The extensible operating system for the RISC-V architecture extended instruction set according to claim 1, characterized in that: The extensible operating system supports a secure socket layer cryptographic library enhanced by a scalar cryptographic extension, and the secure socket layer cryptographic library enhanced by the scalar cryptographic extension is implemented based on the RISC-V scalar cryptographic extension instruction set and is constructed based on a compilation tool chain supporting the scalar cryptographic extension.

5. The extensible operating system for the RISC-V architecture extended instruction set according to claim 4, characterized in that: A RISC-V processor supporting scalar cryptographic extensions is used to execute an operating system that includes a secure socket layer cryptographic library enhanced by the scalar cryptographic extensions.

6. The extensible operating system for the RISC-V architecture extended instruction set according to any one of claims 1 to 5, characterized in that: The number of combinations between the RISC-V extended instruction sets is determined based on a directed acyclic graph, and the directed acyclic graph is constructed based on the dependency relationship between the RISC-V extended instruction sets.

7. The extensible operating system for the RISC-V architecture extended instruction set according to claim 6, characterized in that: The number of combinations between the RISC-V extended instruction sets is determined based on the combination form of each subgraph in the directed acyclic graph, and the combination form of each subgraph refers to decoupling and splitting each subgraph in the directed acyclic graph into a single extended instruction set that depends on multiple extended instruction sets, or decoupling and splitting into multiple extended instruction sets that depend on a single extended instruction set, or decoupling and splitting into a combination form of a continuous dependency chain of multiple extended instruction sets.