Implement fast system calls using the x86-64 SYSCALL/SYSRET instructions:
- Configure MSRs: EFER (enable SCE), STAR (segment selectors),
LSTAR (entry point), SFMASK (disable interrupts on entry)
- Add per-CPU data structure accessed via GS segment for kernel
stack pointer storage during privilege transitions
- Use SWAPGS in syscall entry to access per-CPU data and switch
from user to kernel stack
- Add SWAPGS before IRETQ to user mode to set up correct GS state
for subsequent syscalls
SYSCALL/SYSRET is significantly faster than INT 0x80 as it avoids
IDT lookup and uses direct MSR-configured entry.
- Add PIC driver to remap IRQs 0-15 to vectors 0x20-0x2F, preventing
conflicts with CPU exception vectors (IRQ0/timer was hitting vector
0x08/Double Fault)
- Extend GDT with user code/data segments (ring 3) and TSS for
privilege level transitions
- Add INT 0x80 syscall handler supporting write() and exit() syscalls
- Configure IST1 for double fault handler to ensure reliable exception
handling during privilege transitions
- Propagate USER flag through all intermediate page table entries
- Add jump_to_user() for transitioning to ring 3 via IRETQ
The kernel now successfully executes user-mode programs that can print
to serial output and exit cleanly via syscalls.
- Implement Process structure representing a virtual address space
- Add process table with PID allocation (max 64 processes)
- Initialize new process page tables with kernel mappings copied
- Implement address space switching via CR3 manipulation
- Process 0 reserved for kernel, uses boot page table
In XOmB's exokernel model, a process is fundamentally its page table.
The kernel maintains minimal state - just enough to securely multiplex
hardware resources via paging.
- Implement IDT with handlers for CPU exceptions (vectors 0-19)
- Add kernel-space GDT module to support identity mapping removal
- Add memory intrinsics (memcpy, memset, memmove, memcmp) for no_std
- Add remove_identity_mapping() to paging module
- Reload GDT to higher-half before removing identity mapping
Exception handlers print full register state and halt on fault.
Tested with divide-by-zero and INT3 breakpoint exceptions.
Core kernel infrastructure:
- Multiboot2 boot with GRUB, long mode setup, higher-half kernel
- Serial port output for debugging
- Unified boot info abstraction for future UEFI support
Memory management:
- Physical frame allocator with bitmap tracking
- Page table manipulation via recursive mapping (PML4[510])
- Support for 4KB, 2MB, and 1GB page mappings
- TLB invalidation and proper NXE support
Build system:
- Cargo-based build with custom x86_64 target
- Makefile for QEMU and Bochs testing
- GRUB ISO generation for multiboot2 boot