1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml ' !include <C4/C4_Container>
Container_Boundary(os, "os", "kernel"){ Component(main, "os/src/main.rs", "mod", "初始化 Trap处理并加载和执行应用") Component(lang_items, "os/src/lang_items.rs", "mod", "实现panic_handler") Component(console, "os/src/console.rs", "mod", "将打印字符的 SBI 接口封装实现格式化输出") Component(logging, "os/src/logging.rs", "mod", "日志库封装") Component(sbi, "os/src/sbi.rs", "mod", "封装 sbi") Component(batch, "os/src/batch.rs", "mod", "user_app批处理") Component(trap, "os/src/trap/", "mod", "Trap处理") Component(syscall, "os/src/syscall/", "mod", "系统调用") Component(sync, "os/src/sync/", "mod", "包装了Refcell,") } ' Lay_L(console, lang_items) ' Lay_L(lang_items , logging)
Container(user, "user", "crate", "应用程序") Container(rustsbi, "rustsbi", "bin", "") Container(log, "log", "crate", "日志库") Container(riscv, "riscv", "crate", "Low level access to RISC-V processors") Container(lazy_static, "lazy_static", "crate", "A macro for declaring lazily evaluated statics") Container(hart, "hart", "Hardware Thread", "qemu模拟的硬件线程")
Rel_D(main, console, "") Rel_D(main, logging, "init()") Rel(logging, log, "impl Log") Rel_L(main, log, "log相关函数") Rel(main, batch, "init() \n run_next_app()") Rel(main, trap, "init()") Rel(trap, console, "") Rel(trap, riscv, "csr寄存器操作") Rel(trap, syscall, "处理syscall") Rel(trap, user, "通过trap.S::__restore\n 启动user") Rel(batch, sync, "UPSafeCell") Rel(batch, lazy_static, "延迟初始化user_MANAGER") BiRel(batch, trap, "run_next_app()\n context相关操作 trap.S::__restore") Rel(syscall, batch, "run_next_app()") Rel(console, sbi, "console_putchar()") Rel(log, console, "") Rel(sbi, hart, "ecall") Rel(hart, sbi, "中断处理") Rel(user, hart, "trap") Rel(hart, trap, "中断处理\n by trap.S::__alltraps") Rel(lang_items, console, "发生 os panic 时\n调用println!()") Rel(lang_items, sbi, "发生 os panic 时\n调用shutdown()")
|