MCPcopy Index your code
hub / github.com/belowthetree/TisuOS

github.com/belowthetree/TisuOS @v3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0 ↗ · + Follow
2,288 symbols 5,462 edges 268 files 462 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

太素 TisuOS

QQ交流群号:961871659

太素OS是一个用 Rust 编写的基于 RISCV 架构的操作系统,主要用于教学目的,为初学者提供参考。

Tisu OS is a RISCV-based operating system written in Rust and designed primarily for educational purposes and as a reference for beginners.

gitee 地址:https://gitee.com/belowthetree/tisu-os (包含硬盘镜像,最新推送)

github 地址:https://github.com/belowthetree/TisuOS (纯源码版本,删除了镜像、target 文件夹)

编译

环境:

  • wsl
  • rust-nightly

make build

根据热心群友 wjl 提醒,今后版本不使用 gcc 编译

运行:

平台:QEMU

  • qemu-system-riscv64

指令:make run

包含

  • 基础教程部分,为 os-tutorial
  • 扩展部分 tisuos,重构的代码

基础教程部分有一些 BUG,不过并不影响大部分情况下的运行,扩展重构部分修复了一些 BUG 并且优化了整个系统的结构。如果你想使用本系统的源码,推荐使用扩展部分,即 tisuos/ 目录下的源码。

There are a few bugs in the tutorial section os-tutorial/, but they can work in most cases, and the extended section fixes some bugs and optimizes the overall structure of the system. If you want to use the source code of this system, it is recommended to use the extended section, which is the source code in the tisuos/ directory.

教程部分

本项目提供教程,默认学习者具备基本的计算机知识,包括但不限于:

  • 编译、链接
  • 进程、线程的基本概念
  • 内存的基本概念
  • 一定的算法知识

其中涉及到的

  • Rust 语言部分需要学习者自学(不难)
  • 链接文件不需要掌握,看得懂会改就行
  • Makefile 会查资料修改就行

大部分的章节都有对应的源码(除了部分内容较少的章节,一般在下一章节可以找到对应的源码)。后面章节不提供章节源码,可以在os-tutorial 文件夹中获取。为了减小体积,会删除 target、硬盘镜像,需要自己新建。

完整的内核最新版在 gitee 保持更新,会同步纯源码版(网速原因)到 github (当我想起来的时候)。

内核功能

功能 内容 状况
设备管理 UART、块设备、GPU、键盘、鼠标 已完成,但网络等其它设备待添加
中断处理 时钟中断、系统调用、错误处理 完成基本功能
内存管理 页表管理(最先适配方式)、堆内存管理(类SLAB算法) 已完成
任务系统 进程、线程、调度器 完成基本功能,其它调度方法待添加
文件系统 支持 FAT32 格式读取、写入 完成基本功能,考虑添加其它格式
图形桌面 拥有类似 dock、窗口的功能 只有基本浏览交互功能

License

GPL-v3

Extension points exported contracts — how you extend this code

Transform (Interface)
## 变化要求 [6 implementers]
os-tutorial/src/desktop/desktop_trait.rs
IO (Interface)
## 接口要求 [1 implementers]
教程/第九章/tisuos/src/filesystem/operation.rs
SchedulerOp (Interface)
## 调度器操作要求 算法实现由调度器自身决定 [1 implementers]
tisuos/src/task/task_manager.rs
GridBlock (Interface)
(no doc) [1 implementers]
user_lib/src/libs/graphic/canvas/require.rs
Circle (Interface)
# Mask 遮罩,用来显示特定区域 2020年12月30日 zg 圆形遮罩 [1 implementers]
os-tutorial/src/graphic/mask.rs
Directory (Interface)
(no doc) [1 implementers]
教程/第九章/tisuos/src/filesystem/operation.rs
TaskPoolBasicOp (Interface)
## 任务池操作要求 与任务池的操作根据任务号进行,不获取引用,以便模块化 [1 implementers]
tisuos/src/task/require.rs
IO (Interface)
## 接口要求 [1 implementers]
os-tutorial/src/filesystem/operation.rs

Core symbols most depended-on inside this repo

add
called by 382
os-tutorial/src/interact/input.rs
push
called by 129
tisuos/src/virtio/input_buffer.rs
is_null
called by 87
教程/第九章/tisuos/src/filesystem/elf.rs
lock
called by 87
os-tutorial/src/sync.rs
unlock
called by 56
os-tutorial/src/sync.rs
scale32
called by 45
os-tutorial/src/virtio/device.rs
unlock
called by 40
教程/第九章/tisuos/src/sync.rs
val
called by 38
os-tutorial/src/memory/page.rs

Shape

Method 1,286
Function 634
Class 258
Enum 90
Interface 20

Languages

Rust100%

Modules by API surface

tisuos/src/filesystem/format/fat32.rs49 symbols
教程/第九章/tisuos/src/filesystem/fat32.rs48 symbols
os-tutorial/src/filesystem/fat32.rs48 symbols
os-tutorial/src/virtio/gpu_device.rs43 symbols
os-tutorial/src/desktop/implement.rs33 symbols
教程/第八章/tisuos/src/memory/page_table.rs32 symbols
教程/第五章/tisuos/src/memory/page_table.rs32 symbols
教程/第九章/tisuos/src/memory/page_table.rs32 symbols
教程/第七章/tisuos/src/memory/page_table.rs32 symbols
os-tutorial/src/memory/page_table.rs32 symbols
os-tutorial/src/memory/global_allocator.rs31 symbols
教程/第八章/tisuos/src/memory/global_allocator.rs29 symbols

For agents

$ claude mcp add TisuOS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact