SlideShare a Scribd company logo
1 of 41
2024/4/1 NTHU CS5421 Cloud Computing 1
Real-Machine
Che-Rung Lee
Outline
Computer System
 Computer System Hardware
 Instruction Set Architecture (ISA)
 Operating System Organization
Program execution
Memory management
Input / Output control
A Computer System
2024/4/1 3
NTHU CS5421 Cloud Computing
Application
Programs Libraries
Operating System
Drivers
Memory
Manager
Scheduler
Execution Hardware (CPU)
Memory
Translation
System Interconnect
(Bus)
Controllers Controllers
Main
Memory
I/O Devices
Networking
Instruction
Set
Architecture
Software
Hardware
Computer Hardware Organization
2024/4/1 4
NTHU CS5421 Cloud Computing
Processor
Interface
Memory
Controller
Interface
Controller
Controller
Expansion
Frame
Buffer
Hard Drives
Local Bus
High-Speed I/O Bus
Low-Speed I/O Bus
Monitor
Floppy
CD ROM
Instruction Set Architecture (ISA)
The part of the computer architecture related to
programming, including the native data types,
instructions, registers, addressing modes,
memory architecture, interrupt and exception
handling, and external I/O.
 For computers, it’s the
control interface.
 For OS, it’s a set of
assembly instructions.
2024/4/1 NTHU CS5421 Cloud Computing 5
Operating System
An operating system (OS) is
software, consisting of
programs and data, that runs on
computers, manages computer
hardware resources, and
provides common services for
execution of various application
software.
2024/4/1 6
NTHU CS5421 Cloud Computing
A Computer System
A computer system is an integration of
computer hardware, ISA, and OS. Many
functions/activities are achieved from the
combinative efforts from those three.
We will see three major functions/activities of a
computer system
 Program execution
 Memory access
 Input / output control
2024/4/1 NTHU CS5421 Cloud Computing 7
Outline
Computer System
 Computer System Hardware
 Instruction Set Architecture (ISA)
 Operating System Organization
Program execution
Memory management
Input / Output control
OS: Program Execution
The operating system time-multiplexes a
computer system's processor(s) among several
processes that may be active in the system.
2024/4/1 9
NTHU CS5421 Cloud Computing
Interrupt Interrupt Interrupt Interrupt
Process
A
context
switch
Process
B
context
switch
Process A
context
switch
Process
B
context
switch
0ms 50ms 150ms 250ms 350ms
Process B ready Process A ready Process B ready
Interrupt
The interrupt is triggered by a timer (hardware),
which is set to a fixed time-slice.
When an interrupt is triggered, CPU hardware
1. Stops the execution of the current program,
2. Saves the context of the current program,
3. Jumps to the subroutine that handles the interrupt.
The subroutine that handles the interrupt is
called interrupt service routine (ISR), which is
numbered to an interrupt handle vector
 OS defines those ISRs, and loads them to fixed
addresses when booting
2024/4/1 NTHU CS5421 Cloud Computing 10
Privilege Levels
To manage the execution of processes and
system resources, OS (software) needs more
power than general processes (software also).
 OS is called the kernel
But how can we prevent other
processes to perform forbidden
instructions
 Such as change the code of ISRs
2024/4/1 NTHU CS5421 Cloud Computing 11
Privilege Levels
Usually an ISA specifies at least two modes of
operation
 System mode (supervised, kernel, privileged mode) :
all resources are accessible to software.
 User mode : only certain restricted resources are
accessible.
Two privilege levels IA-32 ISA Four levels
OS UNIX Windows, Linux
Modification bit(s) Just one bit Two bits
2024/4/1 NTHU CS5421 Cloud Computing 12
User Mode vs. Kernel Mode
2024/4/1 NTHU CS5421 Cloud Computing 13
Kernel
Mode
User Mode
System
Mode
Kernel
Ring 0
Least privileged
Most privileged
Intel IA-32 has four rings, use only the
innermost level for the OS and level 3
for user applications.
Simple systems have two
levels of privilege.
Classification of Instructions
Normal instruction: Both executable in user
mode and kernel mode.
 Ex: Add, And, jump
