This project has been archived. Please see notOSv2 for the ongoing rewrite
notOS is a monolithic operating system written in Rust from scratch with no external libraries, focusing on implementing all aspects of OS using only the tools provided by the Rust compiler. The system currently supports kernel-space operations, memory management, process management, hardware interaction, and task scheduling.
- Written purely in Rust, with assembly post-bootloading initialization;
- Implements OS concepts like memory allocation, process management, task switching, interrupts and more;
- Memory management with configurable memory allocators and paging memory model;
- Configurable scheduler structure for multitasking;
- Custom IPC mechanisms and synchronization primitives. Concurrent lock-free structures;
- Hardware abstraction over x86 architecture: controllers, interrupt handling, ports I/O, registers;
- Loading from GRUB with tags parsing;
- Custom dynamic driver management (in progress...);
- ACPI support and power management (in progress...);
- Rust Nightly version.
make,qemu, andgdb.
-
Build the kernel and dependencies:
make all
-
To run the OS in debug mode with QEMU and GDB:
make run
This will start QEMU, load the OS with GDB support, and wait for GDB to connect. It will open GDB in a separate terminal.
-
To create an ISO image for running on virtual machines:
make iso
The ISO image will be generated at
build/notOS-x86_64.iso. -
To run the release version of the OS:
make release
This will build and run the release version of the OS with QEMU and GDB.
-
To run the tests:
make testThis will build and run the tests in QEMU with GDB.
Note: The make test command requires Python to extract the test results.
- kernel_components: Main entry point for outer structures and objects.
- structures: Collection of basic data structures.
- arch_x86_64: x86_64 architecture-specific modules.
- registers: Modules for handling various registers.
- drivers: Driver implementations.
- sync: Synchronization primitives.
- memory: Memory management modules.
- task_virtualization: Modules for task virtualization, including the scheduler.
- build: Folder for output files.
- arch: Assembly files and linker script.
- tests: Integrated tests.
- proc_macros: Extra crate for custom procedural macros.
This project draws inspiration from various resources:
- Writing an OS in Rust (First Edition) and Second Edition by Philipp Oppermann.
- OSDev Wiki
- The Art of Multiprocessor Programming by Maurice Herlihy et al.
- Rustonomicon
- Operating Systems: Three Easy Pieces by Remzi Arpaci-Dusseau et al.
- MMURTL V1.0 by Richard A. Burgess.
- Rust Cookbook
- x86 architecture source information
- Intel x86_64 Architecture Manual
The project is a constant work in progress. Temporary code and workarounds may exist but are refined over time.
- All modules are imported inside the
kernel_components. - Macros can be accessed within this crate, and the main components are also accessible from there.
- The library can be used to rewrite the main kernel.