The prototype of the domestic OS Phantom based on Genode will be ready before the end of the year

Dmitry Zavalishin spoke about the project of porting the virtual machine of the Phantom operating system to work in the Genode microkernel OS environment. The interview notes that the main version of Phantom is already ready for pilot projects, and the version based on Genode will be brought to readiness for use at the end of the year. At the same time, only a workable conceptual prototype has been announced on the project website so far, the stability and functionality of which have not been brought to a level suitable for industrial use, and among the nearest plans is the formation of an alpha version suitable for experiments by third-party developers.

The project code is distributed under the LGPL license, but the last change in the main repository is dated November 2019. The public activity related to the project is concentrated in the repository with a fork for Genode, which since December 2020 has been maintained by Anton Antonov, a student from Innopolis University.

Since the early 2000s, the Phantom operating system has been developed as a personal project of Dmitry Zavalishin, and since 2010 it has been transferred under the wing of the Digital Zone company created by Dmitry. The system is notable for its focus on high reliability and the use of the concept of "everything is an object" instead of "everything is a file", which eliminates the use of files due to the preservation of memory state and a continuous cycle of work. Applications in the Phantom are not terminated, but only paused and resumed from where they left off. All variables and data structures can be stored for as long as the application needs, and the programmer does not have to take special care to save the data.

Applications in Phantom are compiled into bytecode, which runs in a stack-based virtual machine, similar to the Java virtual machine. The virtual machine provides application memory persistence - the system periodically flushes snapshots of the state of the virtual machine to persistent media. After shutdown or crash, work can be continued starting from the last saved memory snapshot. Snapshots are created asynchronously and without suspending the virtual machine, but a snapshot captures a one-time slice, as if the virtual machine was stopped, saved to disk, and started again.

All applications run in a common global address space, which eliminates the need for context switches between the kernel and applications, and greatly simplifies and speeds up communication between applications running in a virtual machine that can exchange objects through reference passing. Separation of access is carried out at the level of objects, references to which can only be obtained by calling the corresponding methods (there is no pointer arithmetic). Any data, including numeric values, is treated as separate objects.

For the application, the work looks continuous and does not depend on OS reboots, crashes, and computer shutdowns. The programming model for Phantom is compared to running a never-stopping application server for an object programming language. Porting Java programs for Phantom is considered as one of the main ways to develop applications, which is facilitated by the similarity of the Phantom virtual machine with the JVM. In addition to the bytecode compiler for the Java language, the project plans to create compilers for Python and C#, as well as the implementation of a translator from the WebAssembly intermediate code.

To perform operations that require high performance, such as video and audio processing, it is possible to run binary objects with native code in separate threads (LLVM is used to build binary objects). To access low-level kernel services, some VM classes (β€œinternal” classes) are implemented at the OS kernel level. To run Linux applications, a POSIX layer is provided that emulates the calls necessary for the operation of Unix processes (persistence for applications in the POSIX layer is not yet provided).

The prototype of the domestic OS Phantom based on Genode will be ready before the end of the year

The traditional Phantom OS, in addition to the virtual machine, includes its own kernel with the implementation of threads, a memory manager, a garbage collector, synchronization mechanisms, an I / O system, and drivers for working with equipment, which significantly complicates bringing the project to readiness for widespread use. Separately, components with a network stack, a graphic subsystem and a user interface are being developed. It is noteworthy that the graphics subsystem and the window manager work at the kernel level.

To improve the stability, portability and security of the project, an attempt was made to transfer the Phantom virtual machine to work using the components of the open microkernel operating system Genode, the development of which is supervised by the German company Genode Labs. For those who want to experiment with Phantom based on Genode, a special build environment based on Docker has been prepared.

Using Genode will make it possible to use already tested microkernels and drivers, as well as to bring drivers into user space (in their current form, the drivers are written in C and run at the Phantom kernel level). In particular, it will be possible to use the seL4 microkernel, which has passed mathematical verification of reliability, confirming that the implementation fully complies with the specifications specified in the formal language. The possibility of preparing a similar proof of reliability for the Phantom virtual machine is being considered, which will allow verification of the entire OS environment.

The main application area of ​​the Genode-based port is the development of applications for various industrial and embedded devices. At present, a set of changes for the virtual machine has already been prepared and bindings running on top of Genode have been added for the persistence components of the kernel and the main low-level interfaces. It is noted that the Phantom virtual machine can already work in a 64-bit Genode environment, but the VM has yet to be implemented in persistence mode, the driver subsystem has to be reworked, and components with a network stack and a graphics subsystem have to be adapted for Genode.

The prototype of the domestic OS Phantom based on Genode will be ready before the end of the year
The prototype of the domestic OS Phantom based on Genode will be ready before the end of the year
The prototype of the domestic OS Phantom based on Genode will be ready before the end of the year


Source: opennet.ru

Add a comment