Privileged instruction: Only executable in kernel
mode, but not in user mode
 Ex: Access memory in kernel space
Executing privilege instructions in user mode will
cause a trap.
Trap, Exception, and Interrupt
A trap is a software-invoked interrupt.
 User program can invoke a trap, such as by “int”.
An exception is also a trap, which is triggered by
an exceptional condition, not by programs.
 Ex: stack overflow, divide by zero, illegal memory
access, etc
An interrupt, or hardware
interrupt, occurs due to
events of external
hardware.
2024/4/1 NTHU CS5421 Cloud Computing 15
Change of Privilege Modes
Either via a trap or via a system call
System call
 Invoked by applications in user mode to ask services
from OS, for example, file IO.
 After a system call, the control is given to OS.
2024/4/1 NTHU CS5421 Cloud Computing 16
#include<syscall.h>
Extern int syscall(int,…);
int file_close( int filedescriptor){
return syscall(SYS_close , filedescriptor);
}
System Call in x86
A system call is accomplished in Linux on x86
processors by calling the “int 0x80” together with
the register values (system call number).
2024/4/1 NTHU CS5421 Cloud Computing 17
Outline
Computer System
 Computer System Hardware
 Instruction Set Architecture (ISA)
 Operating System Organization
Program execution
Memory management
Input / Output control
Main Memory
Memory system are
built primarily from
RAM.
All locations in the real
address space do not
necessarily
correspond to RAM.
2024/4/1 NTHU CS5421 Cloud Computing 19
Cache Memory
In order to determine which main memory lines
are located in a cache, the cache is designed to
be associatively accessed.
Figure belong is a fully associative cache.
2024/4/1 NTHU CS5421 Cloud Computing 20
Memory Management
Virtual memory
 With logical-to-real memory mapping, program
memory has become a virtualized resource. The
logical address space represents only a virtual view of
memory.
For protecting the in used memory, the ISA can
limit the access of a program to parts of memory.
 By setting the permission of read, write, and execute
instructions.
2024/4/1 NTHU CS5421 Cloud Computing 21
Virtual Memory
2024/4/1 NTHU CS5421 Cloud Computing 22
Backing
Store
Logical Memory
of Program 1
Logical Memory
of Program 2
Real Memory
unused
memory
Page Table
To support logical-to-real memory mapping, a
data structure known as the page table is used.
2024/4/1 NTHU CS5421 Cloud Computing 23
v PB real page no.
v PB real page no.
v PB real page no.
⁞
v PB real page no.
v PB real page no.
⁞
Page Table
Virtual page no.
virtual address
offset Real page no.
real address
offset
Page Table Structure
 The page table itself usually resides in memory.
 The page table pointer register indicates the base of
the page table.
 The real page number contains information about the
real memory location of an accessed virtual page.
 Valid bit indicates whether or not the page is mapped.
 Protection bits (PB)
 Three types of common control are read, write, and execute.
 Which may be determined by a program’s privilege level
2024/4/1 NTHU CS5421 Cloud Computing 24
Memory Management Unit (MMU)
A hardware to handle the memory requested
 Translate virtual addresses to physical addresses,
memory protection, cache control, bus arbitration, etc.
 Page Table Base Register (PTBR) is a register point to
the base of page table for MMU.
Translation Lookaside Buffer
To make memory accesses much faster, a small
associative memory structure called a translation
lookaside buffer (TLB) is used for caching recent
address translations.
Three possibilities
 TLB hit
 Entry is match, but protection bit does not allow
 TLB miss
2024/4/1 NTHU CS5421 Cloud Computing 26
TLB to Page Table
2024/4/1 NTHU CS5421 Cloud Computing 27
v PB real page no.
v PB real page no.
v PB real page no.
⁞
v PB real page no.
v PB real page no.
v PB real page no.
Page
Table
v virtual page no. PB real page no.
v virtual page no. PB real page no.
v virtual page no. PB real page no.
v virtual page no. PB real page no.
TLB
OS: Virtual Memory Process
When a process generates a page or TLB fault,
the OS takes over
 Updates the TLB from the page table if the TLB is
