[go: up one dir, main page]

0% found this document useful (0 votes)
11 views2 pages

23CSE214 - OS Mid Lab Evalution (27.02.27) - v1

The document outlines the mid-lab evaluation for the Operating Systems course, specifying tasks for students to complete in C language within a UNIX/Linux environment. It includes various questions on system calls, inter-process communication, CPU scheduling algorithms, and thread programming, each with specific requirements for program structure and output. Students are required to demonstrate their understanding of these concepts through practical coding assignments that involve process creation, execution, synchronization, and communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

23CSE214 - OS Mid Lab Evalution (27.02.27) - v1

The document outlines the mid-lab evaluation for the Operating Systems course, specifying tasks for students to complete in C language within a UNIX/Linux environment. It includes various questions on system calls, inter-process communication, CPU scheduling algorithms, and thread programming, each with specific requirements for program structure and output. Students are required to demonstrate their understanding of these concepts through practical coding assignments that involve process creation, execution, synchronization, and communication.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

23CSE214 – Operating Systems - Mid Lab Evaluation

Instructions:

1. Each student will be assigned one 7-mark question and one 8-mark question,
totalling 15 marks for the mid-term exam.
2. Students must include the Aim, Algorithm, Code, Output, and Result for each
program.
3. All programs must be written in C language and executed in a UNIX/Linux
environment.

Questions:

System Calls:

1.1 Process Creation and Forking (7 Marks)

o Write a C program in UNIX that creates a child process using the fork()
system call.
o The parent process should print its Process ID (PID), and the child process
should print its own PID along with its parent’s PID.

1.2 Process Execution using exec() (7 Marks)

o Write a C program that demonstrates the exec() system call by replacing the
current process with the /bin/ls command to list files in the current directory.
o Ensure proper error handling if exec() fails.

1.3 Process Synchronization and Exit Handling (8 Marks)

o Write a C program where the parent process creates a child process using
fork().
o The parent should wait for the child to exit and then print the child’s exit
status using wait() and WEXITSTATUS().

Inter-Process Communication (IPC):

2.1 Shared Memory Communication (8 Marks)

o Write a C program to demonstrate Inter-Process Communication (IPC)


using Shared Memory.
o The parent process should write a message to shared memory, and the child
process should read and print it.
o Ensure proper cleanup of shared memory.

2.2 Message Queue Communication (8 Marks)

o Write a C program to demonstrate IPC using Message Queue.


o The parent process should send a message to the child process using a
message queue, and the child should receive and print it.
o Ensure proper cleanup of the message queue.

CPU Scheduling Algorithms:

3.1 First Come First Serve (FCFS) Scheduling (7 Marks)

o Write a C program to implement the First Come First Serve (FCFS)


Scheduling Algorithm. The program should take number of processes,
arrival time, and burst time as input and display the completion time,
turnaround time, and waiting time for each process.

3.2 Shortest Job First (SJF) Scheduling (8 Marks)

o Write a C program to implement the Shortest Job First (SJF) Scheduling


Algorithm (Non-Preemptive).The program should take number of
processes, their burst time, and arrival time as input and display the
completion time, turnaround time, and waiting time for each process.

3.3 Round Robin Scheduling (8 Marks)

o Write a C program to implement the Round Robin Scheduling Algorithm.

The program should take number of processes, their burst time, and a time
quantum as input. It should display the completion time, turnaround time,
and waiting time for each process using time-sharing.

Thread Programming:

4.1 Basic Thread Execution (7 Marks)

o Write a C program to create a thread that prints "Thread Execution


Successful!. Ensure that the main function waits for the thread to complete
before terminating.

4.2 Thread Addition (7 Marks)

 Write a C program that creates a thread to add two numbers and print the result.
The main function should pass two numbers to the thread, which will perform
the addition and display the sum.

You might also like