CN115774574A - Operating system kernel switching method and device - Google Patents

Operating system kernel switching method and device Download PDF

Info

Publication number
CN115774574A
CN115774574A CN202111039645.2A CN202111039645A CN115774574A CN 115774574 A CN115774574 A CN 115774574A CN 202111039645 A CN202111039645 A CN 202111039645A CN 115774574 A CN115774574 A CN 115774574A
Authority
CN
China
Prior art keywords
registers
context
kernel
register
saved
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.)
Granted
Application number
CN202111039645.2A
Other languages
Chinese (zh)
Other versions
CN115774574B (en
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202111039645.2A priority Critical patent/CN115774574B/en
Priority claimed from CN202111039645.2A external-priority patent/CN115774574B/en
Publication of CN115774574A publication Critical patent/CN115774574A/en
Application granted granted Critical
Publication of CN115774574B publication Critical patent/CN115774574B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides an operating system kernel switching method and device. The method comprises the following steps: providing a plurality of sets of context save/restore procedures in a kernel of an operating system; wherein each set of context save/restore routines is for saving a different number of registers; receiving a request for context switching; acquiring a current context switching scene and a user mode code required to be identified according to the request; determining a register set which needs to be saved/restored for executing the context switch according to the context switch scene and the identified user mode code; and selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the register set according to the number of the registers in the register set. According to the interrupt type and the actual register use condition of an operating system, the type and the number of registers needing to be saved and restored are reduced by providing customized context switching, so that the response time of system call is reduced, and the scheduling delay is reduced.

Description

Operating system kernel switching method and device
Technical Field
The present invention relates to the field of system call technologies, and in particular, to a method and an apparatus for switching operating system kernels.
Background
Microkernels are kernel architectures that are currently widely used in the field of real-time operating systems that have relatively high security requirements. The method has the characteristics of small system complexity, safety, reliability and instantaneity. Compared with a macro kernel, the system call provided by the micro kernel has small granularity and single function, and is often used as a micro kernel upper layer service and a function for constructing a complex interface.
Microkernel-based systems typically consist of multiple system calls/PRCs to complete the task in the macro kernel at one system call, with a higher frequency and number of context switches than the number of macro kernels. In order to solve the performance degradation caused by the large number of times of microkernel system call/PRC, the performance degradation is usually compensated by reducing the number of times of system call or shortening the flow of system call, but no scheme for compensating by reducing the overhead of context switch exists.
Disclosure of Invention
The embodiment of the application provides an operating system kernel switching method and device, which are oriented to a scene of a simplified instruction set architecture, wherein a register is saved/restored under the scene generally by dozens of instructions. Therefore, in the embodiment of the application, according to the interrupt type and the actual register use condition of the operating system, the type and the number of registers needing to be saved and restored are reduced by providing the customized context switch, so that the response time of the system call is reduced, and the scheduling delay is reduced.
In a first aspect, an embodiment of the present application provides an operating system kernel switching method, where an operating system manages multiple registers, and the method includes: providing a plurality of sets of context save/restore procedures in a kernel of an operating system; wherein each set of context save/restore routines is for saving a different number of registers; receiving a request for context switching; acquiring a current context switching scene and a user mode code which needs to be identified during current context switching according to the context switching request; determining a register set which needs to be saved/restored for executing the context switching according to the context switching scene and the identified user mode code; selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the register set in the kernel according to the number of the registers in the register set; and the number of the registers which can be saved by the selected context saving/restoring program is more than or equal to the number of the registers in the register set.
That is to say, the method for switching the operating system kernel provided in the embodiment of the present application is mainly oriented to a simplified instruction set architecture scenario. By compiling the kernel code in advance, it is possible to provide a variety of context save/restore procedures in the kernel, where each set of context save/restore procedures can save a different number of registers. When the system has context switching, the register set needed to be saved/restored for executing the context switching can be determined according to the current context switching scenario and the user mode code of the current program needing context switching, and then a group of context saving/restoring programs is selected to save the registers in the registers. That is, in the embodiment of the present application, according to the interrupt type and the actual register usage by the operating system, the type and the number of registers that need to be saved and restored are reduced by providing customized context switching, thereby reducing the response time of the system call and reducing the scheduling delay.
In one possible implementation, the current context switch scenario is a signal processing scenario, and the context switch request is a system call request; determining a register set that needs to be saved/restored for performing context switching according to a context switching scenario and identified user state code includes: receiving a system call request, and checking the authority of a system caller; identifying a user mode code based on the system caller having permission; dividing the context of system call into a first register set and a second register set according to the identified user mode code information; the registers in the first type register set are registers which need to be saved in the kernel, and the registers in the second type register set are registers which do not need to be saved in the kernel.
That is, only a part of the registers need to be saved in the kernel when the system call is performed, and the context saving/restoring overhead of the kernel when the system call is executed is reduced.
In one possible implementation manner, selecting one group of context saving/restoring programs from the plurality of groups of context saving/restoring programs to save/restore the registers in the register set in the kernel according to the number of registers in the register set includes:
and selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the first register set in the kernel according to the number of the registers in the first register set.
That is, providing multiple sets of save/restore context of different lengths in the operating system kernel allows the system call to select a more optimal context save/restore policy based on actual register usage.
In one possible implementation, the method further includes: and saving the registers in the second type register set in a user mode.
That is, partial registers are put into a user mode for saving, reducing the context saving/restoring overhead of the kernel when executing system calls.
In one possible implementation, the user mode code is assembly code at the system call entry; when compiling is carried out through a compiler, register information which needs to be saved/restored when the system call is executed is coded into assembly codes at the entry of the system call as system call parameters.
That is, prior to performing a context switch, the set of registers that need to be used for the current context switch may be specified.
In one possible implementation, determining a register set that needs to be saved/restored for executing a context switch scenario according to the context switch scenario and an identified user state code includes: acquiring register information transmitted into a kernel when a signal processing program is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the signal processing program is called; and determining the register set needing to be saved/restored during context switching according to the set information of the register.
In one possible implementation, the current context switch scenario is an interrupt processing scenario, and determining, according to the context switch scenario and the identified user mode code, a register set that needs to be saved/restored when executing the context switch scenario includes: acquiring register information transmitted into a kernel when an interrupt handler is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when an interrupt processing program is called; and determining the register set needing to be saved/restored during context switching according to the set information of the register.
In one possible implementation, the determining, according to the context switch scenario and the identified user mode code, a register set that needs to be saved/restored when executing the context switch scenario, where the current context switch scenario is a remote procedure call scenario, includes: acquiring register information transmitted into a kernel when a remote procedure call handler is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when a remote procedure call processing program is called; and determining the register set needing saving/restoring for context switching according to the set information of the register.
That is, for a signal processing scenario, an interrupt processing scenario or a remote procedure call scenario, when a remote procedure call handler/a signal handler/an interrupt handler is written, register information required by the handler in the execution process may be added by a designated code hit, and the information is encoded into an entry of the kernel call remote procedure call handler, the signal handler or the interrupt handler. When the remote procedure call processing program, the signal processing program or the interrupt processing program is executed, only the register needed to be used can be saved, and the context saving/restoring overhead when the kernel calls the remote procedure call processing program, the signal processing program or the interrupt processing program is greatly reduced.
In one possible implementation, the user mode code is assembly code at the entry of an information handler, a remote procedure call handler, or an interrupt handler; when compiling is performed by a compiler, register information to be saved/restored for executing the information processing program, the remote procedure call processing program, and the interrupt processing program is encoded in assembly code at the entry of the kernel call information processing program, the remote procedure call processing program, and the interrupt processing program.
That is, prior to performing a context switch, the set of registers needed for the current context switch may be specified.
In a second aspect, an embodiment of the present application provides an operating system kernel switching apparatus, where an operating system manages multiple registers, and provides multiple sets of context saving/restoring programs in a kernel of the operating system; wherein each set of context save/restore procedures is for saving a different number of registers, the switching means comprising: a request receiving unit, configured to receive a context switch request; the target call determining unit is used for acquiring a current context switching scene and a user mode code which needs to be identified in the current context switching according to the context switching request; determining a register set which needs to be saved/restored for executing context switching according to a context switching scene and the identified user mode code; the execution unit is used for selecting a group of context saving/restoring programs from the plurality of groups of context saving/restoring programs according to the number of registers in the register set to save/restore the registers in the register set in the kernel; and the number of the registers which can be saved by the selected context saving/restoring program is more than or equal to the number of the registers in the register set.
In one possible implementation, the method further includes: the access authority judging unit is used for receiving a system calling request when the acquired current context switching scene is a system calling scene; the access authority judging unit is used for checking the authority of the system caller; based on that the system caller has the authority, the target call determining unit is used for dividing the context of the system call into a first register set and a second register set according to the identified user state code information; the registers in the first type register set are registers which need to be saved in the kernel, and the registers in the second type register set are registers which do not need to be saved in the kernel.
In one possible implementation, the execution unit is configured to: and selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the first register set in the kernel according to the number of the registers in the first type of register set.
In one possible implementation, the execution unit is further configured to: and saving the registers in the second type register set in a user mode.
In one possible implementation, the user mode code is assembly code at the system call entry; when compiling is performed by a compiler, register information that needs to be saved/restored for executing a system call is encoded into assembly code at a system call entry as a system call parameter.
In one possible implementation manner, the current context switching scenario is a signal processing scenario, and the target determining unit is further configured to acquire kernel register information transmitted when the signal processing program is registered in the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when a signal processing program is called; and determining the register set needing saving/restoring for context switching according to the set information of the registers.
In a possible implementation manner, the current context switching scenario is an interrupt processing scenario, and the target determining unit is further configured to obtain register information transmitted to the kernel when the interrupt handler is registered in the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when an interrupt processing program is called; and determining the register set needing to be saved/restored during context switching according to the set information of the registers.
In one possible implementation manner, the current context switching scenario is a remote procedure call scenario, and the target determining unit is further configured to acquire register information transmitted to the kernel when the remote procedure call handler is registered in the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when a remote procedure call processing program is called; and determining the register set which needs to be saved/restored in context switching according to the set information of the registers.
In one possible implementation, the user mode code is assembly code at an entry of the information handler, the remote procedure call handler, or the interrupt handler; when compiling is performed by a compiler, register information that needs to be saved/restored for executing the information processing program, the remote procedure call processing program, and the interrupt processing program is encoded in assembly code at the entry of the kernel call information processing program, the remote procedure call processing program, and the interrupt processing program.
In a third aspect, an embodiment of the present application provides a computer storage medium having instructions stored therein, where the instructions, when executed on a computer, cause the computer to execute the method provided in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer product containing instructions that, when executed on a computer, cause the computer to perform the method provided in the first aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an operating system structure of a microkernel according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a system architecture according to an embodiment of the present disclosure;
fig. 3 is a flowchart of an operating system kernel switching method according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating an optimization process of a system call according to an embodiment of the present application;
fig. 5 is a flowchart of another operating system kernel switching method according to an embodiment of the present application;
fig. 6 is a flowchart of another operating system kernel switching method according to an embodiment of the present application;
fig. 7 is a flowchart of another operating system kernel switching method according to an embodiment of the present application;
fig. 8 is a schematic diagram illustrating an optimization process of an RPC call according to an embodiment of the present disclosure;
fig. 9 is a block diagram of an apparatus for performing context switch of an operating system kernel according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
Any embodiment or design described herein as "exemplary," "for example," or "for example" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary," "for example," or "exemplary" is intended to present relevant concepts in a concrete fashion.
In the description of the embodiment of the present application, the term "and/or" is only one kind of association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, B exists alone, and A and B exist at the same time. In addition, the term "plurality" means two or more unless otherwise specified. For example, the plurality of systems refers to two or more systems, and the plurality of screen terminals refers to two or more screen terminals.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit indication of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically stated.
Since it is necessary to limit the access capability between different programs, preventing them from acquiring memory data of another program or acquiring data of a peripheral device and sending the data to the network, the operating system requires two CPU states, a kernel state and a user state. Fig. 1 is a schematic view of an operating system structure of a microkernel according to an embodiment of the present disclosure, including a user mode and a kernel mode. The kernel mode is used for running an operating system program and has a higher privilege level, and the user mode is used for running a user program and has a lower privilege level. A program running in user mode cannot directly access the os kernel data structures and programs, and when a program is executed in the system, most of the time is running in user mode, it switches to kernel mode when it needs the os to help perform some tasks it does not have rights and capabilities to do. Generally, the following scenario results in a user-mode to kernel-mode switch.
And (3) system calling: the kernel of the operating system provides a service interface for the user mode, and the generation and return of the system call can go through the process of one user- > kernel- > user.
Exception: the system has accidents (illegal instructions, missing pages, etc.) in the instruction logic flow during the instruction execution, and the processor actively breaks the current execution in order to catch the accidents and jumps to a specific processing program. This process is called exception (exception handling).
Interrupt Request (IRQ): refers to a hardware signal generated by hardware in a computer system that interrupts the execution of the system. When an interrupt request is received in the system execution, a specific function is usually immediately jumped to process the request.
Remote Procedure Call (RPC), which in the embodiment of the present application specifically means that one process directly calls a function in another process by means of a mechanism provided by the operating system.
Signal: the operating system provides a mechanism by which the operating system kernel/process is somehow (clock expired, process killed) to break the execution of a process and tell the process to execute a particular handler. This request for an interruption is referred to as a signal and the handler triggered by the signal is referred to as a signal handler.
When the operating system receives an interrupt, a system call, and an exception signal, a switch from kernel mode to user mode and user mode to kernel mode occurs. The processor then generates a privilege level and page table switch from executing user mode code to executing kernel mode code, or vice versa, a process known as a context switch.
The embodiment of the application is oriented to a scene of a simplified instruction set architecture. The operating system typically needs to save/restore all general purpose registers when performing a context switch. Since the common reduced instruction set (risc) architecture includes 32 general purpose registers and up to 32 floating point registers, and a single instruction in the main risc instruction set can only hold 1-2 registers, the saved execution time is not negligible. This is caused by the fact that current operating system kernels are designed without taking into account the allocation of registers. In scenarios where the operating system generates frequent context switches, the overhead of saving the restore registers will be significant.
In particular, the context switching service of the current operating system has the following characteristics:
in a system call scenario, the set of registers needed at the call may be determined by the user state, and the kernel state need not save the entire context.
In the scenario where the operating system handles interrupts, the interrupt handling routine typically only requires a limited context for passing interrupt information.
In operating system services that rely on communication between signal processing processes, signal processing routines typically only need to determine a limited context for communicating signal information.
In operating systems that rely on remote procedure calls for inter-process communication, the RPC service routine typically only needs to determine a limited context for passing RPC parameters and return values.
Therefore, the performance under the frequent context switching scene can be effectively improved by controlling the saving/restoring register set required by the context switching according to the scene.
Fig. 2 is a schematic diagram of a system architecture provided in an embodiment of the present application, including: user mode code, kernel code, and compiler plug-ins. The compiler plug-in is used for identifying the hit specified in the user mode code, and a programmer can specify a register set used for context switching at a time through the hit in the user mode code. If a scene needing to save/restore the register in the user mode exists, a context restoring/saving code can be inserted into the user mode code by the compiler. By compiling the kernel mode code in advance, a plurality of groups of context saving/restoring programs with different register numbers can be provided in the kernel, and the context saving/restoring flow specifically used in the kernel can be specified by the kernel according to hit information transmitted by the user mode.
The embodiment of the application provides an operating system kernel switching method based on a system call scene. In the embodiment of the present application, pre-compiling in the kernel code of the operating system generates a plurality of context save/restore programs that can save different numbers of registers. And providing a code hit which can be specified in user-state programming by means of a compiler plug-in to specify a register set of context switching to the kernel, wherein the set information can be coded into assembly code at a system call entry as a system call parameter. In one example, a register list attribute may be defined in the hit code to specify the set of registers that the current system caller needs to save/restore at the entry.
Fig. 3 is a flowchart of an operating system kernel switching method according to an embodiment of the present disclosure. When the operating system executes a system call, as shown in FIG. 3, it includes:
in step S301, the user mode program initiates a system call.
The user-mode program with hit is pre-compiled before the user-mode program initiates a system call. Wherein, a register list attribute is defined in the source code hit, and the register set required to be saved/restored by the current system call/handler at the entry is specified in the attribute.
After the user mode program initiates a system call, the authority of the system caller needs to be checked. The kernel provides a set of standard interfaces for interaction between the user space program and the kernel space, and the interfaces enable the user mode program to access hardware devices in a limited way, such as applying for system resources, operating device reading and writing, creating a new process and the like. The user space generates requests, the kernel space is responsible for execution, and the interfaces are the bridges commonly identified by the user space and the kernel space.
Further, an intermediate layer called Syscall may be provided between the user space and the kernel space as a bridge connecting the user mode and the kernel mode. Therefore, the safety of the kernel is improved, the kernel is convenient to transplant, and only one socket is needed. In one possible example, a soft interrupt is generated by sending out Syscar to a kernel space for a Linux system user space, so that a program is trapped in a kernel state and corresponding operations are executed. There will be a corresponding system call number for each system call.
Step S302, the user mode saves the register.
After compiling the system call with hit, the context of the current system call is divided into two register sets: a set of registers needed by the core and a set of registers not needed by the core. Registers not needed by the kernel are saved in the user mode.
Step S303, synchronize system calls.
Step S304, the kernel mode saves the register.
When an application program in a user space enters the kernel space through system call, the process processing of the user space transmits variables and parameter values required by the system call to the kernel, and also transmits a system call number of the current system call and a register set required to be stored in a kernel mode to the kernel. The kernel selects a register saving/restoring program to save the register needed by the kernel according to the system calling number of the system call and the system calling information coded in the kernel. In one example, registers that need to be saved may be saved to the top of the stack by defining an assembly macro SAVE _ ALL.
It should be noted that, multiple sets of context save/restore programs are provided in the kernel, and each set of context save/restore programs may save a different number of registers. When a system call enters the kernel, the kernel may select a conforming context save/restore routine based on the number of registers that the current system call needs to be saved/restored. The register required to be saved by the system call can be saved by using as few instructions as possible, and the saving execution time is effectively shortened.
Step S305, kernel mode processing.
After the kernel state saves the register, the kernel process also needs to check whether the system call number is a valid value, and if not, the system call is exited. If the system call number transmitted into the kernel is a valid value, the kernel process finds a corresponding kernel function in the system call table according to the system call number and executes the kernel function.
Step S306, restoring the register in the kernel mode.
In one possible example, the register pushed by the save context process may be popped back by the restore context process after system call processing is complete.
In step S307, the system call returns.
Step S308, restoring the register by the user mode.
The previously saved registers are restored in the user mode.
Step S309, returns the user mode code.
In the embodiment of the application, the register set which needs to be saved/restored by the current system call is specified in the user mode code, so that only the needed register is saved in the kernel mode when the system call enters the kernel. Namely, the type and the number of registers needing to be saved and restored are reduced through customized context switching, so that the response time of a system call is reduced, and the scheduling delay is reduced. Further, by providing multiple sets of different length context saving/restoring programs in the operating system kernel, the system call, interrupt processing, signal processing and RPC are allowed to select a better context saving/restoring strategy according to the actual register use condition.
Fig. 4 is a schematic diagram of optimization processing of a system call according to an embodiment of the present application. The implementation form shown in fig. 4 is code contained in the context of a compiler, source code hit and an operating system, including both compiler plug-in code and runtime code. The compiler plug-in will read in the register list attribute defined by the C-code, where the set of registers that the current system call/handler needs to save/restore at the entry is specified.
In the compiling stage, the compiler recognizes that the called system call prototype has defined hit, and when the assembly code is generated, the register set information in the system call attribute is encoded into the entry assembly code of the system call as the system call parameter, and the register which is not needed by the system call is left in the user state for saving and restoring.
In the execution stage, the kernel process selects the context switching process required to be used according to the system call number. Multiple sets of context save/restore procedures are provided in the kernel, each set of context save/restore procedures can hold a different number of registers. When a system call enters the kernel, the kernel process may select a conforming context save/restore routine based on the number of registers that the current system call needs to be saved/restored.
In one example, the kernel provides three sets of context save/restore procedures during a system call as shown in FIG. 4. The number of registers that can be saved/restored by the first group of context saving/restoring programs is 1, the number of registers that can be saved/restored by the second group of context saving/restoring programs is 4, and the number of registers that can be saved/restored by the third group of context saving/restoring programs is 8. When the register list attribute defined by the C code read by the compiler comprises 3 registers, the kernel process selects a second group of context saving/restoring programs to save the 3 registers in the register list attribute according to the number of the registers required to be saved by the current system call.
In one possible embodiment, the embodiments of the present application are implemented on the ARMv8 architecture. There are 30 general purpose registers, 4 program state related registers on the ARMv8 architecture, and one conventional context switch requires saving/restoring up to 34 registers of 64 bits in length. The system call prototype definition is made prior to the system call. In one example, a register list attribute is defined in hit, where the set of registers that the current system call/handler needs to save/restore at entry is specified. The system call prototype defines hit as follows:
int_attribute_((sys_reglist(“X0,X1,X2”)))
syscall_sys_futex(void*arg1,int arg2);
kernel mode is then entered by calling syscall funex at the occurrence of a user-mode system call. That is, the code where the user-mode system call occurs is:
ret=syscall_sys_futex(ptr,arg);
compiling the user mode code for system call through a compiler plug-in to obtain the compiled user mode code as follows:
Push x3~x15
Mov r0,SVC_NO_OF_SYS_FUTEX
Idr r1,[ADDR_OF arg1]
Idr r2,[ADDR_OF arg2]
Svc
Pop r3~r5
the kernel system call code is as follows:
bl save_x0_to_x2
bl syscall_entry
bl restore_x0_to_x2
eret
in the compiling period, the compiler recognizes the called system call prototype hit, specifies that only three registers from X0 to X2 are used in the kernel, generates the user mode code which violates the calling convention (calling convention) defined by the original platform, and saves the registers which are not needed by the kernel in the user mode before and after the actual calling of the svc.
During the writing process of the kernel, the compiler recognizes the prototype definition hit of the system call, selects specific context recovery calls for the front and the back of codes generated by the current system call inlet, and only stores three registers from x0 to x 2.
In the embodiment of the application, when the user mode system call occurs, the user mode system call directly goes to the specified kernel context saving and restoring process, so that the kernel path is ensured to be greatly shortened.
The embodiment of the present application further provides an operating system kernel switching method based on an RPC scenario/a signal processing scenario/an interrupt processing scenario, where it should be noted that, in the embodiment of the present application, RPC specifically indicates that one process directly calls a function in another process by using a mechanism provided by an operating system. In the embodiment of the application, a plurality of context saving/restoring programs capable of saving different numbers of registers are generated by pre-compiling in a kernel code of an operating system, and when an RPC handler/a signal handler/an interrupt handler is written, register information required by the handler in the execution process can be increased through a specified code hint, and the information is encoded into an entry of the kernel calling the RPC handler, the signal handler or the interrupt handler. By providing multiple sets of programs of different lengths for saving/restoring context in the operating system kernel, the system call, interrupt processing, signal processing and RPC are allowed to select a better context saving/restoring strategy according to the actual register use condition.
Fig. 5 is a flowchart of another operating system kernel switching method provided in the embodiment of the present application, where when an operating system executes RPC processing, the method includes:
in step S501, the user mode program initiates a system call.
Step S502, the user mode saves the register.
Step S503, synchronize the system call.
Step S504, the kernel mode saves the register.
Step S505, kernel mode processing.
In step S5051, the kernel mode restores the register.
When the kernel actively calls a piece of RPC handler, the context of the currently executing process needs to be saved in the kernel mode, and part of the registers needs to be restored in the kernel mode for passing parameters during the RPC handling. Specifically, since the RPC handler with hit is registered in the kernel in advance, the kernel process can restore a certain number of registers in the kernel mode according to the register set information transmitted by the RPC handler when the RPC handler registers the RPC process in the kernel mode.
In one possible example, when the kernel process restores the registers, a set of context save/restore procedures may be selected from the kernel for restoring the registers according to the number information of the registers in hit. Wherein, the number of the registers which can be saved by the selected context saving/restoring program is more than or equal to the number of the registers in the hit.
In step S5052, RPC processing is performed in the user mode.
In step S5053, the register is saved in the kernel state.
When the RPC processing program is executed in the user mode, part of the parameters also need to be transmitted back to the kernel mode, and at this time, the kernel process can select a group of context saving/restoring programs from the kernel according to the number information of the registers in the hit for saving the registers and storing the returned parameters into the registers.
In one possible example, the kernel may execute other processes after the remote procedure call is completed, and may also continue executing processes that were interrupted while the remote procedure call was executed. When the kernel continues to execute the process interrupted when the remote procedure call is executed, step S506 to step S509 are further included.
Step S506, restoring the register by the kernel mode.
In step S507, the system call returns.
Step S508, restoring the register using the user mode.
In step S509, the user mode code is returned.
In the embodiment of the present application, when an RPC call occurs, in most cases, the kernel only needs to use a small number of registers for passing references, and does not need to use all registers. Therefore, in the embodiment of the application, before the kernel mode calls the RPC process, the kernel reads the register coding information to be restored, then selects the corresponding register restoring program according to the read value, and when the kernel mode returns after the RPC process is executed, selects the corresponding register saving program according to the read value. Context restore/save overhead from kernel calls to RPC handlers can be greatly reduced.
Fig. 6 is a flowchart of another operating system kernel switching method according to an embodiment of the present application. When the operating system executes the interrupt processing, the processing flow comprises the following steps:
step S601, receiving an interrupt signal;
step S602, responding to the interrupt signal, saving/restoring a register in a kernel state, and jumping to an interrupt service program;
after receiving the interrupt information, it is necessary to save the context of the program whose execution is currently suspended, and to restore a part of registers in the kernel mode for transferring parameters during the interrupt processing. Specifically, since the interrupt handler with hit is registered in the kernel in advance, the kernel process can restore a certain number of registers in the kernel mode according to the register set information transmitted by the handler when registering the process in the kernel mode. Wherein the number of restored registers is greater than or equal to the number of registers in hit.
In one possible example, when the kernel process restores the registers, a set of context saving/restoring programs can be selected from the kernel for restoring the registers according to the number information of the registers in hit.
In one possible example, a chip is constructed for risc-v. In risc-v, general purpose registers such as ra, gp, tp, t0-t2, and processor status registers such as mstatus, mcp need to be saved for the underlying instruction set rv32 i. When an interrupt occurs, the mcp stores a position where execution should be resumed after the interrupt processing.
Step S603, executing an interrupt service routine;
step S604, save/restore the register in kernel state.
After the interrupt service routine is executed, partial parameters need to be transmitted back to the kernel mode, and at this time, the kernel process can select a group of context saving/restoring routines from the kernel according to the number information of the registers in the hit for saving the registers and storing the returned parameters into the registers.
After the execution of the interrupt service program is completed, the context of the suspended process needs to be restored and the process is continuously executed while the interrupt service is executed.
In one possible example, for the risv-v architecture, when the site is restored, only the mret instruction needs to be called to restore the previous processor state.
Fig. 7 is a flowchart of another operating system kernel switching method according to an embodiment of the present application. When the operating system performs signal processing, the processing flow comprises:
step S701 receives a signal.
In response to the signal, the kernel-state save/restore register is executed in step S702.
The signal is considered a software interrupt (as distinguished from a hardware interrupt). The semaphore mechanism provides a way to handle asynchronous events under a single process or thread. The specific process is that when the process runs to a certain position, a signal is received, and after the context of the currently executed process is stored, a signal processing program is executed.
Before executing the signal processing program, it is necessary to restore part of the registers in the kernel mode for transferring parameters during signal processing. Specifically, since the interrupt handler with hit is registered in the kernel in advance, the kernel process can restore a certain number of registers in the kernel mode according to the register set information transmitted by the handler when registering the process in the kernel mode. Wherein the number of restored registers is greater than or equal to the number of registers in hit.
In one possible example, when the kernel process restores the registers, a set of context save/restore procedures may be selected from the kernel for restoring the registers according to the number information of the registers in hit.
In step S703, a signal processing program is executed.
Step S704, save/restore the register in kernel state.
After the signal processing program is executed, part of the parameters need to be transferred back to the kernel mode, and at this time, the kernel process can select a group of context saving/restoring programs from the kernel according to the number information of the registers in the hit for saving the registers and storing the returned parameters into the registers.
After the signal processing program is executed, the context of the suspended process is restored and the process is continued to be executed while the signal processing program is executed.
Fig. 8 is a schematic diagram of optimization processing of an RPC call according to an embodiment of the present application. The implementation form shown in fig. 8 is code contained in the context of a compiler, source code hit and an operating system, including both compiler plug-in code and runtime code. The compiler plug-in will read in the register list attribute defined by the C-code, where the set of registers that the current system call/handler needs to save/restore at the entry is specified. For signal processing, RPC processing, and interrupt processing, this information will be encoded into the entries of the kernel calls to these procedures.
In one possible embodiment, during the compilation phase, the compiler identifies the RPC handler's defined hit, and as shown in fig. 8, specifies three registers X0 to X2 to be used in the kernel in the defined hit information, and generates the user mode code in which the memory usage information is encoded into the first two bytes of the handler.
In the execution stage, the kernel process selects a corresponding context switching process when the kernel switches to the user mode to call the processing function according to the registration information of the processing function. Multiple sets of context save/restore procedures are provided in the kernel, each set of context save/restore procedures can hold a different number of registers. The signal processing, RPC handler and interrupt processing will select the designated save/restore context flow when jumping to user mode and jumping back to kernel mode, according to the register set information that is imported when the user mode registers these processes.
In one example, the kernel provides three sets of context save/restore procedures during signal processing, RPC, and end processing as shown in fig. 6. The number of registers that can be saved/restored by the first group of context saving/restoring programs is 1, the number of registers that can be saved/restored by the second group of context saving/restoring programs is 4, and the number of registers that can be saved/restored by the third group of context saving/restoring programs is 8. When the register list attribute defined by the C code read by the compiler includes 3 registers, the kernel process selects the second set of context save/restore program to save the 3 registers in the register list attribute according to the number of registers that the current system call needs to save.
In one possible embodiment, the remote procedure call processing provided by the embodiments of the present application is implemented on the ARMv8 architecture. The ARMv8 architecture has 30 general purpose registers, 4 program state related registers, and one conventional context switch requires saving/restoring up to 34 registers of 64 bits in length.
During compile time, the compiler identifies the hit defined at the entry of the early RPC handler. Wherein the hit code defined at the RPC entry is:
int
_attribute_((kcall_reglist(“x0,x1,x2”)))
_attribute_((kcall_ret_reglist(“x0”)))
sys_handler_1(void*arg1,intarg2){
return ret;
}
the hit code of the RPC processing program compiled by the compiler plug-in is as follows:
sys_handler_1:
b sys_handler_1_entry
long 0x3// call register x 0x1 x2
Long 0x1// register used for return x0
sys_handler_1_entry;
svc//Back to kernel
Before the kernel calls the RPC process in a user mode, the kernel reads in register coding information needing to be recovered, and then selects a corresponding register recovery program according to a measured value. The kernel calls RPC processing program codes as follows:
Idr x0,[ADDR_OF sys_handler_1+0x4]
bl restore_regs
Idr elr,[ADDR_OF sys_handler_1]
eret
when a PRC call occurs, the kernel in most cases only needs to use a small number of registers for passing parameters, and does not need to use all registers. In the embodiment of the application, the number of the registers required to be used is specified in the hit code defined at the entrance of the RPC processing program, so that only the registers required to be used can be saved when the PRC processing program is executed, and the context recovery/saving overhead when the RPC processing program is called from the kernel is greatly reduced.
In the embodiment of the present application, a context switch in a scenario of signal processing and user mode interrupt processing is further provided, and a processing procedure of the context switch is the same as that of the RPC processing, which is not described herein again.
An embodiment of the present application further provides an apparatus for performing context switching of a kernel of an operating system, as shown in fig. 9, including: a request receiving unit 901, a target calling unit 902 and an executing unit 903.
The request receiving unit 901 is configured to receive a context switch request.
The target call determining unit 902 is configured to obtain a current context switching scenario, and determine, according to the current context switching scenario and an identified user mode code, a register set that needs to be saved/restored for executing the context switching;
the execution unit 903 is configured to execute the context switch request and save the register set in a kernel mode by using a context save/restore program.
The acquired context switching scene comprises at least one of a system calling scene, a signal processing scene, an interrupt processing scene and a remote procedure calling scene.
In one example, when the obtained context switch scenario is a system call scenario, the execution unit 903 may be configured to execute steps S303 to S309.
In one example, when the acquired above switching scenario is a remote procedure call scenario, the execution unit 903 may be configured to execute steps S5051 to S509.
In one example, the execution unit 903 may be configured to execute steps S602 to S604 when the acquired above switching scenario is an interrupt processing scenario.
In one example, the execution unit 903 may be configured to execute steps S702 to S704 when the acquired above switching scene is a signal processing scene.
The method steps in the embodiments of the present application may be implemented by hardware, or may be implemented by software instructions executed by a processor. The software instructions may consist of corresponding software modules that may be stored in Random Access Memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for convenience of description and distinction and are not intended to limit the scope of the embodiments of the present application.

Claims (20)

1. A method for operating system kernel switching, wherein the operating system manages a plurality of registers, the method comprising:
providing a plurality of sets of context save/restore procedures in a kernel of an operating system; wherein each set of context save/restore routines is for saving a different number of registers;
receiving a request for context switching;
acquiring a current context switching scene and a user mode code which needs to be identified in the current context switching according to the context switching request;
determining a register set which needs to be saved/restored for executing the context switching according to the context switching scene and the identified user mode code;
selecting a group of context saving/restoring programs from a plurality of groups of context saving/restoring programs to save/restore the registers in the register set in a kernel according to the number of the registers in the register set; and the number of the registers which can be saved by the selected context saving/restoring program is more than or equal to the number of the registers in the register set.
2. The method of claim 1, wherein the current context switch scenario is a signal processing scenario, and wherein the context switch request is a system call request;
the determining, according to the context switch scenario and the identified user state code, the register set that needs to be saved/restored to execute the context switch includes:
receiving a system call request, and checking the authority of the system caller;
identifying a user mode code based on the system caller having permission;
dividing the context of the system call into a first register set and a second register set according to the identified user mode code information; the registers in the first type register set are registers which need to be saved in the kernel, and the registers in the second type register set are registers which do not need to be saved in the kernel.
3. The method of claim 2, wherein selecting a set of context save/restore routines to save/restore registers in the set of registers in a kernel from a plurality of sets of context save/restore routines based on the number of registers in the set of registers comprises:
and selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the first register set in the kernel according to the number of the registers in the first type of register set.
4. The method of claim 2, further comprising:
and saving the registers in the second type register set in a user mode.
5. The method of any of claims 2-4, wherein the user mode code is assembly code at the system call portal;
when compiling is carried out through a compiler, register information which needs to be saved/restored when the system call is executed is coded into assembly codes at the entry of the system call as system call parameters.
6. The method of claim 1, wherein the current context switch scenario is a signal processing scenario, and wherein determining, based on the context switch scenario and the identified user state code, a set of registers that need to be saved/restored for performing the context switch scenario comprises:
acquiring register information transmitted into a kernel when a signal processing program is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the signal processing program is called;
and determining the register set which needs to be saved/restored in context switching according to the set information of the registers.
7. The method of claim 1, wherein the current context switch scenario is an interrupt handling scenario, and wherein determining, based on the context switch scenario and the identified user-state code, a set of registers that need to be saved/restored to execute the context switch scenario comprises:
acquiring register information transmitted into a kernel when an interrupt handler is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the interrupt processing program is called;
and determining the register set which needs to be saved/restored during the context switching according to the set information of the registers.
8. The method of claim 1, wherein the current context switch scenario is a remote procedure call scenario, and wherein determining, based on the context switch scenario and the identified user-state code, a set of registers that need to be saved/restored to perform the context switch scenario comprises:
acquiring register information transmitted into a kernel when a remote procedure call handler is registered to the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the remote procedure call processing program is called;
and determining the register set which needs to be saved/restored during the context switching according to the set information of the registers.
9. A method according to any of claims 6-8, wherein the user mode code is assembly code at the entry to the information handler, the remote procedure call handler or the interrupt handler;
when compiling is carried out through a compiler, the information of the register which needs to be saved/restored for executing the information processing program, the remote procedure call processing program and the interrupt processing program is coded into assembly codes at the inlets of the kernel call information processing program, the remote procedure call processing program and the interrupt processing program.
10. An operating system kernel switching device is characterized in that the operating system manages a plurality of registers and provides a plurality of groups of context saving/restoring programs in a kernel of the operating system; wherein each set of context save/restore procedures is for saving a different number of registers, the switching means comprising:
a request receiving unit, configured to receive a context switch request;
a target call determining unit, configured to obtain a current context switch scenario and a user mode code that needs to be identified for current context switch according to the context switch request; determining a register set which needs to be saved/restored for executing the context switching according to the context switching scene and the identified user mode code;
the execution unit is used for selecting a group of context saving/restoring programs from the plurality of groups of context saving/restoring programs according to the number of registers in the register set to save/restore the registers in the register set in the kernel; and the number of the registers capable of being saved by the selected context saving/restoring program is more than or equal to the number of the registers in the register set.
11. The apparatus of claim 10, further comprising: an access right judging unit for judging the access right,
when the acquired current context switching scene is a system calling scene, the request receiving unit is used for receiving a system calling request;
the access authority judging unit is used for checking the authority of the system caller;
the target call determining unit is used for dividing the context of the system call into a first register set and a second register set according to the identified user mode code information based on the system caller having the authority; the registers in the first type register set are registers which need to be saved in the kernel, and the registers in the second type register set are registers which do not need to be saved in the kernel.
12. The apparatus of claim 11, wherein the execution unit is configured to:
and selecting a group of context saving/restoring programs from the groups of context saving/restoring programs to save/restore the registers in the first register set in the kernel according to the number of the registers in the first type of register set.
13. The apparatus of claim 11, wherein the execution unit is further configured to:
and saving the registers in the second type register set in a user mode.
14. The apparatus according to any of claims 11-13, wherein the user mode code is assembly code at the system call portal;
when compiling is carried out through a compiler, register information which needs to be saved/restored when the system call is executed is coded into assembly codes at the entry of the system call as system call parameters.
15. The apparatus of claim 10, wherein the current context switch scenario is a signal processing scenario, and wherein the targeting unit is further configured to obtain kernel register information that is passed in when a signal handler is registered with a kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the signal processing program is called; and determining the register set which needs to be saved/restored during the context switching according to the set information of the registers.
16. The apparatus of claim 10, wherein the current context switch scenario is an interrupt handler scenario, and wherein the targeting unit is further configured to obtain register information that is passed into the kernel when an interrupt handler is registered with the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the interrupt processing program is called; and determining the register set which needs to be saved/restored during the context switching according to the set information of the registers.
17. The apparatus of claim 10, wherein the current context switch scenario is a remote procedure call scenario, and wherein the targeting unit is further configured to obtain register information that is passed into the kernel when the remote procedure call handler is registered with the kernel; the register information refers to a register set which needs to be saved/restored at an entrance of a program when the remote procedure call processing program is called; and determining the register set which needs to be saved/restored in context switching according to the set information of the registers.
18. An apparatus as claimed in any one of claims 15 to 17, wherein said user mode code is assembly code at the entry of said information handler, said remote procedure call handler or said interrupt handler;
when compiling is carried out through a compiler, the register information which needs to be saved/restored for executing the information processing program, the remote procedure call processing program and the interrupt processing program is coded into assembly codes at the entry of a kernel call information processing program, the remote procedure call processing program and the interrupt processing program.
19. A computer storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1-9.
20. A computer product containing instructions which, when run on a computer, cause the computer to carry out the method of any one of claims 1-9.
CN202111039645.2A 2021-09-06 Method and device for switching kernel of operating system Active CN115774574B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111039645.2A CN115774574B (en) 2021-09-06 Method and device for switching kernel of operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111039645.2A CN115774574B (en) 2021-09-06 Method and device for switching kernel of operating system

Publications (2)

Publication Number Publication Date
CN115774574A true CN115774574A (en) 2023-03-10
CN115774574B CN115774574B (en) 2024-06-04

Family

ID=

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5987495A (en) * 1997-11-07 1999-11-16 International Business Machines Corporation Method and apparatus for fully restoring a program context following an interrupt
CN102521537A (en) * 2011-12-06 2012-06-27 北京航空航天大学 Detection method and device for hidden process based on virtual machine monitor
US20150178078A1 (en) * 2013-12-21 2015-06-25 H. Peter Anvin Instructions and logic to provide base register swap status verification functionality
CN105579963A (en) * 2014-09-03 2016-05-11 华为技术有限公司 Task handling apparatus and method, and electronic device
CN107526622A (en) * 2017-08-16 2017-12-29 北方工业大学 Rapid exception handling method and device for Linux
CN110990180A (en) * 2019-11-28 2020-04-10 龙芯中科技术有限公司 TLB exception handling method and device, electronic device and storage medium
CN112395005A (en) * 2019-08-19 2021-02-23 无锡江南计算技术研究所 Performance optimization method for floating point SIMD context switching
CN113010275A (en) * 2019-12-20 2021-06-22 大唐移动通信设备有限公司 Interrupt processing method and device
CN113064697A (en) * 2021-04-01 2021-07-02 上海交通大学 Method for accelerating communication between microkernel processes by using multiple hardware characteristics

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5987495A (en) * 1997-11-07 1999-11-16 International Business Machines Corporation Method and apparatus for fully restoring a program context following an interrupt
CN102521537A (en) * 2011-12-06 2012-06-27 北京航空航天大学 Detection method and device for hidden process based on virtual machine monitor
US20150178078A1 (en) * 2013-12-21 2015-06-25 H. Peter Anvin Instructions and logic to provide base register swap status verification functionality
CN105579963A (en) * 2014-09-03 2016-05-11 华为技术有限公司 Task handling apparatus and method, and electronic device
CN107526622A (en) * 2017-08-16 2017-12-29 北方工业大学 Rapid exception handling method and device for Linux
CN112395005A (en) * 2019-08-19 2021-02-23 无锡江南计算技术研究所 Performance optimization method for floating point SIMD context switching
CN110990180A (en) * 2019-11-28 2020-04-10 龙芯中科技术有限公司 TLB exception handling method and device, electronic device and storage medium
CN113010275A (en) * 2019-12-20 2021-06-22 大唐移动通信设备有限公司 Interrupt processing method and device
CN113064697A (en) * 2021-04-01 2021-07-02 上海交通大学 Method for accelerating communication between microkernel processes by using multiple hardware characteristics

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
阎栋;王屏;李恺威;边哲;: "可定制的应用运行环境", 中国科技论文, 15 July 2013 (2013-07-15), pages 648 - 655 *

Similar Documents

Publication Publication Date Title
US4442484A (en) Microprocessor memory management and protection mechanism
US8429669B2 (en) Virtual machine switching control by prefetching information out of and updating a set of processor control information based on a bitmap having update status
US7406699B2 (en) Enhanced runtime hosting
US8832666B2 (en) Dynamic instrumentation
US9384049B2 (en) Preventing unnecessary context switching by employing an indicator associated with a lock on a resource
KR20070095395A (en) Multi-processor system and program for computer to carry out a control method of interrupting multi-processor system
CN107797848B (en) Process scheduling method and device and host equipment
US20040117793A1 (en) Operating system architecture employing synchronous tasks
US10540156B2 (en) Parallelization method, parallelization tool, and in-vehicle device
Dietrich et al. Cross-Kernel Control-Flow--Graph Analysis for Event-Driven Real-Time Systems
EP1820100B1 (en) Efficient switching between prioritized tasks
US20120304185A1 (en) Information processing system, exclusive control method and exclusive control program
US8732371B2 (en) Managing overhead associated with service requests via software generated interrupts
CN111061485A (en) Task processing method, compiler, scheduling server, and medium
US11216278B2 (en) Multi-thread processing
JP4897851B2 (en) Computer system and computer system control method
US20210247991A1 (en) Simulation method and simulation system
CN115774574B (en) Method and device for switching kernel of operating system
CN115774574A (en) Operating system kernel switching method and device
US20060174248A1 (en) Software tool for automatically protecting shared resources within software source code
CN107239415B (en) Method and device for executing critical section operation
Lister et al. Hierarchical monitors
Danmin et al. A formal specification in B of an operating system
US5212779A (en) System for guarantee reexecution after interruption by conditionally used store buffer if microinstruction being executed is a memory write and last microinstruction
US20030126520A1 (en) System and method for separating exception vectors in a multiprocessor data processing system

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
GR01 Patent grant