Model Ans

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

Theory Examination October 2023

MODEL ANSWER
Class: S.Y.B.Sc. I.T. Semester : III
Sub: Programming Principles with C
Q1. Attempt any three of the following: 15 Marks
a) Define Operating System. Explain its function.
Ans. The Operating System is a program with the following features −
 An operating system is a program that acts as an interface between the software and the computer hardware.
 It is an integrated set of specialized programs used to manage overall resources and operations of the
computer.
Functions of Operating System
Here is a list of some of the most prominent functions of Operating Systems –
1. Process management:- Process management helps OS to create and delete processes. It also provides
mechanisms for synchronization and communication among processes.
2. Memory management:- Memory management module performs the task of allocation and de-allocation of
memory space to programs in need of this resources.
3. File management:- It manages all the file-related activities such as organization storage, retrieval, naming,
sharing, and protection of files.
4. Device Management: Device management keeps tracks of all devices. This module also responsible for this
task is known as the I/O controller. It also performs the task of allocation and de-allocation of the devices.
5. I/O System Management: One of the main objects of any OS is to hide the peculiarities of that hardware
devices from the user.
6. Secondary-Storage Management: Systems have several levels of storage which includes primary storage,
secondary storage, and cache storage. Instructions and data must be stored in primary storage or cache so that a
running program can reference it.
7. Security:- Security module protects the data and information of a computer system against malware threat and
authorized access.
8. Command interpretation: This module is interpreting commands given by the and acting system resources to
process that commands.
9. Networking: A distributed system is a group of processors which do not share memory, hardware devices, or
a clock. The processors communicate with one another through the network.
10. Job accounting: Keeping track of time & resource used by various job and users.
11. Communication management: Coordination and assignment of compilers, interpreters, and another software
resource of the various users of the computer systems.

b) What is process? Explain Various states of process with diagram.


Ans. A process is a program in execution. Process is not as same as program code but a lot more than it. A process is
an 'active' entity as opposed to program which is considered to be a 'passive' entity. Attributes held by process include
hardware state, memory, CPU etc.
Process memory is divided into four sections for efficient working :
 The Text section is made up of the compiled program code, read in from non-volatile storage when the
program is launched.
 The Data section is made up the global and static variables, allocated and initialized prior to executing the
main.

1|Page
 The Heap is used for the dynamic memory allocation, and is managed via calls to new, delete, malloc, free,
etc.
 The Stack is used for local variables. Space on the stack is reserved for local variables when they are declared.
Different Process States
Processes in the operating system can be in any of the following states:
 NEW- The process is being created.
 READY- The process is waiting to be assigned to a processor.
 RUNNING- Instructions are being executed.
 WAITING- The process is waiting for some event to occur(such as an I/O completion or reception of a signal).
 TERMINATED- The process has finished execution.

c) Explain Process Control Block (PCB) with diagram.


Ans. A Process Control Block is a data structure maintained by the Operating System for every process. The PCB
is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of a process as
listed below in the table −
S.N. Information & Description
Process State
1
The current state of the process i.e., whether it is ready, running, waiting, or whatever.
Process privileges
2
This is required to allow/disallow access to system resources.
Process ID
3
Unique identification for each of the process in the operating system.
Pointer
4
A pointer to parent process.
Program Counter
5
Program Counter is a pointer to the address of the next instruction to be executed for this process.
CPU registers
6
Various CPU registers where process need to be stored for execution for running state.
CPU Scheduling Information
7
Process priority and other scheduling information which is required to schedule the process.
Memory management information
8 This includes the information of page table, memory limits, Segment table depending on memory used by
the operating system.
Accounting information
9
This includes the amount of CPU used for process execution, time limits, execution ID etc.
IO status information
10
This includes a list of I/O devices allocated to the process.

d) What are different process scheduling criteria. Explain in detail.


