How termuos-project/termuos works
TermuOS is a learning-oriented x86_64 operating system. Its visible interaction loop starts at the terminal shell: users enter commands that inspect files, launch programs, or exercise networking; user programs can also use system calls to access kernel services. The kernel initializes memory, scheduling, devices, and filesystems, then creates a shell process. The README highlights multitasking, VFS, terminal, memory management, and drivers; the tree also shows user programs, networking, and IPC. Arrows follow the sampled startup, shell, syscall, exec, and TFS code; unsampled subsystem wiring is omitted where uncertain.
Main entry points: main.c Kernel startup · shell.c Shell · syscall.c System calls · vfs.c VFS
Components 22
Kernel Core
- Kernel startup
kernel/main.c - Memory management
kernel/mm/pmm.c - Virtual memory
kernel/mm/vmm.c - Scheduler
kernel/sched/scheduler.c - Processes
kernel/proc/process.c - x86 interrupts
kernel/arch/x86_64/idt.c
Terminal And Devices
- Shell
kernel/shell/shell.c - Framebuffer terminal
kernel/drivers/video/terminal.c - Keyboard input
kernel/drivers/input/keyboard.c - Device drivers
kernel/drivers/driver.c - Network stack
kernel/net/net.c - Virtio network
kernel/drivers/net/virtio_net.c
Files And Execution
- VFS
kernel/fs/vfs.c - TFS filesystem
kernel/fs/tfs.c - RAM filesystem
kernel/fs/ramfs.c - Disk driver
kernel/drivers/storage/disk.c - ELF loader
kernel/proc/exec.c
User Services
- System calls
kernel/user/syscall.c - User programs
tsys/cat/cat.c - IPC ports
kernel/ipc/port.c
Other components
- User
- Hardware
Connections 25
- User → Shell: enters commands
- Kernel startup → x86 interrupts: initializes
- Kernel startup → Memory management: initializes
- Kernel startup → Virtual memory: initializes
- Kernel startup → Keyboard input: initializes
- Kernel startup → VFS: initializes
- Kernel startup → TFS filesystem: mounts filesystem
- Kernel startup → RAM filesystem: fallback mount
- Kernel startup → Processes: creates shell process
- Kernel startup → Scheduler: starts shell thread
- Shell → Framebuffer terminal: prints output
- Keyboard input → Shell: provides input
- Shell → VFS: reads files
- Shell → ELF loader: launches executable
- ELF loader → VFS: reads executable
- ELF loader → Virtual memory: maps segments
- Shell → Network stack: runs network commands
- Network stack → Virtio network: sends and polls packets
- Virtio network → Hardware: exchanges packets
- Hardware → Device drivers: device events
- User programs → System calls: requests kernel services
- System calls → VFS: reads and writes files
- System calls → Processes: exits process
- System calls → IPC ports: dispatches port operations
- TFS filesystem → Disk driver: reads and writes blocks