Semester: 5th
Branch: B.Tech (CSE Sec A & B)
Academic Session: July - December, 2024
Institution: RCCIIT
- Operating System Lab Assignments (PCC-CS592)
- Table of Contents
- 1. Shell Script: Reverse a Number
- 2. Shell Script: Factorial Calculation
- 3. Shell Script: Prime Number Check
- 4. Shell Script: Odd or Even Check
- 5. Shell Script: Leap Year Check
- 6. C Program: Parent-Child Communication
- 7. C Program: Thread Creation and IDs
- 8. C Program: Thread Character Count
- 9. C Program: Producer-Consumer Problem
- 10. C Program: Reader-Writer Problem
- 11. Threaded Operations and Shell Script
- 12. C Program: Banker's Algorithm
- Contributions
- Table of Contents
- Task A: Write a shell script to reverse a given number.
- Task B: Implement the FCFS scheduling algorithm in C (assume all processes arrive at time zero).
- Task A: Write a shell script to calculate the factorial of a given number.
- Task B: Implement the SJF scheduling algorithm in C (assume all processes arrive at time zero).
- Task A: Write a shell script to determine if a number is prime.
- Task B: Implement the Priority scheduling algorithm in C (assume all processes arrive at time zero).
- Task A: Write a shell script to check if a number is odd or even.
- Task B: Implement the Round Robin scheduling algorithm in C (assume all processes arrive at time zero).
- Task A: Write a shell script to determine if a year is a leap year.
- Task B: Create a process using
fork()
and replace the child process image withls
.
- Task A: Write a C program to pass a message from the parent to the child process using pipes.
- Task B: Write a C program to implement the
ls | sort
operation.
- Task A: Write a C program to create a thread from the main thread and print the thread ID and process ID of both.
- Task B: Write a shell script to find the maximum of three numbers using
if-else
.
- Write a C program to create a thread that counts the number of characters input by the main thread. Use semaphores to manage simultaneous execution.
- Write a C program to implement the Producer-Consumer problem using semaphores.
- Write a C program to implement the Reader-Writer problem using semaphores.
- Task A: Write a C program to create two threads:
- Thread 1 calculates the factorial of a number.
- Thread 2 reverses a number.
Both threads return their results to the main thread.
- Task B: Write a shell script to swap two numbers without using a third variable.
- Write a C program to implement the Banker's Algorithm for deadlock avoidance.
Feel free to contribute improvements or solutions to the assignments.