There are many different criterias to check when considering the "best" scheduling algorithm, they are:
2|Page
CPU Utilization
To make out the best use of CPU and not to waste any CPU cycle, CPU would be working most of the time(Ideally
100% of the time). Considering a real system, CPU usage should range from 40% (lightly loaded) to 90% (heavily
loaded.)
Throughput
It is the total number of processes completed per unit time or rather say total amount of work done in a unit of time.
This may range from 10/second to 1/hour depending on the specific processes.
Turnaround Time
It is the amount of time taken to execute a particular process, i.e. The interval from time of submission of the process
to the time of completion of the process(Wall clock time).
Waiting Time
The sum of the periods spent waiting in the ready queue amount of time a process has been waiting in the ready queue
to acquire get control on the CPU.
Load Average
It is the average number of processes residing in the ready queue waiting for their turn to get into the CPU.
Response Time
Amount of time it takes from when a request was submitted until the first response is produced. Remember, it is the
time till the first response and not the completion of process execution(final response).

e) Explain the First Come First Serve (FCFS) scheduling algorithm with example.
Ans . In the "First come first serve" scheduling algorithm, as the name suggests, the process which arrives first, gets
executed first, or we can say that the process which requests the CPU first, gets the CPU allocated first.
 First Come First Serve, is just like FIFO(First in First out) Queue data structure, where the data element which
is added to the queue first, is the one who leaves the queue first.
 This is used in Batch Systems.
 It's easy to understand and implement programmatically, using a Queue data structure, where a new process
enters through the tail of the queue, and the scheduler selects process from the head of the queue.
 A perfect real life example of FCFS scheduling is buying tickets at ticket counter.

Calculating Average Waiting Time


For every scheduling algorithm, Average waiting time is a crucial parameter to judge it's performance. Average
waiting time is the average of the waiting times of the processes in the queue, waiting for the scheduler to pick them
for execution.
Lower the Average Waiting Time, better the scheduling algorithm.
Consider the processes P1, P2, P3, P4 given in the below table, arrives for execution in the same order, with Arrival
Time 0, and given Burst Time, let's find the average waiting time using the FCFS scheduling algorithm.

3|Page
The average waiting time will be 18.75 ms
For the above given proccesses, first P1 will be provided with the CPU resources,
 Hence, waiting time for P1 will be 0
 P1 requires 21 ms for completion, hence waiting time for P2 will be 21 ms
 Similarly, waiting time for process P3 will be execution time of P1 + execution time for P2, which will be (21
+ 3) ms = 24 ms.
 For process P4 it will be the sum of execution times of P1, P2 and P3.

f) Explain Real Time Operating System.


Ans. The real-time operating system used for a real-time application means for those applications where data
processing should be done in the fixed and small quantum of time. It is different from general purpose computer where
time concept is not considered as much crucial as in Real-Time Operating System. RTOS is a time-sharing system
based on clock interrupts. Interrupt Service Routine (ISR) serve the interrupt, raised by the system. RTOS used Priority
to execute the process. When a high priority process enters in system low priority process preempted to serve higher
priority process. Real-time operating system synchronized the process. So that they can communicate with each other.
Resources can be used efficiently without wastage of time.
RTOS are controlling traffic signal; Nuclear reactors Control scientific experiments, medical imaging systems,
industrial system, fuel injection system, home appliance are some application of Real Time operating system
Real time Operating Systems are very fast and quick respondent systems. These systems are used in an
environment where a large number of events (generally external) must be accepted and processed in a short time. Real
time processing requires quick transaction and characterized by supplying immediate response. For example, a
measurement from a petroleum refinery indicating that temperature is getting too high and might demand for
immediate attention to avoid an explosion.
The primary functions of the real time operating system are to:
1. Manage the processor and other system resources to meet the requirements of an application.
2. Synchronize with and respond to the system events.
3. Move the data efficiently among processes and to perform coordination among these processes.
The Real Time systems are used in the environments where a large number of events (generally external to the
computer system) is required to be accepted and is to be processed in the form of quick response. Such systems have to
be the multitasking. So the primary function of the real time operating system is to manage certain system resources,
such as the CPU, memory, and time.
Q2. Attempt any three of the following: 15 Marks
a) What is purpose of swapping? Explain with example.

4|Page
Swapping is a mechanism in which a process can be swapped temporarily out of main memory (or move) to secondary
storage (disk) and make that memory available to other processes. At some later time, the system swaps back the
process from the secondary storage to main memory.
Though performance is usually affected by swapping process but it helps in running multiple and big processes in
parallel and that's the reason Swapping is also known as a technique for memory compaction.

