See also: Home, Developer Guide

Current Status

Valecium OS is at version 0.28. The i686 BIOS path boots, initializes core subsystems, mounts a FAT root filesystem, and launches userspace processes. The custom bootloader has stage1 (MBR) and stage2 (protected mode entry) but does not yet load the kernel — GRUB is the current boot method.

Short-Term Todo

  • Ext2 filesystem driver (enum exists, no implementation)

  • FAT LFN (Long File Name) support

  • ATAPI and ISO9660 optical drive support

  • Signal delivery mechanism and signal syscall completion

  • Smart heap allocation that actually frees memory

  • Make kernel PIC & PIE

  • Kernel partition filesystem detection (not just partition ID)

  • Memory protection (read/write/execute permissions)

  • Complete custom bootloader (stage2 loads kernel)

Phase 1: Core OS Infrastructure

Memory Management

  • Physical Memory Manager (PMM) — page frame allocation

  • Virtual Memory Manager (VMM) — paging, per-process address spaces

  • Kernel heap (kmalloc/kfree/kzalloc/calloc/realloc)

  • Per-process heap (brk/sbrk syscalls)

  • Stack management (per-process user stacks)

    • Refactor user stack allocation (move from process.c to stack.c)

    • Implement Stack_CreateUser using PMM/Paging (not kmalloc)

    • Map user-mode exit trampoline (fix GPF on return)

    • Update TSS ESP0 on context switch

  • Memory protection (read/write/execute permissions)

  • Page tables and MMU setup

  • Kernel virtual memory layout (3 GB / 1 GB split)

Process Management

  • Process Control Block (PCB) structure

  • Process creation & destroy (fork/execve syscalls)

    • Add Kernel Stack to Process Struct

    • Allocate Kernel Stack in Process_Create

    • Free Kernel Stack in Process_Destroy

    • Set Parent PID

    • Initialize Standard File Descriptors (stdin, stdout, stderr)

    • Handle Arguments (argv/envp)

    • Scheduler Registration

  • Process scheduling & context switching (basic round-robin)

  • Process termination (exit syscall)

  • Fork implementation (Process_Clone)

  • Exec implementation (Process_Execute)

  • Signal handling (signal syscalls)

  • User-mode ring 3 execution

  • Kernel-mode execution

  • Credentials (uid/gid/euid/egid per process)

  • User/kernel mode switching

Filesystem

  • FAT12/16/32 filesystem read/write

  • FAT_Create() — create new files

  • FAT_Delete() — delete files

  • FAT_Truncate() — truncate files

  • Multi-cluster file support (files > 1 cluster)

  • Device filesystem (devfs) — /dev/tty0, /dev/null, /dev/zero

  • Virtual Filesystem Switch (VFS) — open/read/write/seek/close/dispatch

  • File descriptors table per process (16 entries)

  • Disk abstraction layer (MBR/VBR parsing, partitions)

  • FAT_Stat() — file metadata

  • Ext2 filesystem driver

  • FAT directory operations (readdir, create dir entry)

Terminal Support

  • TTY driver for /dev/tty0

  • Terminal line discipline (buffering, echo control)

  • ANSI escape sequence support

  • Keyboard input handling (platform-independent dispatcher)

  • Terminal control ioctl calls

  • Canonical/raw mode switching

  • Line editing (backspace, CTRL+C/D/U/W/Z)

Phase 2: Syscalls Wrappers

File I/O Syscalls

  • read — read from file descriptor

  • write — write to file descriptor

  • open — open file

  • close — close file descriptor

  • lseek — seek in file

  • chmod — change file mode (stub)

  • chown — change file ownership (stub)

  • fstat, stat, lstat — file metadata

  • ioctl — device control

  • fcntl — file control

  • access — check permissions

Memory Syscalls

  • brk — set data segment size (for malloc)

  • sbrk — increment data segment size

  • mmap, munmap — memory mapping

  • mprotect — set memory protection

  • mremap — remap memory region

Process Syscalls

  • exit — process termination

  • fork — process creation

  • execve — execute program

  • getpid — get process ID

  • getppid — get parent process ID

  • getuid — get user ID

  • setuid — set user ID

  • getgid — get group ID

  • setgid — set group ID

  • wait4 — wait for child process

  • exit_group — exit all threads in group

  • clone — create thread

Signal Syscalls

  • signal, sigaction — signal handlers (partial: sigaction.c exists)

  • sigprocmask, sigpending — signal masking (partial: sigprocmask.c exists)

  • kill — send signal (partial: kill.c exists)

  • pause — wait for signal

  • alarm — timer signal

  • sigreturn — return from signal handler (arch stub exists)

Note: Signal infrastructure files exist (kernel/signal/ and kernel/arch/i686/signal/) but core signal delivery is not fully integrated with the scheduler and process lifecycle.

Time Syscalls

  • time — current time

  • gettimeofday, clock_gettime — precise time

  • nanosleep — sleep

  • select, poll — I/O multiplexing

Miscellaneous Syscalls

  • uname — system info

  • getpagesize — page size

  • prctl — process control

  • umask — file creation mask

  • nice, getpriority, setpriority — scheduling

Phase 3: Advanced Features

Device Support

  • /dev/null device file

  • /dev/zero device file

  • Device node mounting (devfs)

  • /dev/random, /dev/urandom — entropy source

  • Block device interface

  • Character device interface

Filesystem Extended

  • Permission checking (uid/gid/mode)

  • Directory creation (mkdir)

  • Directory deletion (rmdir)

  • Symlink support

  • Hard link support

  • File ownership and chmod

Dynamic Linking

  • Shared library loading via kmod

  • /lib, /usr/lib layouts (staged in image)

  • libmath.so shared library

  • Full userspace dynamic linker

  • LD_LIBRARY_PATH support

  • Symbol versioning

  • RPATH support

Custom Bootloader

  • Stage 1 (MBR) — loads stage2 via INT 13h LBA

  • Stage 2 (protected mode) — filesystem parser, kernel loader (stub: enters protected mode and halts)

  • Stage 2 common code — HAL and filesystem abstractions (empty stubs)

  • EFI boot (all architectures: stubs)

  • x86_64 BIOS boot (stub)

Networking

  • Socket syscalls (socket, bind, listen, connect, accept)

  • UDP/TCP support

  • DNS resolution

  • Network device drivers

Cryptography

  • MD5 implementation

  • SHA1 implementation

  • Crypto self-tests

  • Additional algorithms (e.g., AES)

  • Kernel entropy pool

Revision History

v2.0

Complete overhaul to reflect v0.28 codebase state: marked items as done/undone based on actual source analysis, added crypto subsystem, custom bootloader status, detailed syscall and phase breakdowns, added signal implementation status notes, added section for short-term todo items

v1.0

Initial roadmap document