https://github.com/ar-sayeem/operating-system
This repository includes implementations of CPU Scheduling (Priority Scheduling and Round Robin), Page Replacement (FIFO, LRU, OPT), and the Banker's Algorithm for deadlock prevention, along with basic Linux shell commands and output images of the algorithms for better understanding.
https://github.com/ar-sayeem/operating-system
bankers-algorithm cpu-scheduling linux page-replacement-algorithm
Last synced: 5 months ago
JSON representation
This repository includes implementations of CPU Scheduling (Priority Scheduling and Round Robin), Page Replacement (FIFO, LRU, OPT), and the Banker's Algorithm for deadlock prevention, along with basic Linux shell commands and output images of the algorithms for better understanding.
- Host: GitHub
- URL: https://github.com/ar-sayeem/operating-system
- Owner: ar-sayeem
- Created: 2024-08-31T16:49:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-02T20:32:56.000Z (about 1 year ago)
- Last Synced: 2025-04-08T17:51:55.489Z (10 months ago)
- Topics: bankers-algorithm, cpu-scheduling, linux, page-replacement-algorithm
- Language: C
- Homepage:
- Size: 1.16 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Operating Systems
This repository contains two main sections: **Linux Basic Shell Commands** and **Operating System Algorithms**, providing essential knowledge for command-line operations and OS algorithm implementations.
---
## Linux Basic Shell Commands
A comprehensive guide to essential Linux commands, covering directory navigation, file manipulation, and system monitoring.
### Features
- Detailed explanations and examples of commands:
- `pwd`, `ls`, `mkdir`, `rm`, `cp`, `nano`, etc.
- System commands like `uname`, `whoami`, `uptime`.
- Ideal for beginners and professionals enhancing their Linux command-line skills.
---
## Algorithms
#### 1. CPU Scheduling Algorithm
This part of the project involves the comparison between two CPU scheduling algorithms:
1. **Priority Scheduling (Preemptive)**: Executes processes based on their priority. Interrupts the current process if a higher-priority one arrives.
2. **Round Robin (RR)**: Executes processes cyclically with a user-defined time quantum, ensuring fairness.
**Results**:
- **Priority Scheduling**: Effective for real-time systems but may cause starvation for low-priority processes.
- **Round Robin**: Ensures fairness but requires optimal time quantum tuning.
---
#### 2. Page Replacement Algorithm
This section implements three page replacement strategies:
1. **First-In-First-Out (FIFO)**: Replaces the oldest page.
2. **Least Recently Used (LRU)**: Replaces the least recently accessed page.
3. **Optimal (OPT)**: Replaces the page not used for the longest time.
**Results**:
- **OPT**: Minimizes page faults but impractical due to its predictive nature.
- **LRU**: Outperforms FIFO in reuse-heavy scenarios.
- **FIFO**: Simple but may struggle with older pages still in use.
---
#### 3. Banker's Algorithm
A method to avoid deadlocks in systems by ensuring safe resource allocation.
**Steps**:
1. Calculate the **Need Matrix**: Subtract allocated resources from maximum required resources.
2. Determine the **Safe Sequence**: Verify if resource allocation keeps the system in a safe state.
**Results**:
- Ensures deadlock avoidance but requires predefined resource limits, limiting flexibility in dynamic systems.
---
## Conclusion
### Linux Commands
A robust toolkit for efficient command-line operation.
### Operating System Algorithms
- **CPU Scheduling**: Priority Scheduling excels in critical tasks; Round Robin is fair with careful tuning.
- **Page Replacement**: OPT is ideal; LRU offers practical performance; FIFO is straightforward but may lag.
- **Banker's Algorithm**: Effective for deadlock avoidance in static resource environments.