Qwinci / crescent

A custom OS distribution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crescent

A custom OS distribution

Crescent is a custom operating system distribution, that is going to come with its own set of userspace applications and a desktop environment.

This repository hosts the Crescent kernel and apps.

Features

  • Multithreaded pre-emptive custom kernel
  • A set of custom userspace applications including a terminal, file manager, desktop environment, browser, media player and some games. (TODO, currently the only userspace application is a dummy echo "terminal")
  • Works on real hardware and supports different kinds of devices
  • Architectures supported: X86-64 (AArch64 support is planned)

Building the full distribution

Building the whole distribution is best done using xbstrap, the required tools for that are:

  • C/C++ compiler
  • xbstrap
  • CMake/Meson/Ninja/Make depending on which packages are built

Steps

Downloads the prerequisites once by running:

xbstrap prereqs xbps

Clone the crescent bootstrap repository, and proceed with the instructions below in that directory.

Initialize the build directory:

mkdir build
cd build
xbstrap init ..

Installing packages is done using xbstrap install:

# install optinally accepts --rebuild argument for rebuilding the package
xbstrap install <name>

There is a set of meta-packages which you can use to build preselected sets of packages:

  • base: includes the kernel and custom apps

Creating a bios/EFI bootable image:

# Create an empty image (usually only needed on a clean build)
xbstrap run create-image
# Sync the sysroot to the image
xbstrap run update-image

Booting the image in Qemu:

# Commands can be chained, for an example you can run
# `xbstrap run update-image qemu`
# to both update the image and launch qemu
xbstrap run qemu

Building the plain kernel

It is also possible build the plain Crescent kernel, for that you need following tools:

  • C compiler
  • CMake
  • Ninja (not strictly needed, but the build commands assume Ninja is used)

Steps

Note: If you want to cross-compile to a different architecture, then refer to CMake documentation on toolchain files and add the appropriate flags to below commands.

  • mkdir build
  • cd build
  • cmake -G Ninja ../kernel
  • ninja

Todo

  • Basic logging
  • Memory
    • Page frame allocator
    • Page table manager
    • General purpose memory allocator
  • Interrupt handling
    • APIC
    • Exceptions
    • IO-APIC
  • Kernel module loading
  • Per-cpu multilevel feedback queue scheduler
  • ACPI
    • FADT
    • MADT
    • MCFG
    • Power management
  • Filesystems
    • FAT32
    • Ext4 read
    • Ext4 write
  • Drivers
    • SMP
    • AHCI SATA
    • NVMe
    • PS2
      • Keyboard
      • Mouse
    • Generic PCI device interface
    • Ethernet
      • Realtek RTL8169
    • USB
      • Generic HCI interface abstraction
      • HCI
        • UHCI
        • OHCI
        • EHCI
        • XHCI
      • Keyboard
      • Mouse
      • Mass storage

About

A custom OS distribution

License:GNU General Public License v3.0


Languages

Language:C++ 91.5%Language:C 4.9%Language:CMake 2.1%Language:Assembly 1.5%