Professional Documents
Culture Documents
SUBJECT:
CLOUD COMPUTING
ASSIGNMENT NO. 2
COURSE INSTRUCTOR:
DR. HUMAIRA IJAZ
COURSE CODE:
IT-4544
PREPARED BY:
WALEED AHMED
BSEF17E05
BSSE (7TH- SELF)
2017-2021
DATE:
WEDNESDAY, NOVEMBER 18, 2020.
DEPARTMENT OF CS & IT
UNIVERSITY OF SARGODHA
SARGODHA, 40100
1|P a ge
CLOUD COMPUTING
Classification of Interrupts According to the Temporal Relationship with System Clock: ________ 10
1. Synchronous Interrupt: _______________________________________________________________ 10
2. Asynchronous Interrupts: _____________________________________________________________ 10
2|P a ge
CLOUD COMPUTING
Interrupt Handling:________________________________________________________________ 11
Type of Interrupt Handlers: _________________________________________________________ 11
1. First Level Interrupt Handler (FLIH) ______________________________________________________ 11
2. Second Level Interrupt Handler (SLIH) ___________________________________________________11
3|P a ge
CLOUD COMPUTING
CLOUD COMPUTING
ASSIGNMENT NO.2
Q.No.1: Differentiate between Simulation, Emulation and Virtualization?
ANS:
EMULATION VIRTUALIZATION SIMULATION
Emulation, in a software Virtualization is the creation A simulation is an
context, is the use of an of virtual servers, approximate imitation of the
application program or infrastructures, devices and operation of a process or
device to imitate the computing resources. system that represents its
behavior of another program Virtualization changes the operation over time. A
or device. Common uses of hardware-software relations computer simulation is an
emulation include: Running and is one of the attempt to model a real-life
an operating system on a foundational elements of or hypothetical situation on a
hardware platform for which cloud computing technology computer so that it can be
it was not originally that helps utilize the studied to see how the
engineered. capabilities of cloud system works.
computing to the full.
In case of Emulation, you’d In virtualization, hardware In simulation, the hardware
need a software connector to can be accessed directly. is accessed both directly to
access hardware. test functionality and
indirectly to control the
environment.
Emulator requires an Virtual machine can run the An instruction set simulator
interpreter to translate the code directly, which is (ISS) is a simulation model,
source code. available in different usually coded in a high-level
languages. programming language,
which works by "reading"
instructions and maintaining
internal variables which
represent the processor's
registers.
Emulators are relatively Virtual machines are Simulators are faster than
slower. Since it involves relatively faster in its emulators but could be
binary translation which can operations. slower than virtual machines.
cause latency.
Emulation is comparatively VM solutions are costlier Simulator are the most costly
cheaper. than Emulation. of the three techniques as it
builds real time environment
to execute the code (system).
4|P a ge
CLOUD COMPUTING
SIMULATION:
Simulation is preferred where want to:
Avoid danger and loss of life.
Where conditions can be varied and outcomes investigated.
Investigate critical situations without risk.
Have effective cost control.
Have speedy behavior needed to be studied easily over a long period of time.
VIRTUALIZATION:
Virtualization is preferred where we want:
To reduced capital and operating costs.
Minimized or eliminated downtime.
Increased it productivity, efficiency, agility and responsiveness.
Faster provisioning of applications and resources.
Greater business continuity and disaster recovery.
5|P a ge
CLOUD COMPUTING
6|P a ge
CLOUD COMPUTING
POPULAR ISAS:
There are various popular instruction sets that are used in the industry and are of theoretical
importance. Each one has its own usage and advantages.
Q.No.4: What are privilege levels (rings) in OS and different types of instructions?
ANS:
PRIVILEGE LEVEL:
A privilege level in the x86 instruction set controls the access of the program currently running
on the processor to resources such as memory regions, I/O ports, and special instructions. There
are 4 privilege levels ranging from 0 which is the most privileged, to 3 which is least privileged.
Most modern operating systems use level 0 for the kernel/executive, and use level 3 for
application programs. Any resource available to level n is also available to levels 0 to n, so the
privilege levels are rings. When a lesser privileged process tries to access a higher privileged
process, a general protection fault exception is reported to the OS.
7|P a ge
CLOUD COMPUTING
Computer operating systems provide different levels of access to resources. A protection ring is
one of two or more hierarchical levels or layers of privilege within the architecture of a computer
system. This is generally hardware-enforced by some CPU architectures that provide different
CPU modes at the hardware or microcode level. Rings are arranged in a hierarchy from most
privileged (most trusted, usually numbered zero) to least privileged (least trusted, usually with
the highest ring number). On most operating systems, Ring 0 is the level with the most privileges
and interacts most directly with the physical hardware such as the CPU and memory.
In the inner most ring are the most protected instructions; those that only the kernel should be allowed
to call. For example, the HLT instruction to halt the processor should not be allowed to be run by a user
application, since it would stop the entire computer from working. However, the kernel needs to be able
to call this instruction when the computer is legitimately shut down.
Each inner ring can access any instructions protected by a further out ring, but not any protected by a
further in ring. Not all architectures have multiple levels of rings as above, but most will either provide
for at least a "kernel" and "user" level.
TYPES OF INSTRUCTIONS:
Instructions are divided into two categories:
Non-Privileged Instructions
Privileged Instructions.
NON-PRIVILEGED INSTRUCTIONS:
A Non-Privileged instruction is an instruction that any application or user can execute.
(OR)
The Instructions that can run only in User Mode are called Non-Privileged Instructions.
Various examples of Non-Privileged Instructions include:
8|P a ge
CLOUD COMPUTING
9|P a ge
CLOUD COMPUTING
Types of Interrupts:
Although interrupts have highest priority than other signals, there are many type of interrupts
but basic type of interrupts are
1. HARDWARE INTERRUPTS: If the signal for the processor is from external device or
hardware is called hardware interrupts. Example: from keyboard we will press the key to
do some action this pressing of key in keyboard will generate a signal which is given to
the processor to do action, such interrupts are called hardware interrupts. Hardware
interrupts can be classified into two types they are
Maskable Interrupt: The hardware interrupts which can be delayed when a much
highest priority interrupt has occurred to the processor.
Non-Maskable Interrupt: The hardware which cannot be delayed and should
process by the processor immediately.
2. SOFTWARE INTERRUPTS: Software interrupt can also divided in to two types. They are
Normal Interrupts: the interrupts which are caused by the software instructions
are called software instructions.
Exception: Unplanned interrupts while executing a program is called Exception.
For example: while executing a program if we got a value which should be divided
by zero is called a exception.
CLASSIFICATION OF INTERRUPTS ACCORDING TO PERIODICITY OF OCCURRENCE:
1. Periodic Interrupt: If the interrupts occurred at fixed interval in timeline then that
interrupts are called periodic interrupts
2. Aperiodic Interrupt: If the occurrence of interrupt cannot be predicted then that interrupt
is called aperiodic interrupt.
CLASSIFICATION OF INTERRUPTS ACCORDING TO THE TEMPORAL RELATIONSHIP WITH
SYSTEM CLOCK:
1. Synchronous Interrupt: The source of interrupt is in phase to the system clock is called
synchronous interrupt. In other words interrupts which are dependent on the system
clock. Example: timer service that uses the system clock.
2. Asynchronous Interrupts: If the interrupts are independent or not in phase to the system
clock is called asynchronous interrupt.
10 | P a g e
CLOUD COMPUTING
11 | P a g e
CLOUD COMPUTING
1. When the reset pin is activated, the 8051 jumps to the address location 0000. This is power-
up reset.
12 | P a g e
CLOUD COMPUTING
2. Two interrupts are set aside for the timers: one for timer 0 and one for timer 1. Memory
locations are 000BH and 001BH respectively in the interrupt vector table.
3. Two interrupts are set aside for hardware external interrupts. Pin no. 12 and Pin no. 13 in
Port 3 are for the external hardware interrupts INT0 and INT1, respectively. Memory locations
are 0003H and 0013H respectively in the interrupt vector table.
4. Serial communication has a single interrupt that belongs to both receive and transmit.
Memory location 0023H belongs to this interrupt.
Figure 3: Shows a typical vector table of a real system. The undefined instruction handler is located so that a simple branch is
adequate, whereas the other vectors require an indirect address using assembler instructions specific for loading.
FETCH:
The "fetch" method loads the PC indirectly, using the address of some entry inside the interrupt
vector table to pull an address out of that table, and then loading the PC with that address. Each
and every entry of the IVT is the address of an interrupt service routine. All Motorola/Freescale
microcontrollers use the fetch method.
13 | P a g e
CLOUD COMPUTING
INTERRUPT ACKNOWLEDGE:
For the "interrupt acknowledge" method, the external device gives the CPU an interrupt handler
number. The interrupt acknowledge method is used by the Intel Pentium and many older
microprocessors.
14 | P a g e
CLOUD COMPUTING
INTERRUPT HANDLING
When an interrupt occurs, the hardware automatically switches a part of the context (at least
enough to allow the handler to return to the interrupted code). The handler may save additional
context, depending on details of the particular hardware and software designs. Often only a
minimal part of the context is changed in order to minimize the amount of time spent handling
the interrupt. The kernel does not spawn or schedule a special process to handle interrupts, but
instead the handler executes in the (often partial) context established at the beginning of
interrupt handling. Once interrupt servicing is complete, the context in effect before the interrupt
occurred is restored so that the interrupted process can resume execution in its proper state.
THANK YOU
15 | P a g e