Blue Dust is an experimental operating system project with a focus on minimalism and practicality. The goal is to build a basic kernel with essential features, allowing for future growth and exploration as the project evolves.
Note: "Blue Dust" is a temporary codename for the project. The name will likely change once the project reaches a stage where a more definitive name is required.
To be honest, this project is pretty experimental, and my workflow is... let's say "unique." Right now, I'm using a .sh script to handle compilation instead of a proper build system like Make with a cross-compiler. Is it the most efficient way? Nope. But it works for now, and that's what matters.
As things grow (if they grow), I'll probably switch to something more robust. For now, the simplicity of a script fits the project's current size and vibe. Let's see where this leads!
Here’s what’s been accomplished so far in the development of Blue Dust:
-
Bootloader: A functional bootloader that:
- Activates the A20 line.
- Reads the memory map.
- Loads the kernel from disk.
- Finally sets the processor to 64-bit long mode before launching the kernel.
-
Kernel:
- Initializes a basic terminal for output.
- Sets up an Interrupt Descriptor Table (IDT) to handle:
- Major CPU faults, including division by zero, invalid opcode, page fault, general protection fault, and double fault.
- Keyboard input.
- System calls.
-
System Calls: Currently, there is only one system call implemented, allowing allocation and deallocation of heap memory while the memory allocator is not initialized (and not implemented yet).
Currently, the project is built using a simple shell script. To build and run the kernel:
- Clone the repository.
- Execute the build script compiles all components and organizes the outputs into a
.buildfolder:./build.sh
- Use QEMU (or another compatible emulator) to test the generated binary:
qemu-system-x86_64 -drive format=raw,file=.build/os.bin
To build and run Blue Dust, you need the following tools installed:
- GCC: A cross-compiler targeting
x86_64-elfbinaries. - NASM: An assembler capable of generating
elf64binaries. - QEMU: An x86-64 emulator for testing the kernel (tested only on QEMU).
The Blue Dust kernel is designed to provide the following core functionalities. Note: Given the project's current state, these features are subject to change as development progresses.
- Allocation and deallocation of physical pages.
- Management of page tables to provide virtual memory.
- Support for hardware interrupts: timer, keyboard, disk, etc.
- Basic primitives to exchange messages between services (implementation details to be defined).
- A simple preemptive multitasking scheduler (implementation details to be defined).
- Read-only access.
- Direct access via predefined inodes (no path support).
- Enough to load files necessary for the system to boot.
- Loading a bare-bones loader.
- Executing the service manager via the loader.
A minimal kernel that provides only the functionalities described above.
A program that reads an executable file, maps it into memory, and returns a pointer to its entry point.
A program responsible for configuring and launching user services based on a configuration file.
A user-space service that mounts a complete filesystem.
The bootloader loads the kernel into memory and transfers control to it.
The kernel:
- Initializes its core components:
- Memory management.
- Interrupt management.
- Minimal file system.
- Task scheduler.
- Reads the bare-bones loader program.
- Maps the loader into memory and transfers control to it.
The loader:
- Reads the service manager's file from inode 0 of the minimal file system.
- Loads the service manager's ELF file into memory.
- Passes a pointer to its entry point to the service manager.
The service manager:
- Reads its configuration file.
- Identifies and loads user services specified in the configuration:
- Loads and launches the file system service to mount a complete filesystem.
- Loads and launches other user services (networking, logging, etc.).
Once loaded, user services operate independently and interact via the IPC provided by the kernel.
Blue Dust serves as a foundation for experimenting with low-level system design. While minimal in its initial scope, the project is designed to be extensible and adaptable for implementing more advanced features over time.
Given the experimental nature of the project, many features and components described here may change or evolve as the system grows and as I learn along the way.
While this is currently a personal project, if you ended up here and you're interested in discussing or contributing, feel free to reach out with ideas or suggestions.
To be determined.