# mesmatmm/cs306-spring2025 architecture

> Architecture diagram of the GitHub repository mesmatmm/cs306-spring2025, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mesmatmm/cs306-spring2025
- Repository: https://github.com/mesmatmm/cs306-spring2025

## Overview

##### Project type and purpose
- This is not a customer-facing application but an educational “lab repository” for an Operating Systems course (CS306). It contains three major modules:
- Assembly X8086 exercises (Labs 1–5, Info, More Examples)
- Multithreading in C (Labs 6–9)
- Multithreading in Java (Labs 10–12)
- The README spells out the learning objectives: assembly instructions and memory models, POSIX threads in C, and Java concurrency primitives.

##### File structure
- Top-level: README.md, .gitattributes, an “Info” folder, “More Examples – Assembly”, and individual Lab directories (Lab 01…Lab 11, plus PDFs/MDs of exercises).
- Each Lab NN folder groups source files (.asm, .c, .java) and supporting docs (MD/PDF).
- No build scripts or CI configs—each module is operated with its own toolchain (Emu8086, GCC + pthreads, JDK).

##### README for additional insights
- The outline shows a progression: Learn X8086 assembly, then C threads (Lab 6–9), then Java threads (Lab 10–12).

a. Main components
- Code Repository (Git)
- Assembly Module
– Source files (.asm)
– Emulator: Emu8086
- C Threads Module
– Source files (.c)
– Compiler/Linker: GCC with –pthread
– POSIX Threads Library
- Java Threads Module
– Source files (.java)
– Compiler/Runtime: javac, java
– Concurrency Frameworks: Thread, Runnable, ExecutorService, Locks, Atomics
- Documentation
– Lab specs (MD/PDF)
– Info sheets on CMP, Flags, Jumps
b. Relationships and interactions
- The student (or instructor) clones the Git repo → picks a lab module → invokes the relevant toolchain (Emu8086 / GCC / javac) → runs the executable or emulator.
- Each module is independent: no cross-module code sharing.
- The README orchestrates navigation: it points to each component.
c. Architectural patterns & design principles
- Modular structure by topic and language
- Clear separation of concerns: assembly vs C vs Java
- Self-contained labs with code + documentation
d. Key technologies/frameworks
- Emu8086 for X8086 assembly simulation
- GCC + POSIX Threads for C labs
- Java JDK concurrency APIs for Java labs
- Markdown/PDF for documentation

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Repository and Documentation
    subgraph "Code Repository & Docs"
        CR["Git Repository"]:::repo
        GA[".gitattributes"]:::doc
        RM["README.md"]:::doc
    end

    %% Assembly Module and Docs
    subgraph "Assembly Module (Labs 1–5)" 
        A1["Lab 01"]:::asm
        A2["Lab 02"]:::asm
        A3["Lab 03"]:::asm
        A4["Lab 04"]:::asm
        A5["Lab 05"]:::asm
        MEA["More Examples – Assembly"]:::asm
    end

    subgraph "Assembly Documentation" 
        Info1["CMP & Flags.md"]:::doc
        Info2["CMP & Flags.pdf"]:::doc
        Info3["Comparison.md"]:::doc
        Info4["Comparison.pdf"]:::doc
        Info5["Conditional Jump.md"]:::doc
        Info6["Conditional Jump.pdf"]:::doc
        Info7["Conditional Jumps After CMP.md"]:::doc
        Info8["JMP.pdf"]:::doc
    end

    %% C Threads Module and Docs
    subgraph "C Threads Module (Labs 6–9)"
        C6["Lab 06"]:::cmod
        C7["Lab 07"]:::cmod
        C8["Lab 08"]:::cmod
        C9["Lab 09"]:::cmod
    end

    subgraph "C Threads Documentation"
        CDoc1["Lab 1 - Exercises.md"]:::doc
        CDoc2["Lab 1 - Exercises.pdf"]:::doc
        CDoc3["Lab 2 - Exercises.md"]:::doc
        CDoc4["Lab 2 - Exercises.pdf"]:::doc
        CDoc5["Lab 3 - Exercises.md"]:::doc
        CDoc6["Lab 3 - Exercises.pdf"]:::doc
        CDoc7["Lab 4 - Exercises.md"]:::doc
        CDoc8["Lab 4 - Exercises.pdf"]:::doc
        CDoc9["Lab 5 - Exercises.md"]:::doc
        CDoc10["Lab 5 - Exercises.pdf"]:::doc
    end

    %% Java Threads Module
    subgraph "Java Threads Module (Labs 10–12)"
        J10["Lab 10"]:::jmod
        J11["Lab 11"]:::jmod
        J12["Lab 12"]:::jmod
    end

    %% External Toolchains
    Emu["Emu8086 Emulator"]:::tool
    GCC["GCC Compiler (+ -pthread)"]:::tool
    PThreads["POSIX Threads Library"]:::tool
    Javac["javac Compiler"]:::tool
    JVM["Java Runtime (JVM)"]:::tool

    %% Flows
    CR -->|"clone"| A1
    CR --> A2
    CR --> A3
    CR --> A4
    CR --> A5
    CR --> MEA
    CR --> Info1
    CR --> Info2
    CR --> Info3
    CR --> Info4
    CR --> Info5
    CR --> Info6
    CR --> Info7
    CR --> Info8

    A1 -->|"assemble"| Emu
    A2 --> Emu
    A3 --> Emu
    A4 --> Emu
    A5 --> Emu
    MEA --> Emu
    Emu -->|"emulate"| A1

    CR --> C6
    CR --> C7
    CR --> C8
    CR --> C9
    CR --> CDoc1
    CR --> CDoc2
    CR --> CDoc3
    CR --> CDoc4
    CR --> CDoc5
    CR --> CDoc6
    CR --> CDoc7
    CR --> CDoc8
    CR --> CDoc9
    CR --> CDoc10

    C6 -->|"compile"| GCC
    C7 --> GCC
    C8 --> GCC
    C9 --> GCC
    GCC -->|"link pthreads"| PThreads
    PThreads -->|"run"| C6

    CR --> J10
    CR --> J11
    CR --> J12

    J10 -->|"compile"| Javac
    J11 --> Javac
    J12 --> Javac
    Javac -->|"execute"| JVM
    JVM --> J10

    %% Click Events
    click GA "https://github.com/mesmatmm/cs306-spring2025/blob/main/.gitattributes"
    click RM "https://github.com/mesmatmm/cs306-spring2025/blob/main/README.md"
    click A1 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 01/"
    click A2 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 02/"
    click A3 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 03/"
    click A4 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 04/"
    click A5 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 05/"
    click MEA "https://github.com/mesmatmm/cs306-spring2025/tree/main/More Examples – Assembly/"
    click Info1 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/CMP & Flags.md"
    click Info2 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/CMP & Flags.pdf"
    click Info3 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/Comparison.md"
    click Info4 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/Comparison.pdf"
    click Info5 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/Conditional Jump.md"
    click Info6 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/Conditional Jump.pdf"
    click Info7 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/Conditional Jumps After CMP.md"
    click Info8 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Info/JMP.pdf"
    click C6 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 06/"
    click C7 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 07/"
    click C8 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 08/"
    click C9 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 09/"
    click CDoc1 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 1 - Exercises.md"
    click CDoc2 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 1 - Exercises.pdf"
    click CDoc3 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 2 - Exercises.md"
    click CDoc4 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 2 - Exercises.pdf"
    click CDoc5 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 3 - Exercises.md"
    click CDoc6 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 3 - Exercises.pdf"
    click CDoc7 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 4 - Exercises.md"
    click CDoc8 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 4 - Exercises.pdf"
    click CDoc9 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 5 - Exercises.md"
    click CDoc10 "https://github.com/mesmatmm/cs306-spring2025/blob/main/Lab 5 - Exercises.pdf"
    click J10 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 10/"
    click J11 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 11/"
    click J12 "https://github.com/mesmatmm/cs306-spring2025/tree/main/Lab 12/"

    %% Styles
    classDef repo fill:#B3D4FC,stroke:#0366D6,color:#0366D6;
    classDef doc fill:#EAF5FF,stroke:#0366D6,color:#0366D6;
    classDef asm fill:#D2F8D2,stroke:#2C8A29,color:#2C8A29;
    classDef cmod fill:#FFE4B5,stroke:#D2691E,color:#D2691E;
    classDef jmod fill:#FFF5BA,stroke:#DAA520,color:#DAA520;
    classDef tool fill:#DDDDDD,stroke:#888888,color:#333333;
```
