Skip to content

saadhussain01306/os_lab_jssstu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Operating Systems Lab Programs implemented @JSSSTU

List of Programs:-

NOTE: For all the scheduling algorithms, write the expected output for the given data (table with set of processes, AT, BT) along with the Gantt chart. Execute the scheduling program for the same data. The output should be in the form of a table with all the necessary time parameters like AT, BT, CT, TT, and WT. Also, display the Gantt chart and average WT.

  1. a) Write a shell program to check whether a given number is palindrome or not b) Implement SJF Pre-emptive scheduling algorithm by defining the process structure.

  2. a) Write a shell program to generate prime numbers in a given range b) Implement Priority Pre-emptive scheduling algorithm by defining the process structure.

  3. a) Write a shell program to find the largest of n numbers, storing numbers in an array. b) Implement Round Robin scheduling algorithm by defining the process structure.

  4. a) Write a shell program to read two matrices, find addition and display the input matrices and resultant in matrix format b) Implement Priority Non-preemptive scheduling algorithm by defining the process structure.

  5. a) Write a program to perform the following task using I/O system calls for file I/O i. Reading the first 10 characters from the file ii. Skipping 5 characters from the current position in the file iii. Going to the 5th last character in the file iv. Going to the 3rd character in the file b) Implement FCFS scheduling algorithm by defining the process structure.

  6. a) Write a program to demonstrate zombie and orphan processes. b) Implement SJF Non-preemptive scheduling algorithm by defining the process structure.

  7. a) Write a program to simulate the grep command using system calls b) Write a program to generate and print Fibonacci series with the following requirements:

    • Parent program should create a child and distribute the task of generating Fibonacci no to its child.
    • The code for generating Fibonacci series should reside in a different program.
    • Child should write the generated Fibonacci series to shared memory.
    • Parent process has to print by retrieving the Fibonacci series from the shared memory. i) Implement the above using shmget and shmat Note: Shared object should be removed at the end in the program.
  8. a) Write a program to simulate the ls command using system calls. b) Write a program to generate and print Fibonacci series with the following requirements:

    • Parent program should create a child and distribute the task of generating Fibonacci no to its child.
    • The code for generating Fibonacci series should reside in a different program.
    • Child should write the generated Fibonacci series to shared memory.
    • Parent process has to print by retrieving the Fibonacci series from the shared memory. i) Implement the above using shm_open and mmap Note: Shared object should be removed at the end in the program.
  9. a) Write a shell program to check whether a given no. is a palindrome or not b) Write a program to generate and print N ODD numbers with the following requirements:

    • Parent program should create a child and distribute the task of generating odd numbers to its child.
    • The code for generating odd numbers should reside in a different program.
    • Child should write the generated odd numbers to shared memory.
    • Parent process has to print the odd numbers by retrieving from the shared memory. i) Implement the above using shmget and shmat Note: Shared object should be removed at the end in the program.
  10. a) Write a program to simulate the cat command using system calls. b) Write a program to generate and print Prime nos. between a given range (between M & N) with the following requirements:

    • M & N should be passed as command line arguments
    • Error checking should be done to verify the required no. of arguments at the command line
    • Parent program should create a child and distribute the task of generating Prime numbers to its child.
    • The code for generating Prime numbers should reside in a different program.
    • Child should write the generated Prime numbers to shared memory.
    • Parent process has to print the Prime numbers by retrieving from the shared memory. i) Implement the above using shm_open and mmap Note: Shared object should be removed at the end in the program.
  11. a) Write a program with two threads and a main thread. Schedule the task of calculating the natural sum up to ‘n’ terms and factorial of ‘n’ on these threads. Note: The main thread should read ‘n’ from the command line and pass it as a parameter to the remaining threads. Terminate the threads using system calls. b) Write a program that implements the solution to the Producer – Consumer problem using mutex and semaphores.

  12. a) Write a shell program to find the largest of three numbers b) Write a program that implements the solution to Readers-Writers problem using mutex and semaphores.

About

Operating systems Lab programs @SJCE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published