Professional Documents
Culture Documents
CLOUD COMPUTING
Assignment#2
BSSEF17E07
Assignment#1
University of Sargodha
Table of Contents
Q1. Difference between Simulation, Emulation & Virtualization ........................................................................................ 3
Simulation:.......................................................................................................................................................................... 3
Emulation: .......................................................................................................................................................................... 3
Virtualization: ..................................................................................................................................................................... 3
Differences .......................................................................................................................................................................... 3
Q2. Where to prefer using ..................................................................................................................................................... 4
Simulation:.......................................................................................................................................................................... 4
Emulation: .......................................................................................................................................................................... 4
Virtualization: ..................................................................................................................................................................... 4
Q3. Instructions Set Architecture .......................................................................................................................................... 5
What is ISA? ........................................................................................................................................................................ 5
Why is it used? ................................................................................................................................................................... 5
Types of ISA: ....................................................................................................................................................................... 5
Reduced Instruction Set Computer:............................................................................................................................... 5
Complex Instruction Set Computer: .............................................................................................................................. 6
Minimal Instruction Set Computer: ............................................................................................................................... 6
Very Long Instruction Word: .......................................................................................................................................... 6
Explicitly Parallel Instruction Computing (EPIC): ........................................................................................................... 6
One-instruction Set computer (OISC): ........................................................................................................................... 6
Zero-instruction Set computer (ZISC): ........................................................................................................................... 6
Q4. Types of Instructions in OS .............................................................................................................................................. 7
Privileged Instructions: ...................................................................................................................................................... 7
Non-Privileged Instructions: .............................................................................................................................................. 7
Differences .......................................................................................................................................................................... 8
Q5. Types of Interrupts .......................................................................................................................................................... 8
Hardware Interrupts: ......................................................................................................................................................... 9
Spurious Interrupts: ........................................................................................................................................................... 9
Software Interrupts: ........................................................................................................................................................... 9
Periodic Interrupts: ............................................................................................................................................................ 9
Aperiodic Interrupts: .......................................................................................................................................................... 9
Synchronous Interrupts:..................................................................................................................................................... 9
Asynchronous Interrupts: .................................................................................................................................................. 9
How Interrupts are handled by OS? ................................................................................................................................ 10
1
Q6. Kernel Mode & User Mode ........................................................................................................................................... 10
Kernel Mode: .................................................................................................................................................................... 10
User Mode: ....................................................................................................................................................................... 10
References ............................................................................................................................................................................ 11
2
Q1. Difference between Simulation,
Emulation & Virtualization
Simulation:
Simulation is the imitation of the operation of a real-world process or system over
time. It replicates a real device. Simulation mimics behavior of a real device, but doesn't
necessarily match it exactly.
Emulation:
An emulator is hardware or software that enables one computer system to
behave like another computer system. It duplicates a real device. In a virtual
environment, emulation imitates behavior closely.
Virtualization:
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. It is segmentation of
hardware among multiple users having different demands.
Differences
Emulation:
Emulators are most useful when you need to test how software interacts with
underlying hardware, or a combination of hardware and software. Emulation is
preferred when you need replication of the system but it operates on a virtual
environment.
Virtualization:
Virtualization is preferred when you want to run more workloads on a single
server, which reduces the number of physical machines (which has the highest cost in
data center) in your environment so cost reduced. One computing machine is having
multiple resources. Scattered resources combined in a single VM. So, virtualization is
ideal where you have less budget.
4
Q3. Instructions Set Architecture
What is ISA?
An instruction set architecture (ISA) is an abstract model of a computer. It is also
referred to as architecture or computer architecture. A realization of an ISA, such as a
central processing unit (CPU), is called an implementation. ISA is the part of the
processor that is visible to the programmer or compiler writer. The ISA serves as the
boundary between software and hardware
Why is it used?
The ISA serves as the boundary between software and hardware. The instruction
set, also called ISA (instruction set architecture), is part of a computer that pertains to
programming, which is more or less machine language. The instruction set provides
commands to the processor, to tell it what it needs to do as it is code that computer
processor can understand.
Types of ISA:
Following are the instruction set architectures:
5
of November 2018, is the world's fastest supercomputer as ranked by the TOP500
project.
• Privileged Instructions
• Non-Privileged Instructions
Privileged Instructions:
The Instructions that can run only in Kernel Mode are called Privileged
Instructions. Various examples of Privileged Instructions include:
Non-Privileged Instructions:
The Instructions that can run only in User Mode i.e. by users or applications are
called Non-Privileged Instructions. Various examples of Non-Privileged Instructions
include:
7
• Reading the status of Processor
• Reading the System Time
• Generate any Trap Instruction
• Sending the final printout of Printer
Differences
An interrupt is a signal sent to the processor that interrupts the current process. It
is a response by the processor to a process/event that needs immediate attention from
the software. Interrupts alert the processor and servers as a request for the CPU to
interrupt the currently executing program/code when permitted, in order so that the
event can be processed within good time. It may be generated by a hardware device or
a software program.
• Hardware Interrupts
• Spurious Interrupts
• Software Interrupts
• Periodic Interrupt
• Aperiodic Interrupt
• Synchronous Interrupt
• Asynchronous Interrupt:
8
Hardware Interrupts:
An electronic signal sent from an external device or hardware to communicate
with the processor indicating that it requires immediate attention. It is further divided
into two types:
Spurious Interrupts:
These types of interrupt are categorized to be invalid, short-duration signal on an
interrupt input. These types of interrupts are caused by glitches that are a result of
electrical interference, race conditions, or malfunctioning devices.
Software Interrupts:
Software interrupts refer to an interrupt which is requested by the processor to
execute particular instructions or when certain conditions are met. These interrupts can
be intentionally produced by executing a special instruction which, by design, invokes an
interrupt when compiled.
Periodic Interrupts:
Interrupts that occur at a fixed interval in timeline.
Aperiodic Interrupts:
Interrupts that cannot be predicted.
Synchronous Interrupts:
Interrupts that are dependent and in phase to the system clock.
Asynchronous Interrupts:
Interrupts that are independent to the system clock and are not in phase to it.
9
How Interrupts are handled by OS?
Operating systems have a vector table. It is normally located in the first 1024
bytes of memory at addresses 000000H–0003FFH. It contains 256 different interrupt
vectors. A vector table consists of a set of assemblers (or machine) instructions, which
cause the controller or computer to jump to a specific location that can handle a specific
exception or interrupt. A vector uses a special assembler instruction to load the address
of the handler. This vector table has some routines that are called interrupt handler. The
interrupt handler prioritizes the interrupts and saves them in a queue if more than one
is waiting to be handled. Each entry of the interrupt vector table, called an interrupt
vector, is the address of an interrupt handler.
Kernel Mode:
In kernel mode, the execution code can access the underlying hardware
completely unrestricted. It can execute any CPU instruction and reference any memory
address. Kernel mode is usually reserved for the lowest level and most trusted functions
of the operating system.
User Mode:
In User mode, the executing code has no ability to directly access hardware or
reference memory. Code running in user mode must delegate to system APIs to access
hardware or memory. Due to the protection afforded by this sort of isolation, crashes in
user mode are always recoverable. Most of the code running on your computer will
execute in user mode.
10
In the above diagram, Ring 0 represents the Kernel (Most privileged) and Ring 3
represents the User Mode (Least Privileged). These two rings are typically used. The
processor switches between the two modes depending on what type of code is running
on the processor. Applications run in user mode, and core operating system
components run in kernel mode.
References
1. https://www.geeksforgeeks.org/privileged-and-non-privileged-instructions-in-
operating-system/
2. https://en.wikipedia.org/wiki/Instruction_set_architecture
3. https://teachcomputerscience.com/interrupts/
4. https://whatis.techtarget.com/definition/interrupt#:~:text=An%20operating%20s
ystem%20usually%20has,is%20waiting%20to%20be%20handled.&text=In%20a%2
0personal%20computer%2C%20a,it%20with%20a%20particular%20device.
5. https://blog.codinghorror.com/understanding-user-and-kernel-
mode/#:~:text=In%20Kernel%20mode%2C%20the%20executing,functions%20of%
20the%20operating%20system.
11