Convert Figma logo to code with AI

SerenityOS logoserenity

The Serenity Operating System 🐞

30,369
3,176
30,369
756

Top Related Projects

178,031

Linux kernel source tree

14,402

A free Windows-compatible Operating System

1,854

The Haiku operating system. (Pull requests will be ignored; patches may be sent to https://review.haiku-os.org).

2,715

Minoca operating system

1,438

A distributed operating system

Quick Overview

SerenityOS is an open-source operating system and graphical user interface inspired by classic desktop environments of the 1990s. It aims to provide a modern, Unix-like experience with a focus on aesthetics, functionality, and developer-friendliness. SerenityOS is written from scratch in C++ and includes its own kernel, userland, and desktop environment.

Pros

  • Unique and nostalgic user interface design reminiscent of classic operating systems
  • Comprehensive system built entirely from scratch, providing full control over the entire stack
  • Active development with a growing community of contributors
  • Educational resource for learning about operating system internals and low-level programming

Cons

  • Limited hardware support compared to mainstream operating systems
  • Not suitable for daily use as a primary operating system for most users
  • Steep learning curve for contributors due to the complexity of operating system development
  • Lack of compatibility with common software and drivers

Getting Started

As SerenityOS is an operating system rather than a code library, there isn't a traditional "getting started" section for developers to integrate it into their projects. However, if you're interested in trying out SerenityOS or contributing to its development, you can follow these steps:

  1. Visit the official GitHub repository: https://github.com/SerenityOS/serenity
  2. Read the README.md file for detailed information on building and running SerenityOS
  3. Follow the build instructions for your host operating system (Linux, macOS, or Windows)
  4. Run SerenityOS in a virtual machine or on supported hardware
  5. Join the Discord community for support and discussions: https://discord.gg/serenityos

Note that building and running SerenityOS requires some technical knowledge and may not be suitable for all users. It's primarily intended for developers, operating system enthusiasts, and those interested in learning about OS development.

Competitor Comparisons

178,031

Linux kernel source tree

Pros of Linux

  • Massive community support and extensive documentation
  • Wide hardware compatibility and driver support
  • Battle-tested in production environments for decades

Cons of Linux

  • Complex codebase with a steep learning curve for new contributors
  • Slower development cycle due to rigorous review process
  • Legacy code and compatibility requirements can hinder innovation

Code Comparison

Linux (kernel/sched/core.c):

static void __sched notrace __schedule(bool preempt)
{
    struct task_struct *prev, *next;
    unsigned long *switch_count;
    struct rq *rq;
    int cpu;

Serenity (Kernel/Scheduler.cpp):

void Scheduler::pick_next()
{
    VERIFY_INTERRUPTS_DISABLED();
    VERIFY(!s_active_thread || s_active_thread == Thread::current());
    VERIFY(g_scheduler_lock.is_locked());

The Linux code snippet shows the core scheduling function, while Serenity's code demonstrates the next thread selection process. Linux uses C, while Serenity uses C++. Serenity's code includes more assertions and checks, reflecting its focus on correctness and debugging.

14,402

A free Windows-compatible Operating System

Pros of ReactOS

  • Aims for Windows compatibility, potentially supporting a wider range of existing software
  • Longer development history, with a more established community and codebase
  • More extensive hardware support due to its focus on real-world compatibility

Cons of ReactOS

  • Less modern design philosophy compared to SerenityOS's fresh approach
  • Slower development pace due to the complexity of reverse-engineering Windows
  • More constrained by legacy design decisions to maintain compatibility

Code Comparison

ReactOS (C-style API):

NTSTATUS NTAPI NtCreateFile(
    PHANDLE FileHandle,
    ACCESS_MASK DesiredAccess,
    POBJECT_ATTRIBUTES ObjectAttributes,
    PIO_STATUS_BLOCK IoStatusBlock,
    PLARGE_INTEGER AllocationSize,
    ULONG FileAttributes,
    ULONG ShareAccess,
    ULONG CreateDisposition,
    ULONG CreateOptions,
    PVOID EaBuffer,
    ULONG EaLength
);

SerenityOS (C++ API):

ErrorOr<NonnullRefPtr<File>> File::open(String const& filename, int options, mode_t mode)
{
    auto custody_or_error = VFS::the().resolve_path(filename, current_directory());
    if (custody_or_error.is_error())
        return custody_or_error.error();
    return File::open(custody_or_error.value(), options, mode);
}

This comparison highlights the different approaches: ReactOS closely mimics Windows APIs, while SerenityOS adopts a more modern C++ style with error handling and object-oriented design.

1,854

The Haiku operating system. (Pull requests will be ignored; patches may be sent to https://review.haiku-os.org).

Pros of Haiku

  • More mature project with a longer development history
  • Larger community and contributor base
  • Better hardware support and driver compatibility

Cons of Haiku

  • Less modern UI design compared to Serenity
  • Slower development pace in recent years
  • Limited support for newer technologies and standards

Code Comparison

Both projects are operating systems written primarily in C++, but they have different approaches to system calls and API design.

Haiku system call example:

status_t
_kern_open_directory(int fd, const char *path, bool traverseLink)
{
    return vfs_open_dir(fd, path, traverseLink);
}

Serenity system call example:

ErrorOr<NonnullRefPtr<OpenFileDescription>> Process::sys$open(Userspace<const Syscall::SC_open_params*> user_params)
{
    VERIFY_NO_PROCESS_BIG_LOCK(this);
    TRY(require_promise(Pledge::rpath));
    auto params = TRY(copy_typed_from_user(user_params));
    // ... (additional implementation)
}

Serenity's system calls tend to be more verbose and use modern C++ features, while Haiku's are often simpler and more C-like in style.

2,715

Minoca operating system

Pros of Minoca OS

  • Smaller codebase and footprint, potentially easier to understand and modify
  • Designed for embedded systems, offering better support for resource-constrained devices
  • Cross-platform support, including x86, ARM, and RISC-V architectures

Cons of Minoca OS

  • Less active development and smaller community compared to Serenity
  • Fewer features and applications out of the box
  • Limited desktop environment and graphical capabilities

Code Comparison

Minoca OS (kernel initialization):

KSTATUS
OsInitialize (
    PKERNEL_INITIALIZATION_BLOCK Parameters
    )
{
    KeInitializeSpinLock(&OsGlobalLock);
    return OsInitializePhase1(Parameters);
}

Serenity (kernel initialization):

extern "C" [[noreturn]] void init()
{
    asm volatile("cli");
    gdt_init();
    idt_init();
    // ...
}

Both projects show different approaches to kernel initialization, with Minoca OS using a more structured function-based approach, while Serenity uses a simpler C++ style initialization.

1,438

A distributed operating system

Pros of Harvey

  • Based on Plan 9, offering a unique and innovative operating system design
  • Supports multiple architectures, including x86, ARM, and RISC-V
  • Lightweight and minimalist, suitable for embedded systems and research

Cons of Harvey

  • Smaller community and less active development compared to Serenity
  • Limited desktop environment and user-friendly features
  • Fewer modern applications and compatibility with contemporary software

Code Comparison

Harvey (Plan 9-inspired system calls):

int
sys_open(char *name, int mode)
{
    return syscall(OPEN, name, mode);
}

Serenity (POSIX-like system calls):

int
open(const char* pathname, int flags, mode_t mode)
{
    return syscall(SC_open, pathname, flags, mode);
}

Both projects aim to create modern, open-source operating systems, but with different approaches. Harvey focuses on Plan 9 principles and minimalism, while Serenity aims for a more familiar Unix-like environment with a graphical user interface. Serenity has gained more popularity and active development in recent years, offering a more complete desktop experience. Harvey, on the other hand, provides a unique platform for exploring alternative operating system designs and concepts.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

SerenityOS

Graphical Unix-like operating system for x86-64 computers.

GitHub Actions Status Fuzzing Status Discord

FAQ | Documentation | Build Instructions

About

SerenityOS is a love letter to '90s user interfaces with a custom Unix-like core. It flatters with sincerity by stealing beautiful ideas from various other systems.

Roughly speaking, the goal is a marriage between the aesthetic of late-1990s productivity software and the power-user accessibility of late-2000s *nix. This is a system by us, for us, based on the things we like.

You can watch videos of the system being developed on YouTube:

Screenshot

Screenshot as of c03b788.png

Features

  • Modern x86 64-bit kernel with pre-emptive multi-threading
  • Browser with JavaScript, WebAssembly, and more (check the spec compliance for JS, CSS, and Wasm)
  • Security features (hardware protections, limited userland capabilities, W^X memory, pledge & unveil, (K)ASLR, OOM-resistance, web-content isolation, state-of-the-art TLS algorithms, ...)
  • System services (WindowServer, LoginServer, AudioServer, WebServer, RequestServer, CrashServer, ...) and modern IPC
  • Good POSIX compatibility (LibC, Shell, syscalls, signals, pseudoterminals, filesystem notifications, standard Unix utilities, ...)
  • POSIX-like virtual file systems (/proc, /dev, /sys, /tmp, ...) and ext2 file system
  • Network stack and applications with support for IPv4, TCP, UDP; DNS, HTTP, Gemini, IMAP, NTP
  • Profiling, debugging and other development tools (Kernel-supported profiling, CrashReporter, interactive GUI playground, HexEditor, HackStudio IDE for C++ and more)
  • Libraries for everything from cryptography to OpenGL, audio, JavaScript, GUI, playing chess, ...
  • Support for many common and uncommon file formats (PNG, JPEG, GIF, MP3, WAV, FLAC, ZIP, TAR, PDF, QOI, Gemini, ...)
  • Unified style and design philosophy, flexible theming system, custom (bitmap and vector) fonts
  • Games (Solitaire, Minesweeper, 2048, chess, Conway's Game of Life, ...) and demos (CatDog, Starfield, Eyes, mandelbrot set, WidgetGallery, ...)
  • Every-day GUI programs and utilities (Spreadsheet with JavaScript, TextEditor, Terminal, PixelPaint, various multimedia viewers and players, Mail, Assistant, Calculator, ...)

... and all of the above are right in this repository, no extra dependencies, built from-scratch by us :^)

Additionally, there are over three hundred ports of popular open-source software, including games, compilers, Unix tools, multimedia apps and more.

How do I read the documentation?

Man pages are available online at man.serenityos.org. These pages are generated from the Markdown source files in Base/usr/share/man and updated automatically.

When running SerenityOS you can use man for the terminal interface, or help for the GUI.

Code-related documentation can be found in the documentation folder.

How do I build and run this?

See the SerenityOS build instructions or the Ladybird build instructions.

The build system supports a cross-compilation build of SerenityOS from Linux, macOS, Windows (with WSL2) and many other *Nixes. The default build system commands will launch a QEMU instance running the OS with hardware or software virtualization enabled as supported.

Ladybird runs on the same platforms that can be the host for a cross build of SerenityOS and on SerenityOS itself.

Get in touch and participate!

Join our Discord server: SerenityOS Discord

Before opening an issue, please see the issue policy.

A general guide for contributing can be found in CONTRIBUTING.md.

Authors

And many more! See here for a full contributor list. The people listed above have landed more than 100 commits in the project. :^)

License

SerenityOS is licensed under a 2-clause BSD license.