https://github.com/webdevbysubha/os-lab
https://github.com/webdevbysubha/os-lab
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/webdevbysubha/os-lab
- Owner: webdevbysubha
- Created: 2025-01-21T16:47:47.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-21T17:00:13.000Z (5 months ago)
- Last Synced: 2025-02-01T17:17:47.104Z (5 months ago)
- Language: C
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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!** π