TECHNICAL FIELD

This disclosure generally relates to operating systems.

BACKGROUND

An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources. For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer—from cellular phones and video game consoles to web servers and supercomputers.

In computing, a process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently. While a computer program is a passive collection of instructions, a process is the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often results in more than one process being executed. Process management is an integral part of any modern-day operating system (OS). The OS must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronization among processes. To meet these requirements, the OS must maintain a data structure for each process, which describes the state and resource ownership of that process, and which enables the OS to exert control over each process.

SUMMARY OF PARTICULAR EMBODIMENTS

In particular embodiments, an operating system of a computing system may effectively recover a crashed service in a microkernel without restarting the operating system. The operating system may run multiple services but if some of them ever crash or have to be restarted, the relevant data may be lost which may be detrimental for the operating system if the system has to be restarted. To address such issue, the embodiments disclosed herein may build a resilient operating system that can restart a crashed service and restore its pre-crash state without restarting the operating system. The essential technique may include maintaining the state of each service by establishing a special contract with the microkernel through an API provided by the microkernel. The contract may provide special pages of memory where the service can checkpoint its state, specifically a state that cannot be recovered automatically. In addition, the pages provided to one service may be separated from the pages provided to other services so there is less chance of corrupting the state if there is a crash. As an example and not by way of limitation, a launcher service in the operating system may be responsible for keeping track of all the services that have been launched and are currently actively running. When the operating system implements the service list, it may request the launcher service to iterate all the services that have been launched. When there is a crash, the operating system may, via a kernel API, find the checkpoint for the launcher service in the same page or set of pages and obtain a handle to the checkpoint. During the restarting of the launcher service, the loader service would transfer the handle to the newly-started launcher service. Through the handle, the launcher service could retrieve its state prior to crashing. Although this disclosure describes restoring particular state via particular systems in particular manners, this disclosure contemplates restoring any suitable state via any suitable system in any suitable manner.

In particular embodiments, the operation system may generate, for a first service, a handle that references a checkpoint. The operating system may then send the handle to the first service. The handle may be configured to be used by the first service to store one or more states of the service in the checkpoint. In particular embodiments, the operating system may determine that the first service needs to be restarted. The operating system may then restart the first service. The operating system may further access the handle for the checkpoint. In particular embodiments, the operating system may send the handle for the checkpoint to the restarted first service. The handle for the checkpoint may be configured to be used by the restarted first service to restore the one or more states.

Embodiments of the invention may include or be implemented in conjunction with an artificial reality system. Artificial reality is a form of reality that has been adjusted in some manner before presentation to a user, which may include, e.g., a virtual reality (VR), an augmented reality (AR), a mixed reality (MR), a hybrid reality, or some combination and/or derivatives thereof. Artificial reality content may include completely generated content or generated content combined with captured content (e.g., real-world photographs). The artificial reality content may include video, audio, haptic feedback, or some combination thereof, and any of which may be presented in a single channel or in multiple channels (such as stereo video that produces a three-dimensional effect to the viewer). Additionally, in some embodiments, artificial reality may be associated with applications, products, accessories, services, or some combination thereof, that are, e.g., used to create content in an artificial reality and/or used in (e.g., perform activities in) an artificial reality. The artificial reality system that provides the artificial reality content may be implemented on various platforms, including a head-mounted display (HMD) connected to a host computer system, a standalone HMD, a mobile device or computing system, or any other hardware platform capable of providing artificial reality content to one or more viewers.

The embodiments disclosed herein are only examples, and the scope of this disclosure is not limited to them. Particular embodiments may include all, some, or none of the components, elements, features, functions, operations, or steps of the embodiments disclosed herein. Embodiments according to the invention are in particular disclosed in the attached claims directed to a method, a storage medium, a system and a computer program product, wherein any feature mentioned in one claim category, e.g. method, can be claimed in another claim category, e.g. system, as well. The dependencies or references back in the attached claims are chosen for formal reasons only. However any subject matter resulting from a deliberate reference back to any previous claims (in particular multiple dependencies) can be claimed as well, so that any combination of claims and the features thereof are disclosed and can be claimed regardless of the dependencies chosen in the attached claims. The subject-matter which can be claimed comprises not only the combinations of features as set out in the attached claims but also any other combination of features in the claims, wherein each feature mentioned in the claims can be combined with any other feature or combination of other features in the claims. Furthermore, any of the embodiments and features described or depicted herein can be claimed in a separate claim and/or in any combination with any embodiment or feature described or depicted herein or with any of the features of the attached claims.

