# levichu51/sistemasoperativos-practicas-23-24 architecture

> Architecture diagram of the GitHub repository levichu51/sistemasoperativos-practicas-23-24, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/levichu51/sistemasoperativos-practicas-23-24
- Repository: https://github.com/levichu51/sistemasoperativos-practicas-23-24

## Overview

- P1 – Filesystem and shell history management (using p3.c and lista_hist.c/h)
- P2 – Memory management (using p2_functions.c and lista_mem.c/h)
- P3 – Process management (using p3_functions.c and lista_procesos.c/h)

##### Main components
a. Central Shell: This is the user interface where commands are interpreted.
b. Filesystem/History Module (P1): Handles file system-related operations and command history.
c. Memory Management Module (P2): Manages aspects related to memory handling and its supporting linked list operations.
d. Process Management Module (P3): Deals with process control, management of processes via linked lists, etc.
e. Build/Compilation Infrastructure: Represent the MakeFile which is used to compile and link all modules.

##### Relationships and interactions
- The Shell is the primary interface and dispatches commands to the appropriate module.
- For operations like listing history or file management, the Shell calls functions provided by the P1 module (implemented in p3.c and supported by lista_hist.c/h).
- When memory management is needed (e.g., allocation and memory state queries), the Shell interacts with the P2 module (using p2_functions.c and lista_mem.c/h).
- For process control or execution, the Shell utilizes the P3 module (via p3_functions.c and lista_procesos.c/h).
- The MakeFile (or Makefile) integrates the compilation process, tying all of these components together.

##### Architectural patterns and design principles
- Modularity: Each practice (P1, P2, P3) is separated into its own component, fostering separation of concerns.
- Layered Interaction: The Shell acts as a high-level controller that invokes the underlying modules based on user commands.
- Loose Coupling: While each module performs distinct operations, they are exposed via well-defined header files (e.g., p1.h, p2_functions.h, p3_functions.h), which minimizes interdependencies.

##### Relevant technologies and languages
- C Programming Language: The core language for implementing the Shell and its modules.
- Make: Utilized as a build tool to compile and link these modules conveniently.
- Standard libraries and possibly OS-level APIs for file, memory, and process management are implicit.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Build/Compilation Infrastructure
    subgraph "Build/Compilation Infrastructure"
        b_mod["Build/Compilation Infrastructure"]:::build
        b1["MakeFile"]:::build
        b2["compilar.txt"]:::build
        b_mod --> b1
        b_mod --> b2
    end

    %% Shell Interface
    subgraph "Shell Interface"
        A["Shell Interface"]:::shell
    end

    %% Filesystem/History Module (P1)
    subgraph "Filesystem/History Module (P1)"
        p1_mod["Filesystem/History Module (P1)"]:::module
        p1_1["p3.c"]:::p1
        p1_2["lista_hist.c"]:::p1
        p1_3["lista_hist.h"]:::p1
        p1_4["p1.h"]:::p1
        p1_mod --> p1_1
        p1_mod --> p1_2
        p1_mod --> p1_3
        p1_mod --> p1_4
    end

    %% Memory Management Module (P2)
    subgraph "Memory Management Module (P2)"
        p2_mod["Memory Management Module (P2)"]:::module
        p2_1["p2_functions.c"]:::p2
        p2_2["p2_functions.h"]:::p2
        p2_3["lista_mem.c"]:::p2
        p2_4["lista_mem.h"]:::p2
        p2_mod --> p2_1
        p2_mod --> p2_2
        p2_mod --> p2_3
        p2_mod --> p2_4
    end

    %% Process Management Module (P3)
    subgraph "Process Management Module (P3)"
        p3_mod["Process Management Module (P3)"]:::module
        p3_1["p3_functions.c"]:::p3
        p3_2["p3_functions.h"]:::p3
        p3_3["lista_procesos.c"]:::p3
        p3_4["lista_procesos.h"]:::p3
        p3_mod --> p3_1
        p3_mod --> p3_2
        p3_mod --> p3_3
        p3_mod --> p3_4
    end

    %% Relationships
    b_mod -->|"builds"| A
    A -->|"dispatches"| p1_mod
    A -->|"dispatches"| p2_mod
    A -->|"dispatches"| p3_mod

    %% Click Events for Build/Compilation Infrastructure
    click b1 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/tree/main/MakeFile"
    click b2 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/compilar.txt"

    %% Click Events for Filesystem/History Module (P1)
    click p1_1 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p3.c"
    click p1_2 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_hist.c"
    click p1_3 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_hist.h"
    click p1_4 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p1.h"

    %% Click Events for Memory Management Module (P2)
    click p2_1 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p2_functions.c"
    click p2_2 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p2_functions.h"
    click p2_3 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_mem.c"
    click p2_4 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_mem.h"

    %% Click Events for Process Management Module (P3)
    click p3_1 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p3_functions.c"
    click p3_2 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/p3_functions.h"
    click p3_3 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_procesos.c"
    click p3_4 "https://github.com/levichu51/sistemasoperativos-practicas-23-24/blob/main/lista_procesos.h"

    %% Styles
    classDef shell fill:#FFD700,stroke:#333,stroke-width:2px,color:#000;
    classDef module fill:#87CEFA,stroke:#333,stroke-width:2px,color:#000;
    classDef p1 fill:#98FB98,stroke:#333,stroke-width:1px,color:#000;
    classDef p2 fill:#AFEEEE,stroke:#333,stroke-width:1px,color:#000;
    classDef p3 fill:#FFC0CB,stroke:#333,stroke-width:1px,color:#000;
    classDef build fill:#FFE4B5,stroke:#333,stroke-width:2px,color:#000;
```
