How duc-hust-et1/os-project works
This is an xv6-riscv teaching kernel fork focused on kernel threads and a user-level thread library. The principal workflow is a user program creating and joining threads through the user API and kernel syscall boundary; the kernel schedules them while managing shared address spaces and process lifetime. The repository also retains xv6 boot, virtual memory, filesystem, and device-I/O subsystems. The README describes the thread capabilities, while sampled source confirms boot initialization; unsampled syscall and device call paths are not inferred.
Main entry points: main.c Kernel Initialization · proc.c Process and Threads · user.h User API · syscall.c Syscall Boundary
Components 20
Kernel Boot
- Kernel Initialization
kernel/main.c - Trap Handling
kernel/trap.c
Thread Runtime
- Syscall Boundary
kernel/syscall.c - Process and Threads
kernel/proc.c
Memory Management
- Address Spaces
kernel/addrspace.c - Virtual Memory
kernel/vm.c - Physical Allocator
kernel/kalloc.c
Filesystem and Devices
- File Syscalls
kernel/sysfile.c - Open Files
kernel/file.c - Filesystem
kernel/fs.c - Block Cache
kernel/bio.c - Virtual Disk
kernel/virtio_disk.c
User Programs
- User API
user/user.h - Thread API
user/thread.h - Thread Library
user/thread.c - Thread Tests
user/threadtest.c - Parallel Benchmark
user/parallel_sum.c - User Tests
user/usertests.c - Command Shell
user/sh.c
Other components
- User
Connections 23
- Kernel Initialization → Process and Threads: initializes
kernel/main.c - Kernel Initialization → Trap Handling: initializes
kernel/main.c - Kernel Initialization → Virtual Memory: initializes
kernel/main.c - Kernel Initialization → Filesystem: initializes
kernel/main.c - Kernel Initialization → Open Files: initializes
kernel/main.c - User → Command Shell: runs commands
- Command Shell → User API: uses syscalls
user/sh.c - User → Thread Tests: runs tests
- Thread Tests → Thread Library: exercises
user/threadtest.c - Parallel Benchmark → Thread Library: uses
user/parallel_sum.c - Thread Library → Thread API: implements
user/thread.c - Thread API → User API: extends
user/thread.h - User API → Syscall Boundary: invokes
README - Syscall Boundary → Process and Threads: dispatches clone/join
README - Process and Threads → Address Spaces: shares address space
kernel/proc.c - Process and Threads → Virtual Memory: manages mappings
- User Tests → User API: exercises
user/usertests.c - Syscall Boundary → File Syscalls: dispatches file calls
- File Syscalls → Open Files: uses open files
kernel/sysfile.c - Open Files → Filesystem: accesses inodes
- Filesystem → Block Cache: reads and writes blocks
- Block Cache → Virtual Disk: submits I/O
- Virtual Memory → Physical Allocator: allocates pages