Skip to content

Latest commit

 

History

History
103 lines (72 loc) · 7.95 KB

README.md

File metadata and controls

103 lines (72 loc) · 7.95 KB

Operating System Lab Assignments (PCC-CS592)

Semester: 5th
Branch: B.Tech (CSE Sec A & B)
Academic Session: July - December, 2024
Institution: RCCIIT


Table of Contents


1. Shell Script: Reverse a Number

  • 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).

2. Shell Script: Factorial Calculation

  • 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).

3. Shell Script: Prime Number Check

  • 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).

4. Shell Script: Odd or Even Check

  • 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).

5. Shell Script: Leap Year Check

  • 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 with ls.

6. C Program: Parent-Child Communication

  • 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.

7. C Program: Thread Creation and IDs

  • 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.

8. C Program: Thread Character Count

  • 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.

9. C Program: Producer-Consumer Problem

  • Write a C program to implement the Producer-Consumer problem using semaphores.

10. C Program: Reader-Writer Problem

  • Write a C program to implement the Reader-Writer problem using semaphores.

11. Threaded Operations and Shell Script

  • 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.

12. C Program: Banker's Algorithm

  • Write a C program to implement the Banker's Algorithm for deadlock avoidance.

Contributions

Feel free to contribute improvements or solutions to the assignments.