The total time taken by swapping process includes the time it takes to move the entire process to a secondary disk and
then to copy the process back to memory, as well as the time the process takes to regain main memory.
Let us assume that the user process is of size 2048KB and on a standard hard disk where swapping will take place has
a data transfer rate around 1 MB per second. The actual transfer of the 1000K process to or from memory will take
2048KB / 1024KB per second
= 2 seconds
= 2000 milliseconds
Now considering in and out time, it will take complete 4000 milliseconds plus other overhead where the process
competes to regain main memory.
b) Explain the structure of disk drive with suitable diagram.
Ans. In modern computers, most of the secondary storage is in the form of magnetic disks. Hence, knowing the
structure of a magnetic disk is necessary to understand how the data in the disk is accessed by the computer.

Structure of a magnetic disk

A magnetic disk contains several platters. Each platter is divided into circular shaped tracks. The length of the tracks
near the centre is less than the length of the tracks farther from the centre. Each track is further divided into sectors, as
shown in the figure.
Tracks of the same distance from centre form a cylinder. A read-write head is used to read data from a sector of the
magnetic disk.
The speed of the disk is measured as two parts:
 Transfer rate: This is the rate at which the data moves from disk to the computer.
 Random access time: It is the sum of the seek time and rotational latency.

5|Page
Seek time is the time taken by the arm to move to the required track. Rotational latency is defined as the time taken
by the arm to reach the required sector in the track.
Even though the disk is arranged as sectors and tracks physically, the data is logically arranged and addressed as an
array of blocks of fixed size. The size of a block can be 512 or 1024 bytes. Each logical block is mapped with a sector
on the disk, sequentially. In this way, each sector in the disk will have a logical address.
c) What is a file? Explain different attributes of file.
What is a file? Explain different attributes of file.
Ans. A file can be defined as a data structure which stores the sequence of records. Files are stored in a file system,
which may exist on a disk or in the main memory. Files can be simple (plain text) or complex (specially-formatted).
A file's attributes vary from one operating system to another but typically consist of these:
 Name: Name is the symbolic file name and is the only information kept in human readable form.
 Identifier: This unique tag is a number that identifies the file within the file system; it is in non-human-
readable form of the file.
 Type: This information is needed for systems which support different types of files or its format.
 Location: This information is a pointer to a device which points to the location of the file on the device where
it is stored.
 Size: The current size of the file (which is in bytes, words, etc.) which possibly the maximum allowed size
gets included in this attribute.
 Protection: Access-control information establishes who can do the reading, writing, executing, etc.
 Date, Time & user identification: This information might be kept for the creation of the file, its last
modification and last used. These data might be useful for in the field of protection, security, and monitoring
its usage.

d) Explain different possible operations on file.


Ans. file is an abstract data type. For defining a file properly, we need to consider the operations that can be performed
on files. The operating system can provide system calls to create, write, read, reposition, delete, and truncate files.
There are six basic file operations within an Operating system. These are:
 Creating a file: There are two steps necessary for creating a file. First, space in the file system must be found
for the file. We discuss how to allocate space for the file. Second, an entry for the new file must be made in the
directory.
 Writing a file: To write to a file, you make a system call specify about both the name of the file along with the
information to be written to the file.
 Reading a file: To read from a file, you use a system call which specifies the name of the file and where
within memory the next block of the file should be placed.
 Repositioning inside a file: The directory is then searched for the suitable entry, and the 'current-file-position'
pointer is relocating to a given value. Relocating within a file need not require any actual I/O. This file
operation is also termed as 'file seek.'
 Deleting a file: For deleting a file, you have to search the directory for the specific file. Deleting that file or
directory release all file space so that other files can re-use that space.
 Truncating a file: The user may wish for erasing the contents of a file but keep the attributes same. Rather
than deleting the file and then recreate it, this utility allows all attributes to remain unchanged — except the
file length — and let the user add or edit the file content.

e) Write short note on single level directory structure.

6|Page
Single level directory is simplest directory structure. In it all files are contained in same directory which make it easy
to support and understand.

A single level directory has a significant limitation, however, when the number of files increases or when the system
has more than one user. Since all the files are in the same directory, they must have the unique name . if two users call
their dataset test, then the unique name rule violated.

Advantages:
 Since it is a single directory, so its implementation is very easy.
 If files are smaller in size, searching will faster.
 The operations like file creation, searching, deletion, updating are very easy in such a directory structure.
