How ohidreza0/xv6-smsl works
xv6 is a teaching Unix-like operating system for RISC-V. Its principal workflow starts at the shell: a user command makes system calls, the kernel dispatches them to process, execution, and I/O services, and results reach the process through files, pipes, or devices. The graph also shows boot initialization and the storage path. README establishes the product and platform; sampled source supports the main boot, shell, process, VM, filesystem, and disk relationships. Other subsystem links reflect xv6’s documented structure and are kept at subsystem level.
Main entry points: main.c Kernel startup · fs.c Inodes and paths · file.c Open files · proc.c Process management
Components 22
User environment
- Shell
user/sh.c - Init process
user/init.c - User utilities
user/cat.c
Kernel control
- Trap handling
kernel/trap.c - Syscall dispatch
kernel/syscall.c - Process management
kernel/proc.c - Process syscalls
kernel/sysproc.c - Program execution
kernel/exec.c - Kernel startup
kernel/main.c
Memory management
- Virtual memory
kernel/vm.c - Page allocator
kernel/kalloc.c
Filesystem and I/O
- File syscalls
kernel/sysfile.c - Open files
kernel/file.c - Pipes
kernel/pipe.c - Inodes and paths
kernel/fs.c - Crash recovery log
kernel/log.c - Block cache
kernel/bio.c
Devices
- Console I/O
kernel/console.c - UART driver
kernel/uart.c - Virtio disk driver
kernel/virtio_disk.c
Other components
- User
- Emulated disk
Connections 29
- User → Shell: enters commands
- Init process → Shell: starts
- Shell → Trap handling: issues syscalls
- User utilities → Trap handling: issues syscalls
- Trap handling → Syscall dispatch: dispatches
- Syscall dispatch → Process syscalls: routes process calls
- Syscall dispatch → File syscalls: routes file calls
- Process syscalls → Process management: manages processes
- File syscalls → Open files: operates on descriptors
- File syscalls → Inodes and paths: resolves paths
- Process management → Virtual memory: manages address spaces
- Process management → Open files: shares descriptors
- Program execution → Virtual memory: loads program memory
- Program execution → Inodes and paths: reads executable
- Open files → Inodes and paths: reads and writes inodes
- Open files → Pipes: dispatches pipe I/O
- Open files → Console I/O: dispatches device I/O
- Inodes and paths → Crash recovery log: records updates
- Inodes and paths → Block cache: requests blocks
- Crash recovery log → Block cache: writes log blocks
- Block cache → Virtio disk driver: transfers buffers
- Virtio disk driver → Emulated disk: reads and writes
- Console I/O → UART driver: reads and writes
- Kernel startup → Process management: initializes
- Kernel startup → Virtual memory: initializes
- Kernel startup → Block cache: initializes
- Kernel startup → Inodes and paths: initializes
- Kernel startup → Virtio disk driver: initializes
- Kernel startup → Init process: creates first process