{"id":13412196,"url":"https://github.com/nuta/kerla","last_synced_at":"2025-04-10T15:33:15.840Z","repository":{"id":37670231,"uuid":"368522797","full_name":"nuta/kerla","owner":"nuta","description":"A new operating system kernel with Linux binary compatibility written in Rust.","archived":false,"fork":false,"pushed_at":"2024-11-11T00:45:43.000Z","size":2672,"stargazers_count":3390,"open_issues_count":27,"forks_count":86,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-04-03T10:34:03.754Z","etag":null,"topics":["operating-system","operating-system-kernel","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-18T12:32:54.000Z","updated_at":"2025-03-25T21:44:33.000Z","dependencies_parsed_at":"2024-01-08T07:57:20.751Z","dependency_job_id":"9dba19a4-714d-4c69-baf0-b8e904356c8e","html_url":"https://github.com/nuta/kerla","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuta%2Fkerla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuta%2Fkerla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuta%2Fkerla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuta%2Fkerla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuta","download_url":"https://codeload.github.com/nuta/kerla/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243471,"owners_count":21071054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["operating-system","operating-system-kernel","rust"],"created_at":"2024-07-30T20:01:22.012Z","updated_at":"2025-04-10T15:33:15.812Z","avatar_url":"https://github.com/nuta.png","language":"Rust","readme":"# Kerla\n\n![screenshot](screenshot.png)\n\nKerla is a monolithic operating system kernel written from scratch in Rust which aims to be\ncompatible with the Linux ABI, that is, it runs Linux binaries without any modifications.\n\n- Implements *NIX process concepts: context switching, signals, `fork(2)`, `execve(2)`, `wait4(2)`, etc.\n- Supports commonly used system calls like `write(2)`, `stat(2)`, `mmap(2)`, `pipe(2)`, `poll(2)`, ...\n- No disk support for now: initramfs is mounted as the root file system.\n- Pseudo file systems: tmpfs and devfs.\n- [smoltcp](https://github.com/smoltcp-rs/smoltcp)-based TCP/IP support.\n- Implements tty and pseudo terminal (pty).\n- Supports QEMU and Firecracker (with virtio-net device driver).\n- Supports x86_64.\n- Docker-based initramfs build system.\n\n***Check out [my blog post](https://seiya.me/writing-linux-clone-in-rust) for motivation and my thoughts on writing an OS kernel in Rust.***\n\n\u003e [!IMPORTANT]\n\u003e \n\u003e This software is no longer maintained. If you are interested in a modern OS written in Rust, check out my new project **[Starina](https://starina.dev)**.\n\n## Demo: SSH into Kerla!\n\nYou can play with Kerla over ssh. Your login is not visible from others (except\nme): we automatically launch a dedicated microVM on Firecracker for each TCP\nconnection.\n\n```\n$ ssh root@demo.kerla.dev\n```\n\nIf you found bugs or missing features, let me know on GitHub issues :)\n\n## Running a Docker Image (experimental)\n\nYou can run a Docker image as a root file system (not as a container!) on Kerla Kernel instead of our initramfs built from `initramfs` directory.\n\nFor example, to run [nuta/helloworld](https://hub.docker.com/r/nuta/helloworld) image ([Dockerfile](https://gist.github.com/nuta/4c9ecd0d1a401dc5be88095bea5a991a)), try the following command:\n\n```\n$ make IMAGE=nuta/helloworld run\n...\n[   0.029] syscall: execve(439398, 4393b8, 4393c8, 8, 2f2f2f2f2f2f2f2f, 8080808080808080)\n[   0.030] syscall: arch_prctl(1002, 4055d8, 0, 20000, 0, ff)\n[   0.031] syscall: set_tid_address(4057f0, 4055d8, 0, 20000, 0, ff)\n[   0.033] syscall: ioctl(1, 5413, 9ffffeed0, 1, 405040, 9ffffeef7)\n\n _          _ _                            _     _ _\n| |__   ___| | | ___   __      _____  _ __| | __| | |\n| '_ \\ / _ \\ | |/ _ \\  \\ \\ /\\ / / _ \\| '__| |/ _` | |\n| | | |  __/ | | (_) |  \\ V  V / (_) | |  | | (_| |_|\n|_| |_|\\___|_|_|\\___/    \\_/\\_/ \\___/|_|  |_|\\__,_(_)\n```\n\nThis feature is in a very early stage and I guess **almost all images out there won't work** because:\n\n- They tend to be too large to be embedded into the kernel image.\n- They might use unimplemented features (e.g. position-independent executables used in Alpine Linux).\n\n## Building and Running the OS\n\nSee [Quickstart](https://kerla.dev/docs/quickstart.html) for instructions on building from source, running on emulators, etc.\n\n## Current Roadmap\n[Roadmap - Run a Node.js Web Application on Kerla on Firecracker on AWS](https://github.com/nuta/kerla/projects/1)\n\n## Compatibility\n\nSee [here](https://github.com/nuta/kerla/blob/main/Documentation/compatibility.md) for the current status.\n\n## Contributing\n\nSend me bug reports, feature requests, and patches on [GitHub](https://github.com/nuta/kerla) for example:\n\n- **Implementing missing features:** majority of existing Linux applications won't work due to the lack of features.\n- **Writing documentation:** I think Kerla could be good material to learn how an operating system kernel works.\n- **Trying to experiment with Rust-y ideas:** for example currently I'm interested in [GhostCell](http://plv.mpi-sws.org/rustbelt/ghostcell/).\n\n## License\n\nSee [LICENSE.md](https://github.com/nuta/kerla/blob/main/LICENSE.md).\n\n## Related Work\n\nEmulating Linux ABI is not a novel work. Some UNIX-like kernels like [FreeBSD](https://docs.freebsd.org/en_US.ISO8859-1/articles/linux-emulation/article.html) and [NetBSD](https://www.netbsd.org/docs/guide/en/chap-linux.html) already have their own Linux emulation layers. Windows has a well-known feature called [Windows Subsystem for Linux (WSL)](https://github.com/microsoft/WSL) which enables running Linux binaries seamlessly. WSL 1 implements the feature by ABI emulation. WSL 2 runs the real Linux kernel using the hardware-accelerated virtualization (Hyper-V).\n\nAside from general-purpose operating systems, there're some attractive projects related to the Linux ABI emualtion. [OSv](https://github.com/cloudius-systems/osv/wiki/OSv-Linux-ABI-Compatibility) is a unikernel which runs unmodified Linux binaries. [rCore](https://github.com/rcore-os/rCore) is a teaching operating system which implements the Linux ABI in Rust. [Noah](https://dl.acm.org/doi/10.1145/3381052.3381327) suggests an intriguing approach to run unmodified Linux binaries on macOS.\n","funding_links":[],"categories":["Rust","Operating Systems"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuta%2Fkerla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuta%2Fkerla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuta%2Fkerla/lists"}