architected.
 Or handles the fault by scheduling a disk I/O
operation to the backing store (hard disk) to retrieve
the page.
2024/4/1 28
NTHU CS5421 Cloud Computing
Outline
Computer System
 Computer System Hardware
 Instruction Set Architecture (ISA)
 Operating System Organization
Program execution
Memory management
Input / Output control
Input/Output Systems
An I/O system consists of a number of buses
that connect the processor and memory to the
I/O devices.
The bus serves as a highway, through which
 devices are addressed and given commands
 data is transferred between the processor or memory
and the I/O devices.
There are four ways in which I/O is organized.
2024/4/1 NTHU CS5421 Cloud Computing 30
Input/Output Systems
Programmed I/O:
 The I/O request is issued over
the bus and the device controller
is polled until the request is
satisfied.
Interrupt-driven I/O:
 The CPU continues with some
other tasks after issuing an I/O
request. An interrupt from the I/O
controller informs the OS about
the status of the request.
2024/4/1 NTHU CS5421 Cloud Computing 31
Input/Output Systems
DMA-managed I/O:
 The I/O controller uses a series of bus
transactions to move large blocks of data
to or from an I/O device and to interrupt the
CPU when it completes the entire task.
IOP-based I/O:
 IOP (I/O processor) is a special processor
that can manage complex I/O transactions.
The IOP can buffer transactions for various
devices and bundle them to make the best
utilization of the available I/O resource.
2024/4/1 NTHU CS5421 Cloud Computing 32
PCI Architecture
PCI based system builds in a tree topology
 PCI bus
• Parallel connect devices and bridges
 PCI-PCI Bridge
• Connect two PCI buses
• Become the root of
lower bus
 PCI-ISA Bridge
• Connect to conventional
ISA device
PCI Express Architecture
PCIe is in a point to point architecture
 Root Complex: generate transaction requests on
behalf of CPU, interconnected through a local bus.
 Switch: connect endpoint devices or other switches
 Endpoint Device:
• Physical PCIe devices
• Legacy PCI devices
 PCI Express Bridge
• Connect to other
legacy subsystems
Input/Output Resources
It is more appropriate to deal with the specifics
of I/O in software, particularly in the OS software.
The ISA needs to provide only a mechanism for
addressing I/O devices and to transfer
information to and from the devices.
Two types of addressing mechanisms
 Specific I/O instructions
 Memory mapped I/O
2024/4/1 NTHU CS5421 Cloud Computing 35
Input/Output Instructions
I/O Instructions
 The addresses are completely separate from main
memory addresses.
 The execution needs signals to activated the
corresponding I/O instruction.
Instructions are usually privileged and can only
be invoked by the operating system.
2024/4/1 NTHU CS5421 Cloud Computing 36
Memory Mapped I / O
Memory Mapped I/O
 A specific region of the real memory address space is
reserved for accessing I/O devices.
 Loads and stores directed to these addresses are
interpreted by the memory controller as commands
sent to an I/O device.
The real memory addresses used for I/O are
never mapped to user-accessible pages, so only
the OS has access to them.
2024/4/1 NTHU CS5421 Cloud Computing 37
Input/Output Management
OS abstracts most of the details of devices and
makes I/O devices accessible through well-
defined system calls.
Processes invoke I/O by using system calls,
which transfers control to the OS.
The OS uses an interface to a set of software
routines that convert generic hardware requests
into specific commands to hardware devices.
2024/4/1 38
NTHU CS5421 Cloud Computing
Input/Output Management
2024/4/1 39
NTHU CS5421 Cloud Computing
Applications OS
Virtual
Mem mgr
I/O Drivers
Hardware
System
calls
Virtual
memory
and I/O
operations
Driver
calls
Input/Output System Calls
Program makes a device-independent request
such as open() or read() through a system-call.
2024/4/1 40
NTHU CS5421 Cloud Computing
User Program
System calls
fd_open(“dev/abc”,O_RDWR,0); read(fd,out_data,8); write(fd,out_data,8); close(fd);
Virtual Filesystem Switch
Linux Kernel
device driver routines abc_open() abc_read() abc_write() abc_close()
Hardware
References
 Appendix A of “Virtual Machines: Versatile Platforms for