Disadvantages:
 There may chance of name collision because two files can not have the same name.
 Searching will become time taking if directory will large.
 In this can not group the same type of files together.

f) Explain linked list file allocation method with diagram.


Once we have seen a two-level directory as a tree of height 2, the natural generalization is to extend the directory
structure to a tree of arbitrary height.
This generalization allows the user to create there own subdirectories and to organize on their files accordingly.

A tree structure is the most common directory structure. The tree has a root directory, and every file in the system have
a unique path.
Advantages:
 Very generalize, since full path name can be given.
 Very scalable, the probability of name collision is less.
 Searching becomes very easy, we can use both absolute path as well as relative.
Disadvantages:
 Every file does not fit into the hierarchical model, files may be saved into multiple directories.
 We can not share files.
7|Page
 It is inefficient, because accessing a file may go under multiple directories.

Q3. Attempt any three of the following: 15 Marks


a) Write short note on device controller.
Device drivers are software modules that can be plugged into an OS to handle a particular device. Operating System
takes help from device drivers to handle all I/O devices.
The Device Controller works like an interface between a device and a device driver. I/O units (Keyboard,
mouse, printer, etc.) typically consist of a mechanical component and an electronic component where electronic
component is called the device controller.
There is always a device controller and a device driver for each device to communicate with the Operating
Systems. A device controller may be able to handle multiple devices. As an interface its main task is to convert serial
bit stream to block of bytes, perform error correction as necessary.
Any device connected to the computer is connected by a plug and socket, and the socket is connected to a
device controller. Following is a model for connecting the CPU, memory, controllers, and I/O devices where CPU and
device controllers all use a common bus for communication.

b) What is RAID? Explain any two levels of RAID.


RAID stands for “Redundant Arrays of Independent Disks”. RAID is a technique which makes use of a combination
of multiple disks instead of using a single disk for increased performance, data redundancy or both.
Data redundancy, although taking up extra space, adds to disk reliability. This means, in case of disk failure, if the
same data is also backed up onto another disk, we can retrieve the data and go on with the operation. On the other
hand, if the data is spread across just multiple disks without the RAID technique, the loss of a single disk can affect the
entire data.

RAID is available in different schemes, or RAID levels. The most commonly levels are RAID 0, 1, 5, 6, and 10.
Raid 0: Striping
Requiring a minimum of two disks, RAID 0 splits files and stripes the data across two disks or more, treating the
striped disks as a single partition. Because multiple hard drives are reading and writing parts of the same file at the
same time, throughput is generally faster.
RAID 0 does not provide redundancy or fault tolerance. Since it treats multiple disks as a single partition, if even one
drive fails, the striped file is unreadable. This is not an insurmountable problem in video streaming or computer
gaming environments where performance matters the most, and the source file will still exist even if the stream fails. It
is a problem in high availability environments.

RAID 1: Mirroring
RAID 1 requires a minimum of two disks to work, and provides data redundancy and failover. It reads and writes the
exact same data to each disk. Should a mirrored disk fail, the file exists in its entirety on the functioning disk. Once IT
replaces the failed desk, the RAID system will automatically mirror back to the replacement drive. RAID 1 also
increases read performance.
It does take up more usable capacity on drives, but is an economical failover process on application servers.

8|Page
c) What are differences between command line interface (CLI) and graphical user interface (GUI).

S.N. CLI GUI


1. CLI is difficult to use. Whereas it is easy to use.
2. It consumes low memory. While consumes more memory.
3. In CLI we can obtain high precision. While in it, low precision is obtained.
4. CLI is faster than GUI. The speed of GUI is slower than CLI.
While GUI operating system need both mouse and
5. CLI operating system needs only keyboard.
keyboard.
6. CLI’s appearance can not be modified or changed. While it’s appearance can be modified or changed.
While in GUI, input can be entered anywhere on the
7. In CLI, input is entered only at command prompt.
screen.
While in GUI, the information is shown or presented to
In CLI, the information is shown or presented to
8. the user in any form such as: plain text, videos, images,
the user in plain text and files.
etc.
9. In CLI, there are no menus provided. While in GUI, menus are provided.
10. There are no graphics in CLI. While in GUI, graphics are used.
While it uses pointing devices for selecting and
11. CLR do not use any pointing devices.
choosing items.
In CLI, spelling mistakes and typing errors are not Whereas in GUI, spelling mistakes and typing errors are
12.
avoided. avoided.

