17 Commits

Author SHA1 Message Date
wilkie
6078d51d3a Adds basic documentation map to the AGENTS.md file. 2025-12-30 02:45:50 -05:00
wilkie
f8383f21f8 Adds links to other docs into docs/MAIN.md. 2025-12-30 02:42:32 -05:00
wilkie
8cc042874d Updates documentation to clarify process freeing and resource groups. 2025-12-30 02:40:03 -05:00
wilkie
ac18e25ddc Updates system design docs. 2025-12-30 02:26:30 -05:00
wilkie
3da042e53b Adds various documentation on the memory, process, and upcall model. 2025-12-30 02:04:13 -05:00
wilkie
0deafeb857 Updates the look of the dagger footnote in the README. 2025-12-28 15:39:19 -05:00
wilkie
a15cf5b076 Adds Dr. Amer acknowledgment. 2025-12-28 15:29:42 -05:00
wilkie
4cd45c0803 Adds further acknowledgements. 2025-12-28 15:25:16 -05:00
wilkie
58d44c2ce0 Adds license and initial readme. 2025-12-28 15:23:08 -05:00
wilkie
20c1bf9588 Update Makefile to fix uefi qemu usage with ovmf debian package. 2025-12-28 03:07:36 -05:00
wilkie
6200fb8ff3 Rename page table terminology to PML4/PML3/PML2/PML1
Replace x86 architectural names (PDPT, PD, PT) with simplified
level-based naming for improved clarity. The documentation notes
the correspondence to x86 terminology.

Renamed:
- VirtAddr methods: pdpt_index -> pml3_index, pd_index -> pml2_index,
  pt_index -> pml1_index
- Entry address functions: pdpt_entry_addr -> pml3_entry_addr, etc.
- Read/write functions: read_pdpt -> read_pml3, etc.
- Ensure functions: ensure_pdpt_entry -> ensure_pml3_entry, etc.
2025-12-28 02:53:14 -05:00
wilkie
4e9cf1a94e Update STAGE_1.md with current progress
Mark completed items:
- Process creation with isolated address spaces
- Physical memory allocator and frame management
- Page table manipulation via recursive mapping
- Resource attachment (4KB page mapping)
- User mode execution (ring 3)
- SYSCALL/SYSRET interface with write/exit
- Boot infrastructure (PIC, GDT/TSS, IDT, IST)

Stage 1 is approximately 80% complete. Remaining work:
- Resource management syscalls (mmap/munmap)
- Permission update API
- ELF loader
- Per-process resource tracking
2025-12-28 02:42:10 -05:00
wilkie
1842896ee9 Replace INT 0x80 with native SYSCALL/SYSRET
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.
2025-12-28 02:18:33 -05:00
wilkie
4e76831fb0 Add user mode execution with syscall support
- 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.
2025-12-28 01:59:56 -05:00
wilkie
d87c7cc4bd Add process management with address space switching
- 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.
2025-12-27 19:25:56 -05:00
wilkie
92d935d62f Add interrupt handling and kernel-space GDT
- 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.
2025-12-27 14:45:58 -05:00
wilkie
c6fa2895e2 Initial commit: XOmB exokernel foundation
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
2025-12-26 14:20:39 -05:00