An open API service indexing awesome lists of open source software.

https://github.com/webdevbysubha/os-lab


https://github.com/webdevbysubha/os-lab

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# Operating System Lab Solutions πŸ’»

This repository contains solutions to the **Operating System Lab** questions (Paper Code: `PCC-CS592`) for the 5th Semester of B.Tech (CSE) at RCCIIT. Each solution is organized question-wise into separate folders for easy navigation. πŸš€

---

## πŸ“‚ Folder Structure
```plaintext
πŸ“¦ Operating-System-Lab-Solutions
β”œβ”€β”€ Question 1
β”‚ β”œβ”€β”€ reverse_number.sh # Shell script to find the reverse of a number
β”‚ └── fcfs.c # C program for FCFS Scheduling Algorithm
β”œβ”€β”€ Question 2
β”‚ β”œβ”€β”€ factorial.sh # Shell script to find factorial of a number
β”‚ └── sjf.c # C program for SJF Scheduling Algorithm
β”œβ”€β”€ Question 3
β”‚ β”œβ”€β”€ is_prime.sh # Shell script to check if a number is prime
β”‚ └── priority.c # C program for Priority Scheduling Algorithm
β”œβ”€β”€ Question 4
β”‚ β”œβ”€β”€ odd_or_even.sh # Shell script to check if a number is odd or even
β”‚ └── round_robin.c # C program for Round Robin Scheduling Algorithm
β”œβ”€β”€ Question 5
β”‚ β”œβ”€β”€ leap_year.sh # Shell script to determine if a year is a leap year
β”‚ └── fork_exec.c # C program to demonstrate process creation using fork() and exec()
β”œβ”€β”€ Question 6
β”‚ β”œβ”€β”€ pipe_message.c # C program for parent-to-child message passing using pipes
β”‚ └── ls_sort.c # C program to implement `ls | sort`
β”œβ”€β”€ Question 7
β”‚ β”œβ”€β”€ thread_id.c # C program to create threads and display thread/process IDs
β”‚ └── max_of_three.sh # Shell script to find the maximum of three numbers
β”œβ”€β”€ Question 8
β”‚ └── semaphore_threads.c # C program for simultaneous threads using semaphore
β”œβ”€β”€ Question 9
β”‚ └── producer_consumer.c # C program to solve the Producer-Consumer problem using semaphore
β”œβ”€β”€ Question 10
β”‚ └── reader_writer.c # C program to solve the Reader-Writer problem using semaphore
β”œβ”€β”€ Question 11
β”‚ β”œβ”€β”€ factorial_thread.c # C program to calculate factorial and reverse using threads
β”‚ └── swap_numbers.sh # Shell script to swap two numbers without using a third variable
β”œβ”€β”€ Question 12
β”‚ └── bankers_algorithm.c # C program to implement the Banker’s Algorithm for deadlock avoidance
```
---

## βš™οΈ Prerequisites
- **Linux/Unix Shell**: To execute shell scripts.
- **C Compiler (GCC)**: To compile and run C programs.
- **Basic Programming Knowledge**: Familiarity with C and shell scripting is recommended.

---

## πŸ“– Learnings
This repository offers practical exposure to:
- Writing shell scripts for problem-solving.
- Implementing process scheduling algorithms like FCFS, SJF, Priority, and Round Robin.
- Working with inter-process communication techniques like pipes.
- Creating and managing threads in C.
- Using semaphores for synchronization in multithreading and solving classical problems like Producer-Consumer and Reader-Writer.
- Understanding deadlock avoidance with Banker’s Algorithm.

---

## πŸ™Œ Contributions
Contributions are always welcome!
If you have suggestions, improvements, or additional solutions, feel free to:
1. Fork this repository.
2. Create a new branch for your changes.
3. Submit a pull request with a brief description of the enhancement.

Let’s grow and learn together! 🌱

---

✨ **Happy Coding!** πŸš€