# eitan-wajsberg/tp-sistemas-operativos-2024-1c architecture

> Architecture diagram of the GitHub repository eitan-wajsberg/tp-sistemas-operativos-2024-1c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c
- Repository: https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c

## Overview

##### Project Type and Purpose
- The project simulates distributed system components. It includes modules for CPU simulation, a kernel for process management and scheduling, memory management (memoria), and I/O management (entradasalida).
- The README also highlights dependencies (the so-commons-library) and deployment via the so-deploy script, indicating the use of real systems integration techniques in an educational environment.

##### Analysis of the File Structure
- Top-Level Components:
 "cpu": Contains the CPU simulation logic, including the instruction cycle (ciclo_de_instruccion) and modules for handling connections and configurations.
 "kernel": Implements process scheduling, command console, interface management, and resource handling. It includes subdirectories such as “planificacion” (for long- and short-term planning), “conexiones”, and “consola”.
 "memoria": Handles memory management with modules for configuration, connection handling (for CPU, IO, kernel), memory management logic (gestion_memoria), and tables for memory allocation.
 "entradasalida": Manages I/O operations and the filesystem aspect. It includes configuration files for various I/O devices and source code for managing connections and system files.
 "utils": Contains shared functionalities and utility functions such as communications, serialization, and support for shared data structures.

- Common patterns:
 The presence of “conexiones” in each module indicates a design that emphasizes inter-module communication through network or IPC-like mechanisms.
 Each module has its own makefile and configuration files, implying separation of concerns and independent compilation/deployment.
 Inclusion of scripts in the kernel and memoria folders suggests both testing scenarios and automated deployment/testing scripts.

a. Main Components:
– CPU Module: Simulates CPU instruction cycles and interacts with other modules.
– Kernel Module: Acts as the core orchestrator for process scheduling, interfacing with both the CPU and the memory.
– Memory Module (Memoria): Manages memory allocation, read/write operations, and interacts via connections with CPU, Kernel, and IO.
– Entradasalida Module (I/O): Handles input/output operations and supports the file system simulation.
– Utils Module: Provides shared libraries (communication, serialization, data structures) used by all other modules.

b. Relationships and Interactions:
– The CPU sends instructions and state updates to the Kernel; it also might request memory operations from the Memoria module.
– The Kernel manages process lifecycle and scheduling, interacting with both CPU (for process execution simulation) and Memoria (for memory allocation and management).
– The Memoria module handles memory requests from both the CPU and Kernel, maintaining tables and managing free frames.
– The Entradasalida module handles I/O requests that may be triggered by both the Kernel and the Memoria module (for file system operations).
– The shared Utilties module underpins inter-process communications and data serialization across modules.

c. Architectural Patterns and Design Principles:
– Modular design: Each component (CPU, Kernel, Memoria, Entradasalida, and Utils) is independently developed, compiled, and then integrated.
– Use of configuration files: Every module contains its own configuration settings that might modify runtime behavior in a distributed system.
– Clear separation of concerns: Scheduling, memory management, I/O, and CPU simulation are compartmentalized into distinct modules.
– Communication abstraction: “conexiones” directories in modules indicate a pattern of abstracting inter-module communications.

d. Relevant Technologies, Frameworks, and Libraries:
– so-commons-library: A dependency that provides common functionalities, possibly for logging, thread management, or communication.
– Build tools (makefiles) for compiling each module.
– Visual Studio Code workspace setup (tp.code-workspace) to handle the project in an IDE.
– Deployment script (so-deploy) to package and deploy the project across machines.

##### Including Elements
– Additional Details: Optionally, include annotations for configuration files and deployment scripts if these are critical to understanding the architecture.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Main Modules
    CPUMain["CPU Module"]:::cpu
    KernelMain["Kernel Module"]:::kernel
    MemoriaMain["Memoria Module"]:::memoria
    IOMain["Entradasalida Module"]:::entradasalida
    UtilsMain["Utils Module"]:::utils

    %% Interactions between Main Modules
    CPUMain -->|"sends_instructions"| KernelMain
    CPUMain -->|"requests_memory"| MemoriaMain
    KernelMain -->|"allocates_memory"| MemoriaMain
    KernelMain -->|"IO_commands"| IOMain
    MemoriaMain -->|"file_system_ops"| IOMain

    CPUMain -->|"uses_comm"| UtilsMain
    KernelMain -->|"uses_comm"| UtilsMain
    MemoriaMain -->|"uses_comm"| UtilsMain
    IOMain -->|"uses_comm"| UtilsMain

    %% CPU Subcomponents
    subgraph "CPU Components"
        CPUInst["Ciclo de Instrucción"]:::cpu
        CPUCon["Conexiones"]:::cpu
    end
    CPUMain --> CPUInst
    CPUMain --> CPUCon

    %% Kernel Subcomponents
    subgraph "Kernel Components"
        KPlan["Planificación"]:::kernelSub
        KCon["Consola"]:::kernelSub
        KConn["Conexiones"]:::kernelSub
    end
    KernelMain --> KPlan
    KernelMain --> KCon
    KernelMain --> KConn

    %% Memoria Subcomponents
    subgraph "Memoria Components"
        MConn["Conexiones"]:::memoria
        MTablas["Tablas de Memoria"]:::memoria
    end
    MemoriaMain --> MConn
    MemoriaMain --> MTablas

    %% Entradasalida Subcomponents
    subgraph "Entradasalida Components"
        IOConf["Configuraciones"]:::entradasalida
    end
    IOMain --> IOConf

    %% Utils Subcomponents
    subgraph "Utils Components"
        ULib["Communication & Shared Data"]:::utils
    end
    UtilsMain --> ULib

    %% Click Events
    click CPUMain "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/cpu/"
    click CPUInst "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/blob/main/cpu/src/ciclo_de_instruccion.c"
    click CPUCon "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/cpu/src/conexiones/"

    click KernelMain "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/kernel/"
    click KPlan "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/kernel/src/planificacion"
    click KCon "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/kernel/src/consola"
    click KConn "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/kernel/src/conexiones"

    click MemoriaMain "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/memoria/"
    click MConn "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/memoria/src/conexiones"
    click MTablas "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/memoria/src/tablas"

    click IOMain "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/entradasalida/"
    click IOConf "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/entradasalida/configuraciones"

    click UtilsMain "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/utils/"
    click ULib "https://github.com/eitan-wajsberg/tp-sistemas-operativos-2024-1c/tree/main/utils/src/utils"

    %% Styles
    classDef cpu fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef kernel fill:#cce5ff,stroke:#007bff,stroke-width:2px;
    classDef memoria fill:#ccffcc,stroke:#28a745,stroke-width:2px;
    classDef entradasalida fill:#ffedcc,stroke:#fd7e14,stroke-width:2px;
    classDef utils fill:#e0ccff,stroke:#8a2be2,stroke-width:2px;
    classDef kernelSub fill:#b3d1ff,stroke:#0056b3,stroke-width:2px;
```
