OSY QUESTION BANK FOR PT1
Q1) Difference between multiprogramming and multitasking.
Q2) Explain time-sharing operating system and state its advantages and disadvantages
with diagram.
Time sharing is a technique which enables many people, located at various terminals
to use a particular computer system at the same time
A time-shared operating system allows multiple users to share a computer by giving
each user a small amount of CPU time, called a time slice or quantum, to run their
programs.
This time slice is usually between 10 and 100 milliseconds. While one user is using
the CPU, others wait their turn. The system uses memory management to keep track
of multiple programs in memory and ensures security between users.
If there's not enough memory, the system can temporarily move some programs to
disk and bring them back when needed, using a technique called virtual memory.
Advantages of Time-Sharing OS
1. Each task gets an equal opportunity.
2. Fewer chances of duplication of software.
3. CPU idle time can be reduced.
Disadvantages of Time-Sharing OS
1. Reliability problem.
2. One must have to take of the security and integrity of user programs and data.
3. Data communication problem.
Q3) Define real-time operating system. state its type and applications.
A real-time operating system (RTOS) is a special kind of operating system designed to handle
tasks that need to be completed quickly and on time. Unlike general-purpose operating
systems (GPOS), which are good at multitasking and user interaction, RTOS focuses on
doing things in real time.
The idea of real-time computing has been around for many years. The first RTOS was created
by Cambridge University in the 1960s. This early system allowed multiple processes to run at
the same time, each within strict time limits.
Over the years, RTOS has improved with new technology and the need for reliable real-time
performance. These systems are now more powerful, efficient, and full of features, and they
are used in many industries, including aerospace, defense, medical science, multimedia, and
more.
Types of Real-Time Operating System
Hard Real-Time Operating System** makes sure important tasks are done exactly on time.
For example, if a robot is welding a car, it must weld at the right moment or the car could be
damaged. Timing is super strict here.
Soft Real-Time Operating System** is more relaxed with timing. It tries to do tasks on time
but small delays are okay. For example, in a music player, a tiny delay in sound won’t be a
big problem.
Application
Traffic signal control
Banking operations
Military application
Flight control
Q4) What is system call. Explain system call related to device management.
Q5) Difference between Linux and Unix.
Features Linux Unix
Basic Linux is an open-source operating Unix is a powerful and multitasking
Definition system. This OS is supported on operating system that behaves like a bridge
several computer platforms and between the user and the computer.
includes multiple software features
that handle computer resources, and
allow you to do tasks.
Available It is available in multiple languages. It is available in English.
in
Kernel It is monolithic. It can be microkernel, monolithic, and
Type hybrid.
Written in C and other programming C and assembly language.
languages.
File It supports more file systems than It also supports less than Linux.
system Unix.
support
Examples Some examples of Linux are: Some examples of unix are IBM AIX,
Fedora, Debian, Red Hat, Ubuntu, Darwin, Solaris, HP-UX, macOS X, etc.
Android, etc.
Security Linux provides higher security. Unix is also highly secured.
Price Linux is free and its corporate Unix is not totally free. There are some
support is available at a price. Unix versions that are free, other than that
UNIX is expensive.
Q6) List any 4 services provided by operating system and explain any 2.
1. Program Execution The purpose of computer system is to allow the users to execute
programs in an efficient manner. The operating system provides an environment where the
user can conveniently run these programs. The user does not have to worry about the memory
allocation or de-allocation or any other thing because these things are taken care of by the
operating system. To run a program, the program is required to be loaded into the RAM first
and then to assign CPU time for its execution. Operating system performs this function for
the convenience of the user. It also performs other important tasks like allocation and de-
allocation of memory, CPU scheduling etc.
2. I/O Operations Each program requires an input and after processing the input submitted by
user it produces output. This involves the use of I/O devices. An I/O system in a computer
manages communication between the computer and devices like printers or scanners. To do
this, the computer uses **device drivers**, which are special programs. These drivers help
the computer understand how to talk to the device and send data in a way the device can
understand. This allows the computer to control devices without needing to know how the
hardware works. The drivers also handle signals from the device when it needs the
computer's attention.
3. Accounting This service of the operating system keeps track of which users are using how
much and what kinds of computer have been used for accounting or simply to accumulate
usage statistics.
Q7) Draw the diagram of monolithic structure and explain.
In a monolithic architecture, the operating system kernel is designed to provide all operating
system services, including memory management, process scheduling, device drivers, and file
systems, in a single, large binary. This means that all code runs in kernel space, with no
separation between kernel and user-level processes.
The main advantage of a monolithic architecture is that it can provide high performance,
since system calls can be made directly to the kernel without the overhead of message
passing between user-level processes. Additionally, the design is simpler, since all operating
system services are provided by a single binary.
However, there are also some disadvantages to a monolithic architecture. One major
disadvantage is that it can lead to a less secure and less stable operating system. Since all
code runs in kernel space, any vulnerabilities or bugs in the kernel can potentially affect the
entire system. Additionally, if a user-level process crashes, it can bring down the entire
system, since there is no separation between kernel and user-level processes.
Q8) Enlist components of operating system and explain any 2.
• process management
• memory management
• secondary storage management
• I/O management
• File management
• Protection
• Network management
• Command interpretation
1. File Management A file is a collected of related information defined by its creator.
Computer can store files on the disk (secondary storage), which provide long term
storage. Some examples of storage media are magnetic tape, magnetic disk and
optical disk. Each of these media has its own properties like speed, capacity, data
transfer rate and access methods. A file systems normally organized into directories to
ease their use. These directories may contain files and other directions. The five main
major activities of an operating system in regard to file management are
1. The creation and deletion of files.
2. The creation and deletion of directions.
3. The support of primitives for manipulating files and directions.
4. The mapping of files onto secondary storage.
5. The back up of files on stable storage media.
2. Secondary storage is used to store data and programs that can't fit in the computer's
main memory. This storage is important because the main memory is limited in size
and loses all its data when the computer is turned off. Secondary storage, like hard
drives or USB drives, holds data even when the power is off. Programs and files, such
as word processors or compilers, are kept on these storage devices until they are
needed and loaded into the computer's memory for use.
Q9) Write characteristics of Windows XP and Windows 7.
Q10)Difference between Real-time and Time-sharing operating system.
S.N
O Time Sharing Operating System Real-Time Operating System
In time sharing operating system, While in real time operating system,
1. quick response is emphasized for a computation tasks are emphasized before
request. its nominative point.
In this operating While in this operating
2. system Switching method/function is system Switching method/function is not
available. available.
In this operating system any
While in this modification does not take
3. modification in the program can be
place.
possible.
In this OS, computer resources are But in this OS, computer resources are
4.
shared to the external. not shared to the external.
It deals with more than processes or Whereas it deals with only one process
5.
applications simultaneously. or application at a time.
While in real time OS, the response is
In this OS, the response is provided to
6. provided to the user within time
the user within a second.
constraint.
Q11) List any 4 functions of operating system.
I/O management
Networking
Data security
File management
Communication management
Q12) Difference between Internal and External segmentation.
Internal fragmentation External fragmentation
In internal fragmentation fixed-sized In external fragmentation, variable-sized
memory, blocks square measure memory blocks square measure appointed to
appointed to process. the method.
Internal fragmentation happens when
External fragmentation happens when the
the method or process is smaller than
method or process is removed.
the memory.
The solution of internal fragmentation The solution to external fragmentation is
is the best-fit block. compaction and paging.
Internal fragmentation occurs when External fragmentation occurs when memory is
memory is divided into fixed-sized divided into variable size partitions based on
partitions. the size of processes.
Internal fragmentation occurs with External fragmentation occurs with
paging and fixed partitioning. segmentation and dynamic partitioning.
It occurs in worst fit memory It occurs in best fit and first fit memory
allocation method. allocation method.
Q13) Compare paging and segmentation memory management techniques.
Paging Segmentation
In paging, the program is divided into fixed or In segmentation, the program is divided into
mounted size pages. variable size segments.
Paging Segmentation
For the paging operating system is
For segmentation compiler is accountable.
accountable.
Page size is determined by hardware. Here, the segment size is given by the user.
It is faster in comparison to segmentation. Segmentation is slow.
Segmentation could result in external
Paging could result in internal fragmentation.
fragmentation.
Paging is invisible to the user. Segmentation is visible to the user.
In paging, a programmer cannot efficiently
It can efficiently handle data structures.
handle data structure.
This protection is hard to apply. Easy to apply for protection in segmentation.
Paging results in a less efficient system. Segmentation results in a more efficient system.
Q14) Compare CLI and GUI based operating system.
Q15) Find out total number of page fault using-
i)Least Recently Used page replacement.
ii) optimal page replacement.
Page replacement algorithms of memory management,if the page are coming in the
order
7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1.
Q16) explain free space management technique-
A file system is responsible to allocate the free blocks to the file therefore it has to keep track
of all the free blocks present in the disk .There are mainly four approaches by using which,
the free blocks in the disk are managed. 1. Bit Vector 2. Linked List
1. Bitmap or Bit vector
A Bitmap or Bit Vector is series or collection of bits where each bit corresponds to a disk
block. The bit can take two values: 0 and 1: 0 indicates that the block is free and 1 indicates
an allocated block. The given instance of disk blocks on the disk in Figure 1 (where green
blocks are allocated) can be represented by a bitmap of 16 bits as: 1111000111111001
Advantages:
Simple to understand.
Finding the first free block is efficient. It requires scanning the words (a group of 8
bits) in a bitmap for a non-zero word. (A 0-valued word has all bits 0). The first free
block is then found by scanning for the first 1 bit in the non-zero word.
Disadvantages:
For finding a free block, Operating System needs to iterate all the blocks which is
time consuming.
The efficiency of this method reduces as the disk size increases.
e allocated) can be represented by a bitmap of 16 bits as: 1111000111111001.
2. Linked List
In this approach, the free disk blocks are linked together i.e. a free block contains a pointer to
the next free block. The block number of the very first disk block is stored at a separate
location on disk and is also cached in memory.
In Figure-2, the free space list head points to Block 5 which points to Block 6, the next free
block and so on. The last free block would contain a null pointer indicating the end of free
list. A drawback of this method is the I/O required for free space list traversal.
Advantages:
The total available space is used efficiently using this method.
Dynamic allocation in Linked List is easy, thus can add the space as per the
requirement dynamically.
Disadvantages:
When the size of Linked List increases, the headache of miniating pointers is also
increases.
This method is not efficient during iteration of each block of memory.
Q17) Define virtual memory and demand paging.
Virtual memory is the separation of user logical memory from physical memory. This
separation allows an extremely large virtual memory to be provided for programmers when
only a smaller physical memory is available. Virtual memory makes the task of programming
much easier, because the programmer no longer needs to worry about the amount of physical
memory available, or about what code can be placed in overlays, but can concentrate instead
on the problem to be programmed .The size of virtual storage is limited by the addressing
scheme of the computer system and the amount of secondary memory available not by the
actual number of main storage locations.
Types of Virtual Memory
Paging
Segmentation
Demand paging
Every process in the virtual memory contains lots of pages and in
some cases, it might not be efficient to swap all the pages for the
process at once. Because it might be possible that the program
may need only a certain page for the application to run. Let us take
an example here, suppose there is a 500 MB application and it may
need as little as 100MB pages to be swapped, so in this case, there
is no need to swap all pages at once.
The demand paging system is somehow similar to the paging
system with swapping where processes mainly reside in the main
memory(usually in the hard disk). Thus demand paging is the
process that solves the above problem only by swapping the pages
on Demand. This is also known as lazy swapper( It never swaps
the page into the memory unless it is needed).
Swapper that deals with the individual pages of a process are
referred to as Pager.
Demand Paging is a technique in which a page is usually brought
into the main memory only when it is needed or demanded by the
CPU. Initially, only those pages are loaded that are required by the
process immediately. Those pages that are never accessed are
thus never loaded into the physical memory.
Q18) Explain multiprocessor operating in detail with diagram.
Multi-Processing Operating System
Multi-Processing Operating System is a type of Operating System in which more than one CPU is used
for the execution of resources. It betters the throughput of the System. All the available processors
are connected to peripheral devices, computer buses, physical memory, and clocks. The main aim of
the multi-processing operating system is to increase the speed of execution of the system
Q19) Explain optimal page replacement technique.
Q20) Explain system call implementation and explain how parameter passing is done in
system call.
System calls provide an interface between a user program and Operating System .
The system calls expose the services offered by the operating system to user programs.
These are set of functions methods. Most system calls are written in assembly language
and are machine
dependent.
Numerous higher level languages such as ‘C’ also permit to make system calls directly.
The system call interface layer includes entrance point in kernel code. All system resources
are managed and
controlled by the kernel. Any request from user or application that occupies access to any
system resource must
be tackled by kernel code. The user process must not be given untie access to kernel code for
security cause.
Many opening into kernel code called system calls are provided to the user so that the user
processes can raise the
execution of kernel code.
System calls permit processes and users to Operating System resources.
There are three universal methods that are used to pass information between a running
program and
the Operating System .
One technique is to store parameters in registers.
Another is to store parameters in a table in memory and get ahead of the address of table.
The third way is to push parameters on the stack and let operating system to pop the
parameters off the
stack.
Passing parameter
Three general methods exist for passing parameters to the OS:
1. Parameters can be passed in registers.
2. When there are more parameters than registers, parameters can be stored in a block and the
block address can be passed as a parameter to a register
3. Parameters can also be pushed on or popped off the stack by the operating system