Systems and Processes”, by Jim Smith and Ravi Nair
 Many figures are from Internet
2024/4/1 NTHU CS5421 Cloud Computing 41

More Related Content

Similar to Real Machine Cloud Computing Che Rung Lee.pptx

Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-BasicsAjit Nayak
 
Chapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxChapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxJanethMedina31
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1Emmanuel Damka
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxLeahRachael
 
ICTCoreCh11
ICTCoreCh11ICTCoreCh11
ICTCoreCh11garcons0
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfcauuthovohoaichau
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxhasanbashar400
 
6.1_IO-Principles.ppt
6.1_IO-Principles.ppt6.1_IO-Principles.ppt
6.1_IO-Principles.pptdedanndege
 
03. top level view of computer function &amp; interconnection
03. top level view of computer function &amp; interconnection03. top level view of computer function &amp; interconnection
03. top level view of computer function &amp; interconnectionnoman yasin
 

Similar to Real Machine Cloud Computing Che Rung Lee.pptx (20)

Operating system ppt
Operating system pptOperating system ppt
Operating system ppt
 
Operating system ppt
Operating system pptOperating system ppt
Operating system ppt
 
Microcontroller part 1
Microcontroller part 1Microcontroller part 1
Microcontroller part 1
 
Operating Systems Part I-Basics
Operating Systems Part I-BasicsOperating Systems Part I-Basics
Operating Systems Part I-Basics
 
Os
OsOs
Os
 
Chapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxChapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptx
 
I/O System
I/O SystemI/O System
I/O System
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1
 
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptxUNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
UNIT 5- UNDERSTANDING THE SYSTEM DESIGN PROCESS.pptx
 
ICTCoreCh11
ICTCoreCh11ICTCoreCh11
ICTCoreCh11
 
Ch 01 os8e
Ch 01  os8eCh 01  os8e
Ch 01 os8e
 
CH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdfCH03-COA10e_ComputerFun5656565656565ction.pdf
CH03-COA10e_ComputerFun5656565656565ction.pdf
 
OS_Intro_Chap_1.ppt
OS_Intro_Chap_1.pptOS_Intro_Chap_1.ppt
OS_Intro_Chap_1.ppt
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptx
 
6.1_IO-Principles.ppt
6.1_IO-Principles.ppt6.1_IO-Principles.ppt
6.1_IO-Principles.ppt
 
Chapter 22 - Windows XP
Chapter 22 - Windows XPChapter 22 - Windows XP
Chapter 22 - Windows XP
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Chapter01 os7e
Chapter01 os7eChapter01 os7e
Chapter01 os7e
 
03. top level view of computer function &amp; interconnection
03. top level view of computer function &amp; interconnection03. top level view of computer function &amp; interconnection
03. top level view of computer function &amp; interconnection
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
 

Recently uploaded

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 

