You are on page 1of 12

18 November

CLOUD COMPUTING
Assignment#2

Cloud Submitted by: Mishal Saba

BSSEF17E07

Computing Submitted to: Ma’am Humaira Ijaz

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

Let’s first discuss the definition of all the three terms:

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

Simulation Emulation Virtualization


Simulation is the imitation of An emulator is hardware or Virtualization is the process of
the operation of a real-world software that enables one running a virtual instance of a
process or system over time computer system to behave computer system in a layer
like another computer abstracted from the actual
system. hardware.
It replicates a real device It duplicates a real device It creates a virtual instance of a
real system
A simulator mimics the basic An emulator duplicates the In virtualization, you mimic the
behavior of a device. thing exactly as it exists in only parts of the hardware
real life. It just operates in a according to your requirements
virtual environment instead using the guest OS to run
of the real world.
3
correctly to have the same
architecture.
Used for Unit testing, Used for Unit testing, Used for flexibility and
automation testing. automation testing and scalability with notable cost
debugging. savings, increasing performance
and availability of resources
It is faster compared to Slower due to latency since it Virtualization is normally faster
emulators. involves binary translation. than emulation but the real
system has to have an
architecture identical to the
guest system.

Q2. Where to prefer using


Simulation:
Simulations are used to mimic the functionalities/ operations of a system before
actually running it in real environment. It is a cheaper, faster, and efficient way to test
and help people understand how the system would act in real life situations.

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:

• Reduced Instruction Set Computer (RISC)


• Complex Instruction Set Computer (CISC)
• Minimal instruction set computers (MISC)
• Very long instruction word (VLIW)
• Explicitly parallel instruction computing (EPIC)
• One instruction set computer (OISC)
• Zero instruction set computer (ZISC)

Reduced Instruction Set Computer:


Reduced Instruction Set Computer (RISC) is an instruction set architecture (ISA)
with a small, highly optimized set of instructions than a complex instruction set
computer (CISC). RISC processors are used in supercomputers such as Summit, which, as

5
of November 2018, is the world's fastest supercomputer as ranked by the TOP500
project.

Complex Instruction Set Computer:


A Complex Instruction Set Computer (CISC) is an instruction set architecture (ISA)
in which single instructions can execute several low-level operations or are capable of
multi-step operations or addressing modes within single instructions.

Minimal Instruction Set Computer:


Minimal instruction set computers (MISC) is a processor architecture with a very
small number of basic instruction operations and corresponding opcodes. As a result of
this is a smaller instruction set, a smaller and faster instruction set decode unit, and
faster operation of individual instructions.

Very Long Instruction Word:


Very long instruction word (VLIW) is an instruction set architectures designed to
exploit instruction level parallelism (ILP). Central processing units (CPU, processor)
mostly allow programs to specify instructions to execute in sequence only, a VLIW
processor allows programs to explicitly specify instructions to execute in parallel. This
design is intended to allow higher performance without the complexity inherent in
some other designs.

Explicitly Parallel Instruction Computing (EPIC):


Explicitly Parallel Instruction Computing (EPIC) refers to architectures in which
features are provided to facilitate compiler enhancements of instruction-level
parallelism (ILP) in all programs, while keeping hardware complexity relatively low.
permits microprocessors to execute software instructions in parallel by using the
compiler, rather than complex on-die circuitry, to control parallel instruction execution.
This was intended to allow simple performance scaling without resorting to higher clock
frequencies.

One-instruction Set computer (OISC):


One-instruction set computer (OISC), sometimes called an ultimate reduced instruction
set computer (URISC), is an abstract machine that uses only one instruction, eliminating
the need for a machine language opcode.

Zero-instruction Set computer (ZISC):


Zero instruction set computer (ZISC) refers to a computer architecture based only
on pattern matching and the classical sense where there is no (micro) instruction. These
6
chips are considered comparable to neural networks and are sold in the number of
"synapses" and "neurons." The ZISC architecture relieves memory bottlenecks by mixing
pattern memory with pattern learning and recognition logic.

Q4. Types of Instructions in OS

Following are the two types of Instructions in OS:

• 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:

• I/O instructions and Halt instructions


• Turn off all Interrupts
• Set the Timer
• Context Switching
• Clear the Memory or Remove a process from the Memory
• Modify entries in Device-status table

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

Privileged Instructions Non-Privileged Instructions


These Instructions can be run only in Kernel These Instructions can be run only in User
Mode Mode
The following operations need to be The following operations are non-privileged:
privileged: Set value of timer, clear memory, Reading the status of Processor, Reading the
turn off interrupts, modify entries in device- System Time, Generate any Trap Instruction,
status table, access I/O device. Sending the final printout of Printer

Q5. Types of Interrupts

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.

Following are the different types of interrupts

• 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:

• Maskable Interrupts - The hardware interrupts can be delayed when a high


priority interrupt has occurred at the same time. RST6.5, RST7.5, and
RST5.5 of 8085 are examples.
• Non-maskable Interrupts - The hardware interrupts which cannot be
delayed, and therefore require the processor to process them immediately.
It includes types of internal system chipset errors, memory corruption
problems, parity errors and high-level errors needing immediate attention

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.

Q6. Kernel Mode & User Mode

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.

If code executing in User mode attempts to do something outside its purview--


like, say, accessing a privileged CPU instruction or modifying memory that it has no
access to, a trappable exception is thrown. Instead of your entire system crashing, only
that particular application crashes. That's the value of 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

You might also like