How rcore-os/tg-rcore-tutorial works
This is a componentized Rust teaching repository for the progressive Tangram rCore Tutorial operating-system kernel. The principal workflow is to boot a chapter kernel, load and run user programs, and introduce operating-system mechanisms chapter by chapter—from traps and scheduling through virtual memory, processes, files, IPC/signals, and threads/synchronization. Reusable crates implement shared kernel layers; user programs exercise them, and a checker evaluates captured output. Relationships below rely on the README and shown source excerpts; unsampled implementations are represented only where documented.
Main entry points: src/main.rs Filesystem kernel · src/main.rs Threads and sync · src/main.rs Bare-metal boot · src/main.rs Batch and traps
Components 22
Chapter kernels
- Bare-metal boot
tg-rcore-tutorial-ch1/src/main.rs - Batch and traps
tg-rcore-tutorial-ch2/src/main.rs - Multitasking
tg-rcore-tutorial-ch3/src/main.rs - Virtual memory
tg-rcore-tutorial-ch4/src/main.rs - Process management
tg-rcore-tutorial-ch5/src/main.rs - Filesystem kernel
tg-rcore-tutorial-ch6/src/main.rs - IPC and signals
tg-rcore-tutorial-ch7/src/main.rs - Threads and sync
tg-rcore-tutorial-ch8/src/main.rs
Kernel components
- SBI services
tg-rcore-tutorial-sbi/src/lib.rs - Console output
tg-rcore-tutorial-console/src/lib.rs - Execution context
tg-rcore-tutorial-kernel-context/src/lib.rs - Kernel allocator
tg-rcore-tutorial-kernel-alloc/src/lib.rs - Virtual memory
tg-rcore-tutorial-kernel-vm/src/lib.rs - Syscall framework
tg-rcore-tutorial-syscall/src/lib.rs - Task management
tg-rcore-tutorial-task-manage/src/thread_manager.rs - Teaching filesystem
tg-rcore-tutorial-easy-fs/src/layout.rs - Sync primitives
tg-rcore-tutorial-sync/src/lib.rs - Signal handling
tg-rcore-tutorial-signal-impl/src/lib.rs
User programs
- User programs
tg-rcore-tutorial-user/src/lib.rs
Learning tools
- Output checker
tg-rcore-tutorial-checker/src/main.rs
Other components
- Learner
- QEMU output
Connections 23
- Learner → Bare-metal boot: studies first
README.md - Bare-metal boot → Batch and traps: progresses to
README.md - Batch and traps → Multitasking: progresses to
README.md - Multitasking → Virtual memory: adds address spaces
README.md - Virtual memory → Process management: adds processes
README.md - Process management → Filesystem kernel: adds filesystem
README.md - Filesystem kernel → IPC and signals: adds IPC signals
README.md - IPC and signals → Threads and sync: adds threads sync
README.md - Bare-metal boot → SBI services: uses SBI
README.md - Virtual memory → Virtual memory: uses virtual memory
README.md - Process management → Task management: uses task management
README.md - Filesystem kernel → Teaching filesystem: opens files
tg-rcore-tutorial-ch6/src/main.rs - Filesystem kernel → Kernel allocator: initializes allocator
README.md - Filesystem kernel → User programs: runs programs
README.md - IPC and signals → Signal handling: adds signal handling
README.md - Threads and sync → Sync primitives: adds synchronization
README.md - Threads and sync → Task management: manages threads
tg-rcore-tutorial-ch8/src/main.rs - Threads and sync → User programs: runs programs
README.md - Batch and traps → Syscall framework: uses syscall framework
- Multitasking → Execution context: switches contexts
- User programs → QEMU output: produces output
- QEMU output → Output checker: feeds captured output
tg-rcore-tutorial-checker/src/main.rs - Learner → Output checker: checks results
README.md