{"id":31751980,"url":"https://github.com/petitstrawberry/scarlet","last_synced_at":"2026-02-08T10:01:34.944Z","repository":{"id":280476383,"uuid":"938193966","full_name":"petitstrawberry/Scarlet","owner":"petitstrawberry","description":"[WIP] A kernel in Rust designed to provide a universal, multi-ABI container runtime. ","archived":false,"fork":false,"pushed_at":"2026-02-05T00:31:15.000Z","size":16226,"stargazers_count":42,"open_issues_count":28,"forks_count":1,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2026-02-05T02:30:30.796Z","etag":null,"topics":["aarch64","arm64","kernel","os","riscv","rust"],"latest_commit_sha":null,"homepage":"http://docs.scarlet-os.org/kernel/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petitstrawberry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-24T15:12:48.000Z","updated_at":"2026-02-04T15:09:33.000Z","dependencies_parsed_at":"2025-03-03T17:21:54.409Z","dependency_job_id":"1f4b1d66-dd13-4512-bbb2-de7ac311a2f3","html_url":"https://github.com/petitstrawberry/Scarlet","commit_stats":null,"previous_names":["petitstrawberry/scarlet"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/petitstrawberry/Scarlet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petitstrawberry%2FScarlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petitstrawberry%2FScarlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petitstrawberry%2FScarlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petitstrawberry%2FScarlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petitstrawberry","download_url":"https://codeload.github.com/petitstrawberry/Scarlet/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petitstrawberry%2FScarlet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29227379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T09:43:19.170Z","status":"ssl_error","status_checked_at":"2026-02-08T09:42:55.556Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aarch64","arm64","kernel","os","riscv","rust"],"created_at":"2025-10-09T16:54:11.094Z","updated_at":"2026-02-08T10:01:34.937Z","avatar_url":"https://github.com/petitstrawberry.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scarlet\n\n\u003cdiv align=\"center\"\u003e\n  \n**A kernel in Rust designed to provide a universal, multi-ABI container runtime.**\n\n[![Version](https://img.shields.io/badge/version-0.16.0-blue.svg)](https://github.com/petitstrawberry/Scarlet)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![RISC-V](https://img.shields.io/badge/arch-RISC--V%2064-green)](https://riscv.org/)\n[![AArch64](https://img.shields.io/badge/arch-AArch64-orange)](https://www.arm.com/)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/petitstrawberry/Scarlet)\n\n\u003c/div\u003e\n\n## Overview\n\nScarlet is an operating system kernel written in Rust that implements native ABI support for executing binaries across different operating systems and architectures. The kernel provides a universal container runtime environment with strong isolation capabilities, comprehensive filesystem support, dynamic linking, and modern graphics capabilities.\n\n## Quick Start\n\n### Try Scarlet Now\n\n```bash\n# Get started with Docker (recommended)\ndocker build -t scarlet-dev .\ndocker run -it --rm -v $(pwd):/workspaces/Scarlet scarlet-dev bash -c \"cargo make run-riscv64\"\n\n# Once Scarlet boots, you'll see:\nLogin successful for user: root\nScarlet Shell (Interactive Mode)\n# \n\n# Try Scarlet native binaries:\n# hello\nHello, world!\nPID  = 5\nPPID = 3\n# Enter xv6 environment (experimental ABI):\n# xv6\nxv6 container\nPreparing to execute xv6 init...\ninit: starting sh\n$ \n\n# Try xv6 binaries:\n$ echo hello from xv6!\nhello from xv6!\n\n# Cross-ABI execution - xv6 calling Scarlet binary with pipe!\n$ /scarlet/system/scarlet/bin/hello | cat\nHello, world!\nPID  = 10\nPPID = 9\n```\n\n### Run Linux Userspace Demo (Partial Linux ABI)\n\nSee [Linux ABI Demo instructions](docs/abi/linux/demo.md) for detailed instructions on building and running the Linux userspace demo.\n\n```bash\n# Quick summary (inside scarlet-dev container):\n# For RISC-V (default)\nbash tools/linux/build_buildroot.sh\nbash tools/linux/build_user_programs.sh\nbash tools/linux/deploy_rootfs.sh\ncargo make run-riscv64\n```\n\nThese commands rebuild the Buildroot-based Linux rootfs (providing standard utilities via BusyBox) and optional demo binaries, showcasing the initial Linux ABI support alongside Scarlet and xv6.\n\n### Cross-ABI Execution Showcase\n\nScarlet allows binaries from different operating systems to coexist and communicate via standard Unix pipes. This is not virtualization—it is a unified kernel handling multiple ABIs natively.\n\n```bash\n# ✅ Working Now: xv6 shell executing a Scarlet native binary\n# The output from 'hello' (Scarlet ABI) is piped to 'cat' (xv6 ABI)\n(xv6)$ /scarlet/system/scarlet/bin/hello | cat\nHello, world!\nPID  = 10\nPPID = 9\n\n# 🚧 In Progress: Linux ABI Integration\n# We are expanding this capability to include Linux binaries (via BusyBox):\n(scarlet)$ scarlet_cat /etc/passwd | /system/linux-riscv64/bin/busybox grep \"root\" | xv6_wc -l\n```\n\nThis interoperability is possible because all ABIs share the same underlying kernel objects (VFS, pipes, task structures). The goal is a seamless environment where you can use the best tool for the job, regardless of which OS it was originally written for.\n\n\u003e **Current Status**: \n\u003e - ✅ **Scarlet Native ABI**: Fully implemented with interactive shell\n\u003e - 🧪 **xv6 RISC-V 64-bit ABI**: Working with Cross-ABI execution capabilities!\n\u003e - 🧩 **Linux RISC-V 64-bit ABI (partial)**: Buildroot-based userland demo available; syscall coverage expanding\n\u003e - ✅ **Cross-ABI Pipes**: Already functional between xv6 and Scarlet environments\n\n\n## Key Features\n\n- **Multi-ABI Support**: Transparent execution of binaries from different operating systems\n- **Runtime Delegation**: Execute binaries via userland runtimes (Wasm, emulators, etc.) - [Details](docs/runtime-delegation.md)\n- **Service Management**: Stem daemon (stemd) provides systemd-like service management with dependency resolution - [Details](docs/stemd.md)\n- **Container Runtime**: Complete filesystem isolation with namespace support\n- **Dynamic Linking**: Native dynamic linker support for shared libraries and position-independent executables\n- **Advanced VFS**: Modern virtual filesystem with ext2, FAT32, overlay, bind mount, and device file support\n- **Graphics Support**: Framebuffer device support with graphics hardware abstraction\n- **Windowing / UI (in progress)**: SWS protocol + client libraries - [Protocol](docs/sws_ipc_protocol.md), [sws-client](docs/sws_client.md), [scarlet-ui](docs/scarlet_ui.md)\n- **System Integration**: TTY devices, interrupt handling, and comprehensive device management\n- **Task Management**: Full task lifecycle with environment variables and IPC pipes\n- **Event System**: Advanced IPC with event-driven communication and synchronization\n- **Memory Safety**: Built with Rust's safety guarantees for reliable system operation\n- **RISC-V Ready**: Native support for RISC-V 64-bit architecture\n\n## ABI Module System\n\nScarlet's Multi-ABI support is built around a modular ABI implementation system:\n\n### How It Works\n\n- **Binary Detection**: Automatic identification of binary format and target ABI\n- **Native Implementation**: Each ABI module implements its own syscall interface using shared kernel APIs\n- **Shared Kernel Resources**: All ABIs operate on common kernel objects (VFS, memory, devices, etc.)\n\n### ABI Modules\n\n- **Scarlet Native**: ✅ Complete - Direct kernel interface with optimal performance\n- **xv6 RISC-V 64-bit**: 🧪 Experimental - Largely implemented with core functionality available\n- **Linux RISC-V 64-bit (partial)**: 🧩 Early userland demo via Buildroot rootfs; syscall surface expanding toward full POSIX support\n\nThis architecture enables true containerization where applications from different operating systems can coexist and communicate without modification.\n\n### ABI Implementation Details\n\n#### xv6 RISC-V 64-bit (Experimental)\n\nThe xv6 ABI implementation is currently available as an experimental feature:\n\n- **Testing Ready**: Core functionality is stable and ready for testing\n- **Binary Compatibility**: Included xv6 binaries (`cat`, `grep`, `wc`, `sh`, etc.) work correctly\n- **Cross-ABI Communication**: Pipes and IPC work seamlessly with other ABI implementations\n- **Production Note**: While functional, this is an experimental implementation subject to changes\n\n#### Linux ABI (Partial)\n\nThe Linux ABI implementation is currently in active development:\n\n- **Userspace Support**: Runs simple static binaries and Buildroot/BusyBox environments.\n- **Syscall Coverage**: Basic file I/O, process management, and memory operations are implemented.\n- **Limitations**: Many advanced syscalls (networking, complex signals) are stubbed or missing. See [`docs/abi/linux/status.md`](docs/abi/linux/status.md) for the compatibility matrix.\n\n## Architecture Support\n\nScarlet supports multiple CPU architectures with a unified codebase:\n\n- **RISC-V 64-bit** - Primary development platform, fully supported\n- **AArch64 (ARM 64-bit)** - In development, basic support available\n\nThe kernel includes hardware abstraction layers for interrupt handling, memory management, graphics/framebuffer support, and device drivers that work across both architectures.\n\n### Building for Different Architectures\n\n```bash\n# RISC-V (default)\ncargo make build\ncargo make run-riscv64\n\n# AArch64\nARCH=aarch64 cargo make build\ncargo make run-aarch64\n```\n\nSee [Multi-Architecture Support documentation](docs/multi-architecture.md) for detailed information on cross-architecture development.\n\n## Filesystem Support\n\nScarlet implements a modern Virtual File System (VFS v2) with support for multiple filesystem types and container isolation:\n\n### Supported Filesystems\n\n- **TmpFS**: Memory-based temporary filesystem\n- **CpioFS**: Read-only CPIO archive filesystem for initramfs\n- **ext2**: Full ext2 filesystem implementation for persistent storage\n- **FAT32**: Complete FAT32 filesystem support\n- **OverlayFS**: Union filesystem combining multiple layers\n- **DevFS**: Device file system for hardware access\n\n### Container Features\n\n- **Mount Namespace Isolation**: Per-task filesystem namespaces\n- **Bind Mount Operations**: Directory mounting across namespaces\n- **Overlay Support**: Layered filesystems with copy-on-write semantics\n\n## Development\n\n### Docker Environment (Recommended)\n\n```bash\n# Build and run development container\ndocker build -t scarlet-dev .\ndocker run -it --rm -v $(pwd):/workspaces/Scarlet scarlet-dev\n\n# Common commands:\ncargo make run-riscv64                        # Build (release) and run (RISC-V)\ncargo make test-riscv64               # Run tests (RISC-V)\ncargo make debug-riscv64              # Debug with GDB\n```\n\n### Local Development\n\nRequirements: Rust nightly, `cargo-make`, `qemu`, RISC-V toolchain\n\n### Build Commands\n\n```bash\n# Full build (RISC-V, debug)\ncargo make build-riscv64\n\n# Individual components\ncargo make build-kernel-debug-riscv64     # Kernel only\ncargo make build-userlib-debug-riscv64    # User space library\ncargo make build-userbin-debug-riscv64    # User programs\ncargo make build-initramfs-debug-riscv64  # Initial RAM filesystem\ncargo make build-rootfs-riscv64           # Root filesystem image\n\n# Clean build artifacts\ncargo make clean-riscv64\n```\n\n### Testing and Debugging\n\n```bash\n# Run all tests\ncargo make test-riscv64\n\n# Debug kernel with GDB\ncargo make debug-riscv64\n# Then in another terminal: gdb and connect to :1234\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Documentation\n\nFor more detailed information about the Scarlet kernel, visit our documentation:\n- [Scarlet Documentation](https://docs.scarlet.ichigo.dev/kernel)\n- [Linux ABI Demo](docs/abi/linux/demo.md)\n- [Linux userspace artifacts (Buildroot + optional binaries)](docs/abi/linux/userspace-artifacts.md)\n- [Linux rootfs deployment guide](docs/abi/linux/deployment.md)\n- [Linux ABI support status and roadmap](docs/abi/linux/status.md)\n\n### Generating Documentation\n\nTo generate the documentation, run:\n\n```bash\n# Generate documentation\ncargo make doc-riscv64      # Generate docs for all components (RISC-V)\ncargo make doc-kernel      # Generate kernel docs only\ncargo make doc-userlib     # Generate user library docs only\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetitstrawberry%2Fscarlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetitstrawberry%2Fscarlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetitstrawberry%2Fscarlet/lists"}