d) What is deadlock? What are the necessary condition for deadlock occurrence? Explain in detail.
Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for
another resource acquired by some other process.
Consider an example when two trains are coming toward each other on same track and there is only one track,
none of the trains can move once they are in front of each other. Similar situation occurs in operating systems when
there are two or more processes hold some resources and wait for resources held by other(s). For example, in the below
diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is
waiting for resource 1.

9|Page
Deadlock can arise if following four conditions hold simultaneously (Necessary Conditions)
1. Mutual exclusion: A resource can be assigned to at most one process at a time (no sharing).
2. Hold and wait: A processing holding a resource is permitted to request another.
3. No preemption: A process must release its resources; they cannot be taken away.
4. Circular wait: There must be a chain of processes such that each member of the chain is waiting for a
resource held by the next member of the chain.

e) Explain Banker’s Algorithm with example.


Banker’s algorithm is a deadlock avoidance algorithm. It is named so because this algorithm is used in banking
systems to determine whether a loan can be granted or not.
Consider there are n account holders in a bank and the sum of the money in all of their accounts is S. Every time a loan
has to be granted by the bank, it subtracts the loan amount from the total money the bank has. Then it checks if that
difference is greater than S. It is done because, only then, the bank would have enough money even if all the n account
holders draw all their money at once.
Banker’s algorithm works in a similar way in computers. Whenever a new process is created, it must exactly specify
the maximum instances of each resource type that it needs. The banker’s algorithm is a method used in deadlock
avoidance technique in multiple instances of a resource type.

For the Banker's algorithm to work, it needs to know three things:

1. How much of each resource each process could possibly request[MAX]


2. How much of each resource each process is currently holding[ALLOCATED]
3. How much of each resource the system currently has available[AVAILABLE]

f) What are difference between Starvation and Deadlock?


Sr. Deadlock Starvation
Starvation is a situation where the low priority
Deadlock is a situation where no process got blocked
1 process got blocked and the high priority processes
and no process proceeds
proceed.
2 Deadlock is an infinite waiting. Starvation is a long waiting but not infinite.
3 Every Deadlock is always a starvation. Every starvation need not be deadlock.
The requested resource is continuously be used by
4 The requested resource is blocked by the other process.
the higher priority processes.
Deadlock happens when Mutual exclusion, hold and
It occurs due to the uncontrolled priority and
5 wait, No preemption and circular wait occurs
resource management.
simultaneously.
Q4. Attempt any three of the following: 15 Marks
a) What is hypervisor? Explain type-1 and type-2 hypervisor.

10 | P a g e
Ans. Hypervisor is a form of virtualization software used in Cloud hosting to divide and allocate the resources on
various pieces of hardware. The program which provide partitioning, isolation or abstraction is called virtualization
hypervisor. Hypervisor is a hardware virtualization technique that allows multiple guest operating systems (OS) to run
on a single host system at the same time. A hypervisor is sometimes also called a virtual machine manager(VMM).
Types of Hypervisor –
TYPE-1 Hypervisor: Hypervisor runs directly on underlying host system. It is also known as “Native
Hypervisor” or “Bare metal hypervisor”. It dose not require any base server operating system. It has direct
access to hardware resources. Examples of Type 1 hypervisors include VMware ESXi, Citrix XenServer and
Microsoft Hyper-V hypervisor.

TYPE-2 Hypervisor: A Host operating system runs on underlying host system. It is also known as ‘Hosted
Hypervisor”. Basically a software installed on an operating system. Hypervisor asks operating system to make
hardware calls. Example of Type 2 hypervisor include VMware Player or Parallels Desktop. Hosted
hypervisors are often found on endpoints like PCs.

b) What is Virtualization? Explain advantages of Virtualization.


Virtualization occurs when a virtual version of something is created instead of an actual version. Virtualization is the
process of running a virtual instance of a computer system in a layer abstracted from the actual hardware. Most
commonly, it refers to running multiple operating systems on a computer system simultaneously. To the applications
running on top of the virtualized machine, it can appear as if they are on their own dedicated machine, where the
operating system, libraries, and other programs are unique to the guest virtualized system and unconnected to the host
operating system which sits below it.

