CIE01 2024 Scheme
CIE01 2024 Scheme
Sl.n Part-A
Marks
o
1a. Explanation(1.5) & diagram(1M) for each 2.5*4=
• Simple structure – MS-DOS 10M
• More complex -- UNIX
• Layered – an abstrcation
• Microkernel -Mach
2 #include <sys/wait.h> 10
#include <time.h>
int main() {
for (int i = 0; i < 3; ++i) {
pid_t child_pid = fork();
if (child_pid == 0) {
printf("I AM A NEW CHILD\n");
sleep(10);
exit(0);
}
}
return 0;
}
3a 2*4=8
That is, if application is 75% parallel / 25% serial, moving from 1 to 2 cores
results in speedup of 1.6 times
As N approaches infinity, speedup approaches 1 / S
Serial portion of an application has disproportionate effect on performance
gained by adding additional cores
4b i) This is not a privileged instruction, as otherwise user programs can never 3
execute this.
ii) This must be a privileged instruction, as otherwise a user level program can
modify the value loaded in the timer, and hence tamper with the scheduling
policy of the operating system.
5a. i. The statement is FALSE. 5
In multiprogramming, a context switch from one program to another happens
only when the first program gets blocked due to an I/O operation. As such, the
primary objective is to maximize processor utilization; processor should not lie
idle, no unnecessary context
switches.
In time sharing system, there are a number of interactive users sitting on
terminals. Minimizing the user response time is the main objective here.
ii. The statement is TRUE.
When context switch happens with process, all registers, code area, data area,
stack area, open files, etc. must be saved and restored.
In threads, the code area, data area, open files, etc. are all shared among the
threads. Thus during context switch, only registers and stack area need to be
saved and restored. For this reason, thread scheduling is faster than process
scheduling.
iii. The statement is FALSE
It depends on the arrival time of process. If a shorter process arrives later than
the longer process then the average waiting time is not necessarily minimum.
5b. A system call or syscall is a machine level instruction that cause the mode to 5
switch from user to supervisor, and transfer control to a service routine (typically
inside the OS). An exception is an interrupt that is caused due to the execution
of an instruction. Examples include: trying to execute a privileged instruction in
user mode, divide by zero, memory access violation, etc. Interrupt hardware
interrupt in a hardware interrupt that is originating from within the processor. An
example in the timer interrupt in round‐robin scheduling.
COURSE OUTCOMES:
Course Outcomes: After completing the course, the students will be able to
CO1: Describe the fundamental computer concepts and syntax of C programming.
CO2: Apply logical skills to design and develop algorithms/flow charts to solve real-world
problems.
CO3: Analyze the logic of the program and output obtained using different sets of input.
CO4: Design and develop programs using appropriate data structures and functions in C
language.