How nldk/nos works
NOS is a small x86 operating system: its two-stage assembly bootloader selects and loads a kernel, which provides a shell, ext2 file operations, and ring-3 user processes with syscalls. The main workflow and filesystem/storage boundaries are supported by the README and sampled source. Some internal boot, shell, and syscall dispatch details are unsampled, so the graph avoids asserting uncertain links.
Main entry points: main.c Kernel shell · process.c Process management · ext2.c Ext2 operations · syscall.c Syscall services
Components 16
Boot
- Two-stage loader
NBL - Kernel headers
NBL/header.asm
Kernel
- Kernel entry
kernel/src/entry.S - Kernel shell
kernel/src/main.c - Interrupts and ring 3
kernel/src/interupts.c - Syscall entry
kernel/src/syscall.S - Syscall services
kernel/src/syscall.c - Heap and paging
kernel/src/mem.c - Text display
kernel/src/vga.h
Filesystem and storage
- Ext2 operations
kernel/src/ext2.c - ATA sector I/O
kernel/src/storage.c
User processes
- Process management
kernel/src/process.c - User program
user/hello.c - User syscall API
user/syscall.h
Other components
- Boot firmware
- Disk device
Connections 18
- Boot firmware → Two-stage loader: starts
- Kernel headers → Two-stage loader: describes kernels
- Two-stage loader → Kernel entry: loads selected kernel
- Kernel entry → Kernel shell: enters
- Kernel shell → Ext2 operations: runs shell file commands
- Kernel shell → Text display: prints output
- Kernel shell → Process management: starts user process
- Process management → Ext2 operations: reads program image
- Process management → Heap and paging: allocates and maps pages
- Process management → Interrupts and ring 3: enters ring 3
- User program → User syscall API: uses
- User syscall API → Syscall entry: issues syscalls
- Syscall entry → Syscall services: transfers control
- Syscall services → Ext2 operations: serves file requests
- Syscall services → Text display: serves print requests
- Ext2 operations → ATA sector I/O: reads and writes sectors
- ATA sector I/O → Disk device: transfers sectors
- Interrupts and ring 3 → Kernel shell: delivers keyboard input