The Advantages of Virtualization


1. It is cheaper. Because virtualization doesn’t require actual hardware components to be used or installed, IT
infrastructures find it to be a cheaper system to implement. There is no longer a need to dedicate large areas of space
and huge monetary investments to create an on-site resource. You just purchase the license or the access from a third-
party provider and begin to work, just as if the hardware were installed locally.
11 | P a g e
2. It keeps costs predictable. Because third-party providers typically provide virtualization options, individuals and
corporations can have predictable costs for their information technology needs. For example: the cost of a Dell
PowerEdge T330 Tower Server, at the time of writing, is $1,279 direct from the manufacturer. In comparison, services
provided by Bluehost Web Hosting can be a slow as $2.95 per month.
3. It reduces the workload. Most virtualization providers automatically update their hardware and software that will
be utilized. Instead of sending people to do these updates locally, they are installed by the third-party provider. This
allows local IT professionals to focus on other tasks and saves even more money for individuals or corporations.
4. It offers a better uptime. Thanks to virtualization technologies, uptime has improved dramatically. Some providers
offer an uptime that is 99.9999%. Even budget-friendly providers offer uptime at 99.99% today.
5. It allows for faster deployment of resources. Resource provisioning is fast and simple when virtualization is being
used. There is no longer a need to set up physical machines, create local networks, or install other information
technology components. As long as there is at least one point of access to the virtual environment, it can be spread to
the rest of the organization.
c) What is cloud computing? Explain different types of cloud computing.

Cloud Computing can be defined as delivering computing power( CPU, RAM, Network Speeds, Storage OS software)
a service over a network (usually on the internet) rather than physically having the computing resources at the
customer location.
Cloud computing is a general term for anything that involves delivering hosted services over the Internet.
These services are broadly divided into three categories: Infrastructure-as-a-Service (IaaS), Platform-as-a-Service
(PaaS) and Software-as-a-Service (SaaS).

Types of Clouds:
There are four different cloud models that you can subscribe according to business needs:

1. Private Cloud: Here, computing resources are deployed for one particular organization. This method is more
used for intra-business interactions. Where the computing resources can be governed, owned and operated by
the same organization.
2. Community Cloud: Here, computing resources are provided for a community and organizations.
3. Public Cloud: This type of cloud is used usually for B2C (Business to Consumer) type interactions. Here the
computing resource is owned, governed and operated by government, an academic or business organization.
4. Hybrid Cloud: This type of cloud can be used for both type of interactions - B2B (Business to Business) or
B2C ( Business to Consumer). This deployment method is called hybrid cloud as the computing resources are
bound together by different clouds.

d) Explain different types of cloud computing services.


The three major Cloud Computing Offerings are
SaaS (Software as a Service)
SaaS or software as a service is a software distribution model in which applications are hosted by a vendor or service
provider and made available to customers over a network (internet). SaaS is becoming an increasingly prevalent
delivery model as underlying technologies that supports Service Oriented Architecture (SOA) or Web Services.
Through internet this service is available to users anywhere in the world.
Traditionaly, software application needed to be purchased upfront &then installed it onto your computer. SaaS users on
the other hand, instead of purchasing the software subscribes to it, usually on monthly basisvia internet.
Anyone who needs an access to a particular piece of software can be subscribe as a user, whether it is one or two
people or every thousands of employees in a corporation. SaaS is compatible with all internet enabled devices.
Many important tasks like accounting, sales, invoicing and planning all can be performed using SaaS.
12 | P a g e
PaaS (Platform as a Service)
Platform as a service, is referred as PaaS, it provides a platform and environment to allow developers to build
applications and services. This service is hosted in the cloud and accessed by the users via internet.
To understand in a simple terms, let compare this with painting a picture, where you are provided with paint colors,
different paint brushes and paper by your school teacher and you just have to draw a beautiful picture using those
tools.
PaaS services are constantly updated & new features added. Software developers, web developers and business can
benefit from PaaS. It provides platform to support application development. It includes software support and
management services, storage, networking, deploying, testing, collaborating, hosting and maintaining applications.
IaaS (Infrastructure as a Service)
IaaS (Infrastructure As A Service) is one of the fundamental service model of cloud computing alongside
PaaS( Platform as a Service). It provides access to computing resources in a virtualized environment “the cloud” on
internet. It provides computing infrastructure like virtual server space, network connections, bandwidth, load
balancers and IP addresses. The pool of hardware resource is extracted from multiple servers and networks usually
distributed across numerous data centers. This provides redundancy and reliability to IaaS.
IaaS(Infrastructure as a service) is a complete package for computing. For small scale businesses who are looking
for cutting cost on IT infrastructure, IaaS is one of the solutions. Annually a lot of money is spent in maintenance and
buying new components like hard-drives, network connections, external storage device etc. which a business owner
could have saved for other expenses by using IaaS.

