joshua912815-tg-rcore-tutorial-ch8-basic 0.8.0-preview.5

AI4OSE publishable Chapter 8 basic experiment crate with threads, synchronization primitives, and deadlock detection.
joshua912815-tg-rcore-tutorial-ch8-basic-0.8.0-preview.5 is not a library.

joshua912815-tg-rcore-tutorial-ch8-basic

joshua912815-tg-rcore-tutorial-ch8-basic is a publishable Chapter 8 basic experiment crate for AI4OSE.

It packages the completed tg-rcore-tutorial Chapter 8 kernel experiment as a standalone crate root, including:

  • thread support based on the Process + Thread split
  • mutex, semaphore, and condvar system calls
  • the Chapter 8 deadlock detection exercise
  • a local snapshot of tg-rcore-tutorial-user for reproducible builds
  • a Chinese experiment report that can be used directly in the final course submission

Release Metadata

  • Crate name: joshua912815-tg-rcore-tutorial-ch8-basic
  • Crate version: 0.8.0-preview.5
  • Git repository: https://github.com/Joshua912815/tg-rcore-tutorial
  • Recommended git tag: ch8-basic-crate-v0.8.0-preview.5
  • Documentation on docs.rs: https://docs.rs/joshua912815-tg-rcore-tutorial-ch8-basic
  • Included report path:
    • docs/concurrency-deadlock-detection-report-ch8.md

What This Crate Solves

This crate corresponds to the Chapter 8 basic experiment, not the Doom extension version.

The key completed tasks are:

  1. thread creation, waiting, and scheduling
  2. mutex / semaphore / condvar synchronization
  3. process-level deadlock detection enable switch
  4. deadlock rejection in mutex_lock and semaphore_down, returning -0xdead
  5. preservation of Chapter 8 base functionality and exercise tests

Reproduce From crates.io

Install cargo-clone if needed:

cargo install cargo-clone

Then:

cargo clone joshua912815-tg-rcore-tutorial-ch8-basic
cd joshua912815-tg-rcore-tutorial-ch8-basic
cargo run

Or:

make run

Exercise mode:

cargo run --features exercise

Reproduce From Git Tag

git clone --branch ch8-basic-crate-v0.8.0-preview.5 --depth 1 https://github.com/Joshua912815/tg-rcore-tutorial.git
cd tg-rcore-tutorial
cargo run

Or:

make run

Prerequisites

You need:

  1. Rust stable
  2. riscv64gc-unknown-none-elf target
  3. qemu-system-riscv64

Install the target if needed:

rustup target add riscv64gc-unknown-none-elf

Build Notes

  • .cargo/config.toml already sets the RISC-V target and QEMU runner.
  • build.rs builds the user programs and packs them into fs.img.
  • This crate includes a local tg-rcore-tutorial-user snapshot, so cargo run does not depend on a parent workspace layout.

Verification Summary

The completed Chapter 8 experiment was verified with:

  • cargo check --features exercise
  • ./test.sh base -> Test PASSED: 22/22
  • ./test.sh exercise -> Test PASSED: 25/25

Key exercise outputs include:

  • deadlock test mutex 1 OK!
  • deadlock test semaphore 1 OK!
  • deadlock test semaphore 2 OK!

Included Documents

License

GPL-3.0