-
-
Notifications
You must be signed in to change notification settings - Fork 4
Architecture
kazah-png edited this page Jul 11, 2026
·
2 revisions
NyxOS is a monolithic kernel with loadable modules, running in long mode (x86_64) with 4-level paging.
See also: Boot Process, Memory Management, Process Management, Networking Stack, GUI Subsystem, Filesystem, Drivers, Syscalls, SMP, Security
+--------------------------------------------------------+
| Userspace (Ring 3) |
| sh.elf init.elf top.elf edit.elf ps.elf kill.elf |
| cat/wc/ls/find/sort/grep/head/tail/mkdir/rm/touch |
+--------------------------------------------------------+
| System Call Interface (syscall/sysret) |
+--------------------------------------------------------+
| Kernel (Ring 0) |
| +----------+ +---------+ +--------+ +-----------+ |
| | Scheduler | | Memory | | VFS | | Networking | |
| | + IPC | | Manager | | + EXT2 | | TCP/IP | |
| +----------+ +---------+ +--------+ +-----------+ |
| +---------+ +--------+ +---------+ +-----------+ |
| | Drivers | | GUI | | ELF | | Initramfs | |
| |(kbd,mouse| | Compo- | | Loader | | | |
| | SB16, | | sitor | | | | | |
| | RTL8139) | | | | | | | |
| +---------+ +--------+ +---------+ +-----------+ |
+--------------------------------------------------------+
| Hardware Abstraction Layer |
+--------------------------------------------------------+
| x86_64 Hardware |
| CPU | APIC | I/O APIC | PIT | PCI | ATA | VBE | PS2 |
+--------------------------------------------------------+
All kernel source lives in kernel/. Key files:
| File | Purpose |
|---|---|
kernel.c |
Main entry, shell, command handlers |
kernel.h |
Typedefs, constants, extern declarations |
boot.asm |
Multiboot header, GDT, long mode entry |
memory.c |
Bitmap physical page allocator |
heap.c |
16 MB kernel heap (kmalloc/kfree) |
paging.c |
4-level paging, demand paging, COW |
process.c |
Process table, scheduler, background tasks |
switch.asm |
Context switch assembly |
vfs.c |
Ramdisk VFS + mount table |
ext2.c |
EXT2 filesystem driver |
compositor.c |
Window compositor (32 windows, z-order) |
tcp.c |
Full TCP state machine |
elf.c |
ELF64 loader |
apic.c |
Local APIC + I/O APIC |
smp.c |
Multi-core bringup |
rtl8139.c |
RTL8139 NIC driver |
The kernel is mapped at the higher half using PML4[511] (the last entry). The user half occupies PML4[0..510]. The kernel page tables mirror the identity mapping (low 64 MB of physical memory accessible through the higher-half alias). This provides page-table isolation: user page directories lack the identity mapping, so a user process cannot access kernel memory.
KERNEL_BASE = 0xFFFF800000000000KERNEL_HEAP_SIZE = 16 MBMAX_PROCESSES = 64PAGE_SIZE = 4096MAX_CPUS = 8
Contact: uselessalter on Discord | nyxos@inbox.lv | GitHub