e) What is distributed system? Explain its advantages and disadvantages.


A distributed system contains multiple nodes that are physically separate but linked together using the network. All the
nodes in this system communicate with each other and handle processes in tandem. Each of these nodes contains a
small part of the distributed operating system software.
Advantages of Distributed Systems
Some advantages of Distributed Systems are as follows:
 All the nodes in the distributed system are connected to each other. So nodes can easily share data with other
nodes.
 More nodes can easily be added to the distributed system i.e. it can be scaled as required.
 Failure of one node does not lead to the failure of the entire distributed system. Other nodes can still
communicate with each other.
 Resources like printers can be shared with multiple nodes rather than being restricted to just one.
Disadvantages of Distributed Systems
Some disadvantages of Distributed Systems are as follows:
 It is difficult to provide adequate security in distributed systems because the nodes as well as the connections
need to be secured.
 Some messages and data can be lost in the network while moving from one node to another.
 The database connected to the distributed systems is quite complicated and difficult to handle as compared to a
single user system.
f) What is multiprocessor? What are applications of multiprocessor?
A Multiprocessor is a computer system with two or more central processing units (CPUs) share full access to a
common RAM. The main objective of using a multiprocessor is to boost the system’s execution speed, with other
objectives being fault tolerance and application matching.
There are two types of multiprocessors, one is called shared memory multiprocessor and another is distributed
memory multiprocessor. In shared memory multiprocessors, all the CPUs shares the common memory but in a
distributed memory multiprocessor, every CPU has its own private memory.
Applications of Multiprocessor –
1. As a uniprocessor, such as single instruction, single data stream (SISD).

13 | P a g e
2. As a multiprocessor, such as single instruction, multiple data stream (SIMD), which is usually used for vector
processing.
3. Multiple series of instructions in a single perspective, such as multiple instruction, single data stream (MISD),
which is used for describing hyper-threading or pipelined processors.
4. Inside a single system for executing multiple, individual series of instructions in multiple perspectives, such as
multiple instruction, multiple data stream (MIMD).

Q5. Attempt any three of the following:


a) Explain the booting of Linux operating system.
The following are the 6 high level stages of a typical Linux boot process.

Details vary from platform to platform, but in general the following steps represent the boot process. When the
computer starts, the BIOS performs Power- On-Self-Test (POST) and initial device discovery and initialization, since
the OS’ boot process may rely on access to disks, screens, keyboards, and so on. Next, the first sector of the boot disk,
the MBR (Master Boot Record), is read into a fixed memory location and executed. This sector contains a small (512-
byte) program that loads a standalone program called boot from the boot device, such as a
SATA or SCSI disk. The boot program first copies itself to a fixed high-memory address to free up low memory for
the operating system.
b) Explain Android architecture with diagram.

Android is built on top of the standard Linux kernel, with only a few significant extensions to the kernel itself that will
be discussed later. Once in user space, however, its implementation is quite different from a traditional Linux
distribution and uses many of the Linux features you already understand in very different ways.
As in a traditional Linux system, Android’s first user-space process is init, which is the root of all other processes. The
daemons Android’s init process starts are different, however, focused more on low-level details (managing file systems
and hardware access) rather than higher-level user facilities like scheduling cron jobs. Android also has an additional
layer of processes, those running Dalvik’s Java language environment, which are responsible for executing all parts of
the system implemented in Java.

