# xxinggod/os-course-lab architecture

> Architecture diagram of the GitHub repository xxinggod/os-course-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xxinggod/os-course-lab
- Repository: https://github.com/xxinggod/os-course-lab

## Overview

This repository is an operating-systems course built around progressively implementing and using the ChCore microkernel. The student workflow moves from ARM assembly and booting through memory management, processes and threads, multicore scheduling and IPC, filesystem services, and optional GUI applications. Lab2’s sampled kernel entry initializes memory, interrupts, scheduling, and the first user thread; later labs add user-facing interfaces and services. Several Lab4 and Lab6 subsystems are documented but not represented by sampled implementation files, so their wiring is shown only where the README supports it.

Main entry points: [`Lab2/kernel/arch/aarch64/main.c`](https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/arch/aarch64/main.c) (Kernel entry), [`Lab6/user/apps/lv_gba_emu/main.c`](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_gba_emu/main.c) (User applications), [`Lab2/kernel/mm/mm.c`](https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/mm/mm.c) (Memory management), [`Lab3/kernel/syscall/syscall.c`](https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/syscall/syscall.c) (System calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_course["Course progression"]
  node_lab0["ARM assembly<br/>[bomb.c]"]
  node_boot["Kernel boot<br/>[init_c.c]"]
  node_vfs_lab["VFS lab"]
end

subgraph group_kernel["Kernel runtime"]
  node_memory["Memory management<br/>[mm.c]"]
  node_faults["Page faults<br/>[pgfault_handler.c]"]
  node_kernel_entry["Kernel entry<br/>[main.c]"]
  node_syscalls["System calls<br/>[syscall.c]"]
  node_objects["Process objects<br/>[thread.c]"]
  node_scheduler["Thread scheduling<br/>[sched.h]"]
  node_ipc["Capability IPC<br/>[channel.h]"]
end

subgraph group_services["User services"]
  node_tmpfs["tmpfs server<br/>[main.c]"]
  node_user_app["User applications<br/>[main.c]"]
end

subgraph group_gui["GUI applications"]
  node_wayland["Wayland client"]
  node_page_manager["Page manager"]
  node_fragments["LVGL fragments"]
  node_gba["GBA emulator<br/>[main.c]"]
  node_compositor["Wayland compositor"]
end

node_student(("Student"))

node_student -->|"studies"| node_lab0
node_lab0 -->|"prepares for"| node_boot
node_boot -->|"progresses to"| node_memory
node_memory -->|"progresses to"| node_kernel_entry
node_kernel_entry -->|"initializes"| node_memory
node_kernel_entry -->|"initializes"| node_scheduler
node_kernel_entry -->|"creates root thread"| node_objects
node_memory -->|"handles faults"| node_faults
node_kernel_entry -->|"progresses to"| node_syscalls
node_syscalls -->|"manages processes"| node_objects
node_syscalls -->|"progresses to"| node_ipc
node_ipc -->|"progresses to"| node_vfs_lab
node_vfs_lab -->|"implements filesystem"| node_tmpfs
node_student -->|"runs applications"| node_user_app
node_user_app -->|"uses protocol"| node_wayland
node_user_app -.->|"uses page navigation"| node_page_manager
node_page_manager -.->|"GUI capability"| node_fragments
node_wayland -->|"communicates with"| node_compositor
node_user_app -->|"launches emulator"| node_gba

click node_lab0 "https://github.com/xxinggod/os-course-lab/blob/main/Lab0/bomb.c"
click node_boot "https://github.com/xxinggod/os-course-lab/blob/main/Lab1/kernel/arch/aarch64/boot/raspi3/init/init_c.c"
click node_memory "https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/mm/mm.c"
click node_faults "https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/mm/pgfault_handler.c"
click node_kernel_entry "https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/arch/aarch64/main.c"
click node_syscalls "https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/syscall/syscall.c"
click node_objects "https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/object/thread.c"
click node_scheduler "https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/include/sched/sched.h"
click node_ipc "https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/include/ipc/channel.h"
click node_tmpfs "https://github.com/xxinggod/os-course-lab/blob/main/Lab5/user/system-services/system-servers/tmpfs/main.c"
click node_user_app "https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_gba_emu/main.c"
click node_wayland "https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/chcore-libs/graphic/wayland/include/wayland-client-protocol.h"
click node_page_manager "https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_lib_100ask/src/lv_100ask_page_manager/lv_100ask_page_manager.c"
click node_fragments "https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/chcore-libs/graphic/lvgl/lvgl/src/extra/others/fragment/lv_fragment_manager.c"
click node_gba "https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_gba_emu/main.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lab0,node_boot,node_vfs_lab toneBlue
class node_memory,node_faults,node_kernel_entry,node_syscalls,node_objects,node_scheduler,node_ipc toneAmber
class node_tmpfs,node_user_app toneMint
class node_wayland,node_page_manager,node_fragments,node_gba,node_compositor toneRose
class node_student toneIndigo
```

## Components

### Course progression

- [ARM assembly](https://github.com/xxinggod/os-course-lab/blob/main/Lab0/bomb.c): `Lab0/bomb.c`
- [Kernel boot](https://github.com/xxinggod/os-course-lab/blob/main/Lab1/kernel/arch/aarch64/boot/raspi3/init/init_c.c): `Lab1/kernel/arch/aarch64/boot/raspi3/init/init_c.c`
- **VFS lab**

### Kernel runtime

- [Memory management](https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/mm/mm.c): `Lab2/kernel/mm/mm.c`
- [Page faults](https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/mm/pgfault_handler.c): `Lab2/kernel/mm/pgfault_handler.c`
- [Kernel entry](https://github.com/xxinggod/os-course-lab/blob/main/Lab2/kernel/arch/aarch64/main.c): `Lab2/kernel/arch/aarch64/main.c`
- [System calls](https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/syscall/syscall.c): `Lab3/kernel/syscall/syscall.c`
- [Process objects](https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/object/thread.c): `Lab3/kernel/object/thread.c`
- [Thread scheduling](https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/include/sched/sched.h): `Lab3/kernel/include/sched/sched.h`
- [Capability IPC](https://github.com/xxinggod/os-course-lab/blob/main/Lab3/kernel/include/ipc/channel.h): `Lab3/kernel/include/ipc/channel.h`

### User services

- [tmpfs server](https://github.com/xxinggod/os-course-lab/blob/main/Lab5/user/system-services/system-servers/tmpfs/main.c): `Lab5/user/system-services/system-servers/tmpfs/main.c`
- [User applications](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_gba_emu/main.c): `Lab6/user/apps/lv_gba_emu/main.c`

### GUI applications

- [Wayland client](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/chcore-libs/graphic/wayland/include/wayland-client-protocol.h): `Lab6/user/chcore-libs/graphic/wayland/include/wayland-client-protocol.h`
- [Page manager](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_lib_100ask/src/lv_100ask_page_manager/lv_100ask_page_manager.c): `Lab6/user/apps/lv_lib_100ask/src/lv_100ask_page_manager/lv_100ask_page_manager.c`
- [LVGL fragments](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/chcore-libs/graphic/lvgl/lvgl/src/extra/others/fragment/lv_fragment_manager.c): `Lab6/user/chcore-libs/graphic/lvgl/lvgl/src/extra/others/fragment/lv_fragment_manager.c`
- [GBA emulator](https://github.com/xxinggod/os-course-lab/blob/main/Lab6/user/apps/lv_gba_emu/main.c): `Lab6/user/apps/lv_gba_emu/main.c`
- **Wayland compositor**

### Other components

- **Student**

## Connections

- Student → ARM assembly: studies
- ARM assembly → Kernel boot: prepares for
- Kernel boot → Memory management: progresses to
- Memory management → Kernel entry: progresses to
- Kernel entry → Memory management: initializes
- Kernel entry → Thread scheduling: initializes
- Kernel entry → Process objects: creates root thread
- Memory management → Page faults: handles faults
- Kernel entry → System calls: progresses to
- System calls → Process objects: manages processes
- System calls → Capability IPC: progresses to
- Capability IPC → VFS lab: progresses to
- VFS lab → tmpfs server: implements filesystem
- Student → User applications: runs applications
- User applications → Wayland client: uses protocol
- User applications → Page manager: uses page navigation
- Page manager → LVGL fragments: GUI capability
- Wayland client → Wayland compositor: communicates with
- User applications → GBA emulator: launches emulator