Real Machine Cloud Computing Che Rung Lee.pptx

  • 1. 2024/4/1 NTHU CS5421 Cloud Computing 1 Real-Machine Che-Rung Lee
  • 2. Outline Computer System  Computer System Hardware  Instruction Set Architecture (ISA)  Operating System Organization Program execution Memory management Input / Output control
  • 3. A Computer System 2024/4/1 3 NTHU CS5421 Cloud Computing Application Programs Libraries Operating System Drivers Memory Manager Scheduler Execution Hardware (CPU) Memory Translation System Interconnect (Bus) Controllers Controllers Main Memory I/O Devices Networking Instruction Set Architecture Software Hardware
  • 4. Computer Hardware Organization 2024/4/1 4 NTHU CS5421 Cloud Computing Processor Interface Memory Controller Interface Controller Controller Expansion Frame Buffer Hard Drives Local Bus High-Speed I/O Bus Low-Speed I/O Bus Monitor Floppy CD ROM
  • 5. Instruction Set Architecture (ISA) The part of the computer architecture related to programming, including the native data types, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O.  For computers, it’s the control interface.  For OS, it’s a set of assembly instructions. 2024/4/1 NTHU CS5421 Cloud Computing 5
  • 6. Operating System An operating system (OS) is software, consisting of programs and data, that runs on computers, manages computer hardware resources, and provides common services for execution of various application software. 2024/4/1 6 NTHU CS5421 Cloud Computing
  • 7. A Computer System A computer system is an integration of computer hardware, ISA, and OS. Many functions/activities are achieved from the combinative efforts from those three. We will see three major functions/activities of a computer system  Program execution  Memory access  Input / output control 2024/4/1 NTHU CS5421 Cloud Computing 7
  • 8. Outline Computer System  Computer System Hardware  Instruction Set Architecture (ISA)  Operating System Organization Program execution Memory management Input / Output control
  • 9. OS: Program Execution The operating system time-multiplexes a computer system's processor(s) among several processes that may be active in the system. 2024/4/1 9 NTHU CS5421 Cloud Computing Interrupt Interrupt Interrupt Interrupt Process A context switch Process B context switch Process A context switch Process B context switch 0ms 50ms 150ms 250ms 350ms Process B ready Process A ready Process B ready
  • 10. Interrupt The interrupt is triggered by a timer (hardware), which is set to a fixed time-slice. When an interrupt is triggered, CPU hardware 1. Stops the execution of the current program, 2. Saves the context of the current program, 3. Jumps to the subroutine that handles the interrupt. The subroutine that handles the interrupt is called interrupt service routine (ISR), which is numbered to an interrupt handle vector  OS defines those ISRs, and loads them to fixed addresses when booting 2024/4/1 NTHU CS5421 Cloud Computing 10
  • 11. Privilege Levels To manage the execution of processes and system resources, OS (software) needs more power than general processes (software also).  OS is called the kernel But how can we prevent other processes to perform forbidden instructions  Such as change the code of ISRs 2024/4/1 NTHU CS5421 Cloud Computing 11
  • 12. Privilege Levels Usually an ISA specifies at least two modes of operation  System mode (supervised, kernel, privileged mode) : all resources are accessible to software.  User mode : only certain restricted resources are accessible. Two privilege levels IA-32 ISA Four levels OS UNIX Windows, Linux Modification bit(s) Just one bit Two bits 2024/4/1 NTHU CS5421 Cloud Computing 12
  • 13. User Mode vs. Kernel Mode 2024/4/1 NTHU CS5421 Cloud Computing 13 Kernel Mode User Mode System Mode Kernel Ring 0 Least privileged Most privileged Intel IA-32 has four rings, use only the innermost level for the OS and level 3 for user applications. Simple systems have two levels of privilege.
  • 14. Classification of Instructions Normal instruction: Both executable in user mode and kernel mode.  Ex: Add, And, jump Privileged instruction: Only executable in kernel mode, but not in user mode  Ex: Access memory in kernel space Executing privilege instructions in user mode will cause a trap.
  • 15. Trap, Exception, and Interrupt A trap is a software-invoked interrupt.  User program can invoke a trap, such as by “int”. An exception is also a trap, which is triggered by an exceptional condition, not by programs.  Ex: stack overflow, divide by zero, illegal memory access, etc An interrupt, or hardware interrupt, occurs due to events of external hardware. 2024/4/1 NTHU CS5421 Cloud Computing 15
  • 16. Change of Privilege Modes Either via a trap or via a system call System call  Invoked by applications in user mode to ask services from OS, for example, file IO.  After a system call, the control is given to OS. 2024/4/1 NTHU CS5421 Cloud Computing 16 #include<syscall.h> Extern int syscall(int,…); int file_close( int filedescriptor){ return syscall(SYS_close , filedescriptor); }
  • 17. System Call in x86 A system call is accomplished in Linux on x86 processors by calling the “int 0x80” together with the register values (system call number). 2024/4/1 NTHU CS5421 Cloud Computing 17
  • 18. Outline Computer System  Computer System Hardware  Instruction Set Architecture (ISA)  Operating System Organization Program execution Memory management Input / Output control
  • 19. Main Memory Memory system are built primarily from RAM. All locations in the real address space do not necessarily correspond to RAM. 2024/4/1 NTHU CS5421 Cloud Computing 19
  • 20. Cache Memory In order to determine which main memory lines are located in a cache, the cache is designed to be associatively accessed. Figure belong is a fully associative cache. 2024/4/1 NTHU CS5421 Cloud Computing 20
  • 21. Memory Management Virtual memory  With logical-to-real memory mapping, program memory has become a virtualized resource. The logical address space represents only a virtual view of memory. For protecting the in used memory, the ISA can limit the access of a program to parts of memory.  By setting the permission of read, write, and execute instructions. 2024/4/1 NTHU CS5421 Cloud Computing 21
  • 22. Virtual Memory 2024/4/1 NTHU CS5421 Cloud Computing 22 Backing Store Logical Memory of Program 1 Logical Memory of Program 2 Real Memory unused memory
  • 23. Page Table To support logical-to-real memory mapping, a data structure known as the page table is used. 2024/4/1 NTHU CS5421 Cloud Computing 23 v PB real page no. v PB real page no. v PB real page no. ⁞ v PB real page no. v PB real page no. ⁞ Page Table Virtual page no. virtual address offset Real page no. real address offset
  • 24. Page Table Structure  The page table itself usually resides in memory.  The page table pointer register indicates the base of the page table.  The real page number contains information about the real memory location of an accessed virtual page.  Valid bit indicates whether or not the page is mapped.  Protection bits (PB)  Three types of common control are read, write, and execute.  Which may be determined by a program’s privilege level 2024/4/1 NTHU CS5421 Cloud Computing 24
  • 25. Memory Management Unit (MMU) A hardware to handle the memory requested  Translate virtual addresses to physical addresses, memory protection, cache control, bus arbitration, etc.  Page Table Base Register (PTBR) is a register point to the base of page table for MMU.
  • 26. Translation Lookaside Buffer To make memory accesses much faster, a small associative memory structure called a translation lookaside buffer (TLB) is used for caching recent address translations. Three possibilities  TLB hit  Entry is match, but protection bit does not allow  TLB miss 2024/4/1 NTHU CS5421 Cloud Computing 26
  • 27. TLB to Page Table 2024/4/1 NTHU CS5421 Cloud Computing 27 v PB real page no. v PB real page no. v PB real page no. ⁞ v PB real page no. v PB real page no. v PB real page no. Page Table v virtual page no. PB real page no. v virtual page no. PB real page no. v virtual page no. PB real page no. v virtual page no. PB real page no. TLB
  • 28. OS: Virtual Memory Process When a process generates a page or TLB fault, the OS takes over  Updates the TLB from the page table if the TLB is architected.  Or handles the fault by scheduling a disk I/O operation to the backing store (hard disk) to retrieve the page. 2024/4/1 28 NTHU CS5421 Cloud Computing
  • 29. Outline Computer System  Computer System Hardware  Instruction Set Architecture (ISA)  Operating System Organization Program execution Memory management Input / Output control
  • 30. Input/Output Systems An I/O system consists of a number of buses that connect the processor and memory to the I/O devices. The bus serves as a highway, through which  devices are addressed and given commands  data is transferred between the processor or memory and the I/O devices. There are four ways in which I/O is organized. 2024/4/1 NTHU CS5421 Cloud Computing 30
  • 31. Input/Output Systems Programmed I/O:  The I/O request is issued over the bus and the device controller is polled until the request is satisfied. Interrupt-driven I/O:  The CPU continues with some other tasks after issuing an I/O request. An interrupt from the I/O controller informs the OS about the status of the request. 2024/4/1 NTHU CS5421 Cloud Computing 31
  • 32. Input/Output Systems DMA-managed I/O:  The I/O controller uses a series of bus transactions to move large blocks of data to or from an I/O device and to interrupt the CPU when it completes the entire task. IOP-based I/O:  IOP (I/O processor) is a special processor that can manage complex I/O transactions. The IOP can buffer transactions for various devices and bundle them to make the best utilization of the available I/O resource. 2024/4/1 NTHU CS5421 Cloud Computing 32
  • 33. PCI Architecture PCI based system builds in a tree topology  PCI bus • Parallel connect devices and bridges  PCI-PCI Bridge • Connect two PCI buses • Become the root of lower bus  PCI-ISA Bridge • Connect to conventional ISA device
  • 34. PCI Express Architecture PCIe is in a point to point architecture  Root Complex: generate transaction requests on behalf of CPU, interconnected through a local bus.  Switch: connect endpoint devices or other switches  Endpoint Device: • Physical PCIe devices • Legacy PCI devices  PCI Express Bridge • Connect to other legacy subsystems
  • 35. Input/Output Resources It is more appropriate to deal with the specifics of I/O in software, particularly in the OS software. The ISA needs to provide only a mechanism for addressing I/O devices and to transfer information to and from the devices. Two types of addressing mechanisms  Specific I/O instructions  Memory mapped I/O 2024/4/1 NTHU CS5421 Cloud Computing 35
  • 36. Input/Output Instructions I/O Instructions  The addresses are completely separate from main memory addresses.  The execution needs signals to activated the corresponding I/O instruction. Instructions are usually privileged and can only be invoked by the operating system. 2024/4/1 NTHU CS5421 Cloud Computing 36
  • 37. Memory Mapped I / O Memory Mapped I/O  A specific region of the real memory address space is reserved for accessing I/O devices.  Loads and stores directed to these addresses are interpreted by the memory controller as commands sent to an I/O device. The real memory addresses used for I/O are never mapped to user-accessible pages, so only the OS has access to them. 2024/4/1 NTHU CS5421 Cloud Computing 37
  • 38. Input/Output Management OS abstracts most of the details of devices and makes I/O devices accessible through well- defined system calls. Processes invoke I/O by using system calls, which transfers control to the OS. The OS uses an interface to a set of software routines that convert generic hardware requests into specific commands to hardware devices. 2024/4/1 38 NTHU CS5421 Cloud Computing
  • 39. Input/Output Management 2024/4/1 39 NTHU CS5421 Cloud Computing Applications OS Virtual Mem mgr I/O Drivers Hardware System calls Virtual memory and I/O operations Driver calls
  • 40. Input/Output System Calls Program makes a device-independent request such as open() or read() through a system-call. 2024/4/1 40 NTHU CS5421 Cloud Computing User Program System calls fd_open(“dev/abc”,O_RDWR,0); read(fd,out_data,8); write(fd,out_data,8); close(fd); Virtual Filesystem Switch Linux Kernel device driver routines abc_open() abc_read() abc_write() abc_close() Hardware
  • 41. References  Appendix A of “Virtual Machines: Versatile Platforms for Systems and Processes”, by Jim Smith and Ravi Nair  Many figures are from Internet 2024/4/1 NTHU CS5421 Cloud Computing 41

Editor's Notes

  1. Change
  2. NOT sure about the valid bit case
  3. There are two types of device drivers in Linux, character device drivers and block device drivers. Character device drivers communicate directly with the user program, with no buffering in between. A terminal is an example of a character device driver; communication between the device driver and the hardware is performed a character at a time. In contrast, the communication between the driver and the hardware is at a much higher granularity in the case of block device drivers, like those for disks. In this case, user programs access information through an area reserved for the transfer of a block of data.