14 | P a g e
c) Explain using suitable diagram NTFS master file table and its attribute.
Each NTFS volume (e.g., disk partition) contains files, directories, bitmaps, and other data structures. Each volume is
organized as a linear sequence of blocks (clusters in Microsoft’s terminology), with the block size being fixed for each
volume and ranging from 512 bytes to 64 KB, depending on the volume size. Most NTFS disks use 4-KB blocks as a
compromise between large blocks (for efficient transfers) and small blocks (for low internal fragmentation). Blocks are
referred to by their offset from the start of the volume using 64-bit numbers.
The principal data structure in each volume is the MFT (Master File Table), which is a linear sequence of fixed-size
1-KB records. Each MFT record describes one file or one directory. It contains the file’s attributes, such as its name
and timestamps, and the list of disk addresses where its blocks are located. If a file is extremely
large, it is sometimes necessary to use two or more MFT records to contain the list of all the blocks, in which case the
first MFT record, called the base record, points to the additional MFT records.

d) Explain the design goals of android operating system.

15 | P a g e
1. Provide a complete open-source platform for mobile devices. The open-source part of Android is a bottom-to-top
operating system stack, including a variety of applications, that can ship as a complete product.
2. Strongly support proprietary third-party applications with a robust and stable API. As previously discussed, it is
challenging to maintain a platform that is both truly open-source and also stable enough for proprietary third-party
applications. Android uses a mix of technical solutions (specifying a very well-defined SDK and division between
public APIs and internal implementation) and policy requirements (through the CDD) to address this.
3. Allow all third-party applications, including those from Google, to compete on a level playing field. The Android
open source code is designed to be neutral as much as possible to the higher-level system features built on top of it,
from access to cloud services (such as data sync or cloud-to-device messaging APIs), to libraries (such as Google’s
mapping library) and rich services like application stores.
4. Provide an application security model in which users do not have to deeply trust third-party applications. The
operating system must protect the user from misbehavior of applications, not only buggy applications
that can cause it to crash, but more subtle misuse of the device and the user’s data on it. The less users need to trust
applications, the more freedom they have to try out and install them.
5. Support typical mobile user interaction: spending short amounts of time in many apps. The mobile experience tends
to involve brief interactions with applications: glancing at new received email, receiving and sending an SMS message
or IM, going to contacts to place a call, etc. The system needs to optimize for these cases with fast app launch and
switch times; the goal for Android has generally been 200msec to cold start a basic application up to the point of
showing a full interactive UI.
e) Explain user mode scheduling (UMS) in windows7.
However, in Windows 7 Microsoft added a facility called UMS (User-Mode Scheduling), which exposes the
distinction. UMS is similar to facilities used in other operating systems, such as scheduler activations. It can be used
to switch between user threads without first having to enter the kernel, providing the benefits of fibers, but with much
better integration into Win32—since it uses real Win32 threads.
The implementation of UMS has three key elements:
1. User-mode switching: a user-mode scheduler can be written to switch between user threads without entering the
kernel. When a user thread does enter kernel mode, UMS will find the corresponding kernel thread and
immediately switch to it.
2. Reentering the user-mode scheduler: when the execution of a kernel thread blocks to await the availability of a
resource, UMS switches to a special user thread and executes the user-mode scheduler so that a different user
thread can be scheduled to run on the current processor. This allows the current process to continue using the
current processor for its full turn rather than having to get in line behind other processes when one of its threads
blocks.
3. System-call completion: after a blocked kernel thread eventually is finished, a notification containing the results
of the system calls is queued for the user-mode scheduler so that it can switch to the corresponding user thread
next time it makes a scheduling decision.

f) Explain using suitable diagram the kernel structure of Linux operating system.

16 | P a g e
The kernel sits directly on the hardware and enables interactions with I/O devices and the memory management unit
and controls CPU access to them. At the lowest level, as shown in Fig. it contains interrupt handlers, which are the
primary way for interacting with devices, and the low-level dispatching mechanism. This dispatching occurs when an
interrupt happens. The low-level code here stops the running process, saves its state in the kernel process structures,
and starts the appropriate driver. Process dispatching also happens when the kernel completes some operations and it is
time to start up a user process again. The dispatching code is in assembler and is quite distinct from scheduling. Next,
we divide the various kernel subsystems into three main components.

The I/O component in Fig. 10-3 contains all kernel pieces responsible for interacting with devices and performing
network and storage I/O operations. At the highest level, the I/O operations are all integrated under a VFS (Virtual
File System) layer. That is, at the top level, performing a read operation on a file.

17 | P a g e

You might also like