# shanju1010/os-program-demo architecture

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

- Interactive diagram: https://gitdiagram.com/shanju1010/os-program-demo
- Repository: https://github.com/shanju1010/os-program-demo

## Overview

This repository is a set of standalone C operating-system lab demonstrations, not one integrated application. The user supplies inputs to an individual program, which runs an algorithm or system-call demonstration and prints its results. The README highlights CPU scheduling and producer–consumer synchronization; the tree and sampled source also show memory allocation and paging, deadlock avoidance, disk scheduling, dining philosophers, process creation, and file copying. Programs are independent; edges show only their user-facing run-and-output behavior, not calls between them.

Main entry points: [`fcfs-cpu-scheduling.c`](https://github.com/shanju1010/os-program-demo/blob/main/fcfs-cpu-scheduling.c) (FCFS scheduling), [`sjf-non-preemptive-scheduling.c`](https://github.com/shanju1010/os-program-demo/blob/main/sjf-non-preemptive-scheduling.c) (SJF scheduling), [`round-robin-cpu-scheduling.c`](https://github.com/shanju1010/os-program-demo/blob/main/round-robin-cpu-scheduling.c) (Round Robin), [`priority-cpu-scheduling.c`](https://github.com/shanju1010/os-program-demo/blob/main/priority-cpu-scheduling.c) (Priority scheduling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cpu["CPU Scheduling"]
  node_fcfs["FCFS scheduling"]
  node_sjf["SJF scheduling"]
  node_roundrobin["Round Robin"]
  node_priority["Priority scheduling"]
end

subgraph group_memory["Memory And Resources"]
  node_contiguous["Contiguous allocation"]
  node_paging["Page replacement"]
  node_banker["Banker's algorithm"]
  node_disk["Disk scheduling"]
end

subgraph group_sync["Synchronization"]
  node_producer["Producer-consumer"]
  node_philosophers["Dining philosophers"]
end

subgraph group_syscalls["Process And Files"]
  node_forkexec["Fork exec wait"]
  node_filecopy["System-call file copy"]
end

node_user(("Lab user"))
node_console["Console results"]

node_user -->|"provides process data"| node_fcfs
node_fcfs -->|"prints metrics"| node_console
node_user -->|"provides process data"| node_sjf
node_sjf -->|"prints metrics"| node_console
node_user -->|"provides process data"| node_roundrobin
node_roundrobin -->|"prints metrics"| node_console
node_user -->|"provides process data"| node_priority
node_priority -->|"prints metrics"| node_console
node_user -->|"provides block and process sizes"| node_contiguous
node_contiguous -->|"prints allocations"| node_console
node_user -->|"provides page references"| node_paging
node_paging -->|"prints faults and frames"| node_console
node_user -->|"provides resource data"| node_banker
node_banker -->|"prints safety results"| node_console
node_user -->|"provides requests and head data"| node_disk
node_disk -->|"prints seek results"| node_console
node_user -->|"runs demonstration"| node_producer
node_producer -->|"prints activity"| node_console
node_user -->|"runs demonstration"| node_philosophers
node_philosophers -->|"prints activity"| node_console
node_user -->|"runs demonstration"| node_forkexec
node_forkexec -->|"prints process status"| node_console
node_user -->|"provides file names"| node_filecopy
node_filecopy -->|"reports copy result"| node_console

click node_fcfs "https://github.com/shanju1010/os-program-demo/blob/main/fcfs-cpu-scheduling.c"
click node_sjf "https://github.com/shanju1010/os-program-demo/blob/main/sjf-non-preemptive-scheduling.c"
click node_roundrobin "https://github.com/shanju1010/os-program-demo/blob/main/round-robin-cpu-scheduling.c"
click node_priority "https://github.com/shanju1010/os-program-demo/blob/main/priority-cpu-scheduling.c"
click node_contiguous "https://github.com/shanju1010/os-program-demo/blob/main/11%20%20Memory%20Management%20-%20Contiguous%20Allocation.c"
click node_paging "https://github.com/shanju1010/os-program-demo/blob/main/Memory%20Management%20-%20Page%20Replacement%20Algorithms.c"
click node_banker "https://github.com/shanju1010/os-program-demo/blob/main/Deadlock%20Avoidance%20-%20Banker's%20Algorithm.c"
click node_disk "https://github.com/shanju1010/os-program-demo/blob/main/Disk-Scheduling-Algorithms.c"
click node_producer "https://github.com/shanju1010/os-program-demo/blob/main/producer-consumer-semaphores.c"
click node_philosophers "https://github.com/shanju1010/os-program-demo/blob/main/PS-Dining%20Philosophers%20Problem%20using%20Semaphores.c"
click node_forkexec "https://github.com/shanju1010/os-program-demo/blob/main/os_lab_fork_exec_wait.c"
click node_filecopy "https://github.com/shanju1010/os-program-demo/blob/main/file-copy-system-calls.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_fcfs,node_sjf,node_roundrobin,node_priority,node_user toneBlue
class node_contiguous,node_paging,node_banker,node_disk toneAmber
class node_producer,node_philosophers toneMint
class node_forkexec,node_filecopy toneRose
class node_console toneIndigo
```

## Components

### CPU Scheduling

- [FCFS scheduling](https://github.com/shanju1010/os-program-demo/blob/main/fcfs-cpu-scheduling.c): `fcfs-cpu-scheduling.c`
- [SJF scheduling](https://github.com/shanju1010/os-program-demo/blob/main/sjf-non-preemptive-scheduling.c): `sjf-non-preemptive-scheduling.c`
- [Round Robin](https://github.com/shanju1010/os-program-demo/blob/main/round-robin-cpu-scheduling.c): `round-robin-cpu-scheduling.c`
- [Priority scheduling](https://github.com/shanju1010/os-program-demo/blob/main/priority-cpu-scheduling.c): `priority-cpu-scheduling.c`

### Memory And Resources

- [Contiguous allocation](https://github.com/shanju1010/os-program-demo/blob/main/11%20%20Memory%20Management%20-%20Contiguous%20Allocation.c): `11 Memory Management - Contiguous Allocation.c`
- [Page replacement](https://github.com/shanju1010/os-program-demo/blob/main/Memory%20Management%20-%20Page%20Replacement%20Algorithms.c): `Memory Management - Page Replacement Algorithms.c`
- [Banker's algorithm](https://github.com/shanju1010/os-program-demo/blob/main/Deadlock%20Avoidance%20-%20Banker's%20Algorithm.c): `Deadlock Avoidance - Banker's Algorithm.c`
- [Disk scheduling](https://github.com/shanju1010/os-program-demo/blob/main/Disk-Scheduling-Algorithms.c): `Disk-Scheduling-Algorithms.c`

### Synchronization

- [Producer-consumer](https://github.com/shanju1010/os-program-demo/blob/main/producer-consumer-semaphores.c): `producer-consumer-semaphores.c`
- [Dining philosophers](https://github.com/shanju1010/os-program-demo/blob/main/PS-Dining%20Philosophers%20Problem%20using%20Semaphores.c): `PS-Dining Philosophers Problem using Semaphores.c`

### Process And Files

- [Fork exec wait](https://github.com/shanju1010/os-program-demo/blob/main/os_lab_fork_exec_wait.c): `os_lab_fork_exec_wait.c`
- [System-call file copy](https://github.com/shanju1010/os-program-demo/blob/main/file-copy-system-calls.c): `file-copy-system-calls.c`

### Other components

- **Lab user**
- **Console results**

## Connections

- Lab user → FCFS scheduling: provides process data
- FCFS scheduling → Console results: prints metrics
- Lab user → SJF scheduling: provides process data
- SJF scheduling → Console results: prints metrics
- Lab user → Round Robin: provides process data
- Round Robin → Console results: prints metrics
- Lab user → Priority scheduling: provides process data
- Priority scheduling → Console results: prints metrics
- Lab user → Contiguous allocation: provides block and process sizes
- Contiguous allocation → Console results: prints allocations
- Lab user → Page replacement: provides page references
- Page replacement → Console results: prints faults and frames
- Lab user → Banker's algorithm: provides resource data
- Banker's algorithm → Console results: prints safety results
- Lab user → Disk scheduling: provides requests and head data
- Disk scheduling → Console results: prints seek results
- Lab user → Producer-consumer: runs demonstration
- Producer-consumer → Console results: prints activity
- Lab user → Dining philosophers: runs demonstration
- Dining philosophers → Console results: prints activity
- Lab user → Fork exec wait: runs demonstration
- Fork exec wait → Console results: prints process status
- Lab user → System-call file copy: provides file names
- System-call file copy → Console results: reports copy result
