The Kerla project is developing Linux-compatible core in the Rust language

The Kerla project is developing an operating system kernel written in Rust. The new kernel is initially focused on ensuring compatibility with the kernel Linux at the ABI level, which will allow unmodified executable files compiled for Kerla to run in a Kerla-based environment. LinuxThe code is distributed under the Apache 2.0 and MIT licenses. The project is being developed by Japanese developer Seiya Nuta, known for creating the Resea microkernel operating system, written in C.

At the current stage of development, Kerla can only run on x86_64 systems and implements basic system calls such as write, stat, mmap, pipe, and poll, supports signals, unnamed pipes, and context switches. For process management, calls such as fork, wait4, and execve are provided. There is support for tty and pseudo-terminals (pty). Of the file systems, initramfs (used to mount the root FS), tmpfs and devfs are still supported. A network stack is provided with support for TCP and UDP sockets, implemented on the basis of the smoltcp library.

The developer has prepared a boot environment that can be launched in QEMU or in virtual machine Firecracker with the virtio-net driver, which can now be connected to via SSH. It uses musl as the system library, and BusyBox as the user-space utilities.

The Kerla project is developing Linux-compatible core in the Rust language

Based on Docker, a build system has been prepared that allows you to create your own boot initramfs with the Kerla core. The fish-like nsh shell and the Kazari GUI stack based on the Wayland protocol are being developed separately.

The Kerla project is developing Linux-compatible core in the Rust language

Using the Rust language in a project reduces the number of bugs in the code by applying safe coding techniques and improving the efficiency of identifying problems when working with memory. Memory safety is provided in Rust at compile time through reference checking, keeping track of object ownership and object lifetime (scope), as well as through evaluation of the correctness of memory access during code execution. In addition, Rust provides protection against integer overflows, requires mandatory initialization of variable values ​​before use, applies the concept of immutable references and variables by default, offers strong static typing to minimize logical errors, and simplifies input value processing through pattern matching facilities. .

For the development of low-level components, such as the OS kernel, Rust provides support for raw pointers, structure packing, assembler inline inserts, and assembler file inlining. To work without being tied to the standard library, there are separate crate packages for performing operations on strings, vectors, and bit flags. Among the advantages, there are also built-in tools for assessing code quality (linter, rust-analyzer) and creating unit tests that can be run not only on real hardware, but also in QEMU.

Source: opennet.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster