CS 703 Advance Operating System Viva Solved Questions

Deadline Scheduling
• Information used
üReady time
üStarting deadline
üCompletion deadline
üProcessing time
üResource requirements
üPriority
üSubtask scheduler

Mark and Sweep Collecting
Mark and Sweep
• Mark using depth-first traversal of the memory graph
• Sweep using lengths to find next block

What is an operating system?
• Top-down view
• Bottom-up view
• Time multiplexing
• Space multiplexing

Type of Operating Systems
• Main frame operating systems
• Time-sharing systems
• Multiprocessor operating systems
• PC operating systems
• Real-time operating systems
• Embedded operating system

OS Structure
• Monolithic Design
• Layering
• Micro-kernel

ELF Object File Format
• Elf header
• Program header table
• .text section
• .data section
• .bss section

Asynchronous Exceptions (Interrupts)
• Caused by events external to the processor

Synchronous Exceptions
• Traps
• Faults
• Aborts

Process Creation
• Assign a unique process identifier
• Allocate space for the process
• Initialize process control block

Unix SVR4 Processes

Process Control Block
• Process state: e.g., running, ready, waiting, halted
• Priority
• Scheduling-related information
• Event

fork: Creating new processes
• int fork(void)

exit: Destroying Process
• void exit(int status)


Two uses of semaphores
• Mutual exclusion
• Scheduling constraints

Condition variables
• Condition variable: a queue of threads waiting for something inside a critical section.
• Wait() -- release lock, go to sleep, re-acquire lock
• Signal() -- wake up a waiter, if any
• Broadcast() -- wake up all waiters

Conditions for deadlock
• Without all of these, can't have deadlock:
1. Mutual exclusion
2. No preemption
3. Hold and wait
4. Circular wait

Features of Real-Time Operating Systems
• Fast process or thread switch
• Small size
• Ability to respond to external interrupts quickly
• Multitasking with inter-process communication tools such as semaphores, signals, and
events
• Use of special sequential files that can accumulate data at a fast rate
• Preemptive scheduling base on priority
• Minimization of intervals during which interrupts are disabled
• Delay tasks for fixed amount of time
• Special alarms and timeouts

Advantages and disadvantages of monolithic design

Major Advantages:
1.      Cost of module interaction is low  

Disadvantages
1.      Hard to understand
2.      Hard to modify
3.      Unreliable
4.      Hard to maintain

User-level threads
User-level threads are faster to create and manage.
Implementation is by a thread library at the user level.
User-level thread is generic and can run on any operating system.
Multi-threaded applications cannot take advantage of multiprocessing.

Kernel-level threads
Kernel-level threads are slower to create and manage.
Operating system supports creation of Kernel threads.
Kernel-level thread is specific to the operating system.
Kernel routines themselves can be multi-threaded.

Shortest Job First (SJF) scheduling algorithm:
 It is a non preemptive scheduling algorithm which is used for batch systems. This algorithm works only when all the jobs are available at a particular time. In this algorithm the shortest job is picked form the queue and is run first. After that the next shortest job is picked and so on.

Shortest Job First (SJF) scheduling algorithm:
 It is a non preemptive scheduling algorithm which is used for batch systems. This algorithm works only when all the jobs are available at a particular time. In this algorithm the shortest job is picked form the queue and is run first. After that the next shortest job is picked and so on.

Shortest Remaining Time Next (SRTN) scheduling algorithm:
 It is a preemptive form of Shortest Job First (SJF) scheduling algorithm. In this algorithm a job is chosen whose remaining run time is the shortest. For a new job, its run time is compared with remaining time of current job. If new job needs less time to complete than the current job, then, the current job is blocked and the new job is run. It is used for batch systems and provides advantages to new jobs.

Static library
A static library is a programming concept in which shared libraries with special functionalities, classes or resources are linked to external applications or components, facilitating the creation of stand-alone and executable files.

Comments