SlideShare a Scribd company logo
Lecture 2
Computer-System Architecture
Computer-System Architecture
1- single general-purpose processor
–On a single-processor system, there is one
main CPU capable of executing a general-
purpose instruction set, including
instructions from user processes.
–Most systems have special-purpose
processors as well
Computer-System Architecture
2- Multiprocessors systems :
growing in use and importance
– Also known as parallel systems, tightly-coupled systems
– The system have two or more processors in close
communication , sharing the computer bus memory and
peripheral devices.
– Advantages include
1. Increased throughput
2. Economy of scale
3. Increased reliability – graceful degradation or fault
tolerance
Computer-System Architecture
– Two types
1. Asymmetric Multiprocessing
2. Symmetric Multiprocessing
1- Asymmetric Multiprocessing
• In which each processor is assigned a specific task.
• A master processor controls the system
• Master-slave relation ship
2- Symmetric Multiprocessing
• All processors are peers
• Many processes can run simultaneous … n processes
can run if n
CPU
Symmetric Multiprocessing Architecture
Computer-System Architecture
- Multi-computing core
–Multi processor per chip
–Multi chips with single core
–Which better? And why?
–First
–Because on-chip communication is
faster than between- chips
A Dual-Core Design
Clustered Systems
3- Clustered Systems
• Like multiprocessor systems, but multiple systems
working together
• A clustered system uses multiple CPUs to complete a
task.
• It is different from parallel system in that clustered
system consists of two or more individual systems
tied together.
• Definition : The clustered computers share storage
and are closely linked via LAN networking.
10
Clustered Systems
– Provides a high-availability service which survives
failures: A layer of cluster software runs on cluster nodes.
Each node can monitor one or more nodes over the LAN.
– The monitored machine can fail in some cases.
– The monitoring machine can take ownership of its storage.
– The monitoring machine can also restart applications that
were running on the failed machine-
– The failed machine can remain down but the users will see a
brief of the service.
11
Clustered Systems
The clustered system can be of the following forms:
• Asymmetric clustering: In this form, one machine is in hot standby
mode and other machine is running the application. The hot standby
machine performs nothing. It only monitors the server. If faiuler It
becomes the active server if the server fails.
• Symmetric clustering In this mode, two or more machines run the
applications. They also monitor each other at the same time. This
mode is more efficient because it uses all available machines. It can be
used only if multiple applications are available to be executed
• high-performance computing (HPC)
• Applications must be written to use parallelization
12
Operating System Structure
14
Operating System Structure
Multiprogramming:
• Multiprogramming is a form of parallel processing in
which several programs are run at the same time on a
uniprocessor.
• Since there is only one processor , there can be no
true simultaneous execution of different programs.
Instead, the operating system executes part of one
program, then part of another, and so on.
• To the user it appears that all programs are executing
at the same time 15
Memory Layout for Multiprogrammed System
16
Operating System Structure
• Multiprogramming needed for efficiency
– Single user cannot keep CPU and I/O devices busy
at all times
– Multiprogramming organizes jobs (code and data)
so CPU always has one to execute
– A subset of total jobs in system is kept in memory
– One job selected and run via job scheduling
– When it has to wait (for I/O for example), OS
switches to another job
17
Operating System Structure
• Multiprogramming means: that several
programs in different stages of execution are
coordinated to run on a single I-stream engine
(CPU).
• Multiprocessing, which is the coordination of
the simultaneous execution of several
programs running on multiple I-stream
engines (CPUs).
18
Operating System Structure
• Timesharing (multitasking):
is logical extension in which CPU
switches jobs so frequently that
users can interact with each job
while it is running, creating
interactive computing
19
Operating System Structure
• Timesharing:
– Response time should be < 1 second
– Each user has at least one program
executing in memory process
– If several jobs ready to run at the same time
 CPU scheduling
– If processes don’t fit in memory, swapping
moves them in and out to run
– Virtual memory allows execution of
processes not completely in memory
20
OPERATING-SYSTEM OPERATIONS
Computer-System Operation
• Each device controller is in charge of a particular
device type (disk drive, video displays etc).
• I/O devices and the CPU can execute
concurrently.
• Each device controller has a local buffer.
• CPU moves data from/to main memory to/from
local buffers
• I/O is from the device to local buffer of controller.
• Device controller informs CPU that it has finished
its operation by causing an interrupt.
Interrupt
• Means : cut off
• Hardware interrupt, e.g. services requests of I/O
devices
• Software interrupt, e.g. signals, invalid memory
access, division by zero, system calls, etc –(trap)
• Procedures: generic handler or interrupt vector
(MS-DOS,UNIX)
Operating-System Operations
• Interrupts are an important part of a
computer architecture.
• Each computer design has its own interrupt
mechanism, but several functions are
common.
Operating-System Operations
External Interrupts
• An external interrupt is a temporal suspension
of a process caused by an event external to
that process and performed in such a way that
the process can be resumed.
– I/O
– Timer
– Hardware failure
Operating-System Operations
• Interrupt driven by hardware
• Software error or request creates
exception or trap
–Division by zero, request for operating
system service
• Other process problems include infinite
loop, processes modifying each other or
the operating system
Common Functions of Interrupts
• Incoming interrupts are disabled while
another interrupt is being processed to
prevent a lost interrupt
• A trap is a software-generated interrupt
caused either by an error or a user
request
• An operating system is interrupt driven
Operating-System Operations
Instruction Cycle with Interrupts
• CPU checks for interrupts after each instruction.
• If no interrupts, then fetch next instruction of current
program.
• If an interrupt is pending, then suspend execution of
the current program. The processor sends an
acknowledgement signal to the device that issued the
interrupt so that the device can remove its interrupt
signal.
• Interrupt architecture saves the address of the
interrupted instruction (and values of other registers).
Operating-System Operations
Instruction Cycle with Interrupts
• Interrupt transfers control to the interrupt service
routine (Interrupt Handler), generally through the
interrupt vector, which contains the addresses of all the
service routines.
• Separate segments of code determine what action
should be taken for each type of interrupt
Operating-System Operations
Interrupt Driven I/O
• To start an I/O operation, the CPU loads the
appropriate registers within the device controller.
• The device controller examines the contents of
these registers and determines what action to
take and then performs the action.
• Device controller informs CPU that it has finished
its operation by causing an external interrupt
Operating-System Operations
• Interrupt Driven I/O
• A disk block read example:
– For disk reads, the controller reads the block (one or more
sectors) from the derive serially, bit by bit, until the entire
block is in the controller internal buffer.
– It then performs a checksum to verify that no read errors
have occurred.
– The controller sends an interrupt. When the OS starts
running, it can read the disk block from the controller’s
buffer a byte or a word at a time by executing a loop, with
each iteration reading one byte or word from the
controller device register and storing it in the main
memory.
Operating-System Operations
Interrupt Handler
• A program that determines nature of the
interrupt and performs whatever actions are
needed
• Control is transferred to this program
• Generally part of the operating system
Operating-System Operations:
Interrupt Handling Procedure
• Interrupt Handling
Save interrupt information
OS determine the interrupt type (by polling)
Call the corresponding handlers
Return to the interrupted job by the restoring
important information (e.g., saved return
address program counter)
Direct Memory Access (DMA) Structure
• Used for high-speed I/O devices able to
transmit information at close to memory
speeds
• Device controller transfers blocks of data
from buffer storage directly to main memory
without CPU intervention
• Only one interrupt is generated per block,
rather than the one interrupt per byte
Direct Memory Access (DMA) Structure
• Execute the device driver to set up the registers
of the DMA controller.
• DMA moves blocks of data between the
memory and its own buffers.
• Transfer from its buffers to its devices.
• Interrupt the CPU when the job is done
• Direct Memory Access (DMA) Structure
•
• Recall that with interrupt driven I/O, the CPU can request data from
an I/O controller one byte/word at a time which wastes the CPU
time.
• DMA is a scheme which allows block of data transfer from the
device to the memory without the intervention of the CPU.
• After setting up buffers, pointers, and counters for the I/O device by
the CPU, the device controller transfers blocks of data from buffer
storage directly to main memory without CPU intervention.
• Only one interrupt is generated per block, rather than the one
interrupt per byte.
• The OS can only use DMA if the hardware has a DMA controller.
• Direct Memory Access, or DMA, is an
absolutely essential part of any modern
computing architecture. DMA allows the CPU
to offload intensive memory access tasks to
other components. This then frees the CPU
from these menial chores and provides more
cycles to more complex tasks for which it is
better suited.
OPERATING-SYSTEM OPERATIONS
DUAL MODE
Dual-Mode Operation
• Dual-mode operation allows OS to protect itself and
other system components
• Execution of operating-system code and user defined
code user mode and kernel
Operating-System Operations
• Dual-mode operation allows OS to protect itself and
other system components
– User mode and kernel mode
– Mode bit provided by hardware
• Provides ability to distinguish when system is
running user code or kernel code
• Some instructions designated as privileged,
only executable in kernel mode
• System call changes mode to kernel, return
from call resets it to user
Operating-System Operations
• At system boot time, the hardware starts in
kernel mode.
• The operating system is then loaded and starts
user applications in user mode.
• Whenever a trap or interrupt occurs, the
hardware switches from user mode to kernel
mode.
System Calls
42
System Calls
• System calls :
– Interface between processes & OS
• Definition: is how a program requests a service
from an operating system’s kernel . They
provide the interface between a process and
operating system.
• Is an interface between a user-space
application and a service is provided in the
kernel.
43
System Calls
• How to make system calls?
– Assemble-language instructions or
subroutine/functions calls in high-level language
such as C or Perl?
• Generation of in-line instructions or a call to a special
run-time routine.
• Example: read and copy of a file!
– Library Calls vs System Calls
44
System Calls
• Programming interface to the services
provided by the OS
• Typically written in a high-level language
(C or C++)
45
System Calls
• Three most common APIs are Win32 API for
Windows, POSIX API for POSIX-based systems
(including virtually all versions of UNIX, Linux,
and Mac OS X), and Java API for the Java virtual
machine (JVM)
• Why use APIs rather than system calls?
(Note that the system-call names used
throughout this text are generic)
46
API – System Call – OS Relationship
47
System Call Implementation
• The system call interface invokes intended
system call in OS kernel and returns status of
the system call and any return values
• The caller need know nothing about how the
system call is implemented
– Just needs to obey API and understand what OS will do as
a result call
– Most details of OS interface hidden from programmer by
API
• Managed by run-time support library (set of functions
built into libraries included with compiler)
48
Example of Standard API
• Consider the ReadFile() function in the
• Win32 API—a function for reading from a file
• A description of the parameters passed to ReadFile()
– HANDLE file—the file to be read
– LPVOID buffer—a buffer where the data will be read into and written from
– DWORD bytesToRead—the number of bytes to be read into the buffer
– LPDWORD bytesRead—the number of bytes read during the last read
– LPOVERLAPPED ovl—indicates if overlapped I/O is being used 49
Standard C Library Example
• C program invoking printf() library call, which calls write() system call
50
How System Call in Unix
51
System Call Parameter Passing
• Three general methods used to pass parameters to the OS
– Simplest: pass the parameters in registers
• In some cases, may be more parameters than registers
– Parameters stored in a block, or table, in memory, and address
of block passed as a parameter in a register
• This approach taken by Linux and Solaris
– Parameters placed, or pushed, onto the stack by the program
and popped off the stack by the operating system
– Block and stack methods do not limit the number or length of
parameters being passed
52
Parameter Passing via Table
53
Types of System Calls
• Process control
• File management
• Device management
• Information maintenance
• Communications
• Protection
54
Examples of Windows and Unix System Calls
55
MS-DOS execution
(a) At system startup (b) running a program
56
FreeBSD Running Multiple Programs
57
System programs
58
System Programs
• Provide a convenient environment for program
development and execution
– Some of them are simply user interfaces to
system calls; others are considerably more
complex
• File management - Create, delete, copy,
rename, print, dump, list, and generally
manipulate files and directories
59
System Programs
• Status information
– Some ask the system for info - date, time, amount of
available memory, disk space, number of users
– Others provide detailed performance, logging, and
debugging information
– Typically, these programs format and print the
output to the terminal or other output devices
– Some systems implement a registry - used to store
and retrieve configuration information
60
System Programs (cont’d)
• File modification
–Text editors to create and modify files
–Special commands to search contents
of files or perform transformations of
the text
• Programming-language support -
Compilers, assemblers, debuggers and
interpreters sometimes provided
61
System Programs (cont’d)
• Program loading and execution- Absolute
loaders, reloadable loaders, linkage
editors, and overlay-loaders, debugging
systems for higher-level and machine
language
62
System Programs (cont’d)
• Communications - Provide the
mechanism for creating virtual
connections among processes, users, and
computer systems
–Allow users to send messages to one
another’s screens, browse web pages,
send electronic-mail messages, log in
remotely, transfer files from one
machine to another
63
User Operating System Interface
64
User Operating System Interface - CLI
1- Command Line Interface (CLI)
or command interpreter allows direct command
entry
• Sometimes implemented in kernel, sometimes by
systems program
• Sometimes multiple flavors implemented – shells
65
User Operating System Interface - CLI
• Primarily fetches a command from user and
executes it
–Sometimes commands built-in, sometimes
just names of programs
»If the latter, adding new features doesn’t
require shell modification
66
User Operating System Interface - GUI
2- Graphical User Interface (GUI )
– User-friendly desktop metaphor interface
– Usually mouse, keyboard, and monitor
– Icons represent files, programs, actions, etc
– Various mouse buttons over objects in the interface
cause various actions (provide information, options,
execute function, open directory (known as a folder)
– Invented at Xerox PARC
67
User Operating System Interface - GUI
• Many systems now include both CLI and GUI
interfaces
– Microsoft Windows is GUI with CLI
“command” shell
– Apple Mac OS X as “Aqua” GUI interface with
UNIX kernel underneath and shells available
– Solaris is CLI with optional GUI interfaces
(Java Desktop, KDE)
68
Operating system structure
70
Simple Structure
• Called “no structure”
• The operating system is a collection of
procedures, each of which call any of the
other whenever it requires their needs.
71
Simple Structure
• MS-DOS – written to provide the most
functionality in the least space
– Not divided into modules
– Although MS-DOS has some structure, its interfaces
and levels of functionality are not well separated
72
MS-DOS Layer Structure
73
Traditional UNIX System Structure
74
Layered Approach
• The operating system is divided into a number
of layers (levels), each built on top of lower
layers. The bottom layer (layer 0), is the
hardware; the highest (layer N) is the user
interface.
• With modularity, layers are selected such that
each uses functions (operations) and services of
only lower-level layers
75
Layered Operating System
76
Microkernel System Structure
• Philosophy of microkernel is to have the bare
essentials in the kernel.
• Removing all non-essential components from
kernel and implement them in system-and -
user level. Program thst results a smaller
kernel called microkernal.
77
Solaris Modular Approach
78
Microkernel System Structure
• Moves as much from the kernel into
“user” space.
• Communication takes place between user
modules using message passing.
• Benefits:
– Easier to extend a microkernel
– Easier to port the operating system to new
architectures
– More reliable (less code is running in kernel mode)
– More secure
79

More Related Content

What's hot

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
Dr. Loganathan R
 
Demand paging
Demand pagingDemand paging
Demand paging
Trinity Dwarka
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
Ravi Kumar Patel
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
pratikkadam78
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
Damian T. Gordon
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
ManishaJha43
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
Transweb Global Inc
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmsPiyush Rochwani
 
Process management in os
Process management in osProcess management in os
Process management in os
Miong Lazaro
 
Multiprogramming&timesharing
Multiprogramming&timesharingMultiprogramming&timesharing
Multiprogramming&timesharingTanuj Tyagi
 
Mainframe systems
Mainframe systemsMainframe systems
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
Muhammad SiRaj Munir
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
Vandana Salve
 
Scheduling
SchedulingScheduling
Device Management
Device ManagementDevice Management
Device Management
Kabarak University
 

What's hot (20)

Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Multiprogramming&timesharing
Multiprogramming&timesharingMultiprogramming&timesharing
Multiprogramming&timesharing
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
File system implementation
File system implementationFile system implementation
File system implementation
 
Scheduling
SchedulingScheduling
Scheduling
 
Device Management
Device ManagementDevice Management
Device Management
 

Similar to Computer system architecture

Operating System BCA 301
Operating System BCA 301Operating System BCA 301
Operating System BCA 301
cpjcollege
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
shreesha16
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
akhilagajjala
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
PrashantKhobragade3
 
Ch1 introduction
Ch1   introductionCh1   introduction
Ch1 introduction
Welly Dian Astika
 
1_to_10.pdf
1_to_10.pdf1_to_10.pdf
1_to_10.pdf
SHEHABALYAMANI
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
VAIBHAVSAHU55
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
FahanaAbdulVahab
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
nikhil287188
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
UsamaKhan987353
 
What is an Operating Systems?
What is an Operating Systems?What is an Operating Systems?
What is an Operating Systems?
JayaKamal
 
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptxParallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Sumalatha A
 
Evolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptxEvolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptx
ssuser000e54
 
os unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systemsos unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systems
ssuser6aef00
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
wisard1
 
Operating System
Operating SystemOperating System
Operating System
Hitesh Mohapatra
 
Unit I OS.pdf
Unit I OS.pdfUnit I OS.pdf
Unit I OS.pdf
UmaYadav45
 
Introduction to Operating Systems.pdf
Introduction to Operating Systems.pdfIntroduction to Operating Systems.pdf
Introduction to Operating Systems.pdf
Harika Pudugosula
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
AJAL A J
 

Similar to Computer system architecture (20)

Operating System BCA 301
Operating System BCA 301Operating System BCA 301
Operating System BCA 301
 
Module 1 Introduction.ppt
Module 1 Introduction.pptModule 1 Introduction.ppt
Module 1 Introduction.ppt
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
 
Ch1 introduction
Ch1   introductionCh1   introduction
Ch1 introduction
 
1_to_10.pdf
1_to_10.pdf1_to_10.pdf
1_to_10.pdf
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
chapter1.ppt
chapter1.pptchapter1.ppt
chapter1.ppt
 
What is an Operating Systems?
What is an Operating Systems?What is an Operating Systems?
What is an Operating Systems?
 
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptxParallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
 
Os1
Os1Os1
Os1
 
Evolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptxEvolution, Strutcture and Operations.pptx
Evolution, Strutcture and Operations.pptx
 
os unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systemsos unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systems
 
MK Sistem Operasi.pdf
MK Sistem Operasi.pdfMK Sistem Operasi.pdf
MK Sistem Operasi.pdf
 
Operating System
Operating SystemOperating System
Operating System
 
Unit I OS.pdf
Unit I OS.pdfUnit I OS.pdf
Unit I OS.pdf
 
Introduction to Operating Systems.pdf
Introduction to Operating Systems.pdfIntroduction to Operating Systems.pdf
Introduction to Operating Systems.pdf
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 

Recently uploaded

TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 

Recently uploaded (20)

TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 

Computer system architecture

  • 3. Computer-System Architecture 1- single general-purpose processor –On a single-processor system, there is one main CPU capable of executing a general- purpose instruction set, including instructions from user processes. –Most systems have special-purpose processors as well
  • 4. Computer-System Architecture 2- Multiprocessors systems : growing in use and importance – Also known as parallel systems, tightly-coupled systems – The system have two or more processors in close communication , sharing the computer bus memory and peripheral devices. – Advantages include 1. Increased throughput 2. Economy of scale 3. Increased reliability – graceful degradation or fault tolerance
  • 5. Computer-System Architecture – Two types 1. Asymmetric Multiprocessing 2. Symmetric Multiprocessing 1- Asymmetric Multiprocessing • In which each processor is assigned a specific task. • A master processor controls the system • Master-slave relation ship 2- Symmetric Multiprocessing • All processors are peers • Many processes can run simultaneous … n processes can run if n CPU
  • 7. Computer-System Architecture - Multi-computing core –Multi processor per chip –Multi chips with single core –Which better? And why? –First –Because on-chip communication is faster than between- chips
  • 9.
  • 10. Clustered Systems 3- Clustered Systems • Like multiprocessor systems, but multiple systems working together • A clustered system uses multiple CPUs to complete a task. • It is different from parallel system in that clustered system consists of two or more individual systems tied together. • Definition : The clustered computers share storage and are closely linked via LAN networking. 10
  • 11. Clustered Systems – Provides a high-availability service which survives failures: A layer of cluster software runs on cluster nodes. Each node can monitor one or more nodes over the LAN. – The monitored machine can fail in some cases. – The monitoring machine can take ownership of its storage. – The monitoring machine can also restart applications that were running on the failed machine- – The failed machine can remain down but the users will see a brief of the service. 11
  • 12. Clustered Systems The clustered system can be of the following forms: • Asymmetric clustering: In this form, one machine is in hot standby mode and other machine is running the application. The hot standby machine performs nothing. It only monitors the server. If faiuler It becomes the active server if the server fails. • Symmetric clustering In this mode, two or more machines run the applications. They also monitor each other at the same time. This mode is more efficient because it uses all available machines. It can be used only if multiple applications are available to be executed • high-performance computing (HPC) • Applications must be written to use parallelization 12
  • 13.
  • 15. Operating System Structure Multiprogramming: • Multiprogramming is a form of parallel processing in which several programs are run at the same time on a uniprocessor. • Since there is only one processor , there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on. • To the user it appears that all programs are executing at the same time 15
  • 16. Memory Layout for Multiprogrammed System 16
  • 17. Operating System Structure • Multiprogramming needed for efficiency – Single user cannot keep CPU and I/O devices busy at all times – Multiprogramming organizes jobs (code and data) so CPU always has one to execute – A subset of total jobs in system is kept in memory – One job selected and run via job scheduling – When it has to wait (for I/O for example), OS switches to another job 17
  • 18. Operating System Structure • Multiprogramming means: that several programs in different stages of execution are coordinated to run on a single I-stream engine (CPU). • Multiprocessing, which is the coordination of the simultaneous execution of several programs running on multiple I-stream engines (CPUs). 18
  • 19. Operating System Structure • Timesharing (multitasking): is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing 19
  • 20. Operating System Structure • Timesharing: – Response time should be < 1 second – Each user has at least one program executing in memory process – If several jobs ready to run at the same time  CPU scheduling – If processes don’t fit in memory, swapping moves them in and out to run – Virtual memory allows execution of processes not completely in memory 20
  • 22. Computer-System Operation • Each device controller is in charge of a particular device type (disk drive, video displays etc). • I/O devices and the CPU can execute concurrently. • Each device controller has a local buffer. • CPU moves data from/to main memory to/from local buffers • I/O is from the device to local buffer of controller. • Device controller informs CPU that it has finished its operation by causing an interrupt.
  • 23. Interrupt • Means : cut off • Hardware interrupt, e.g. services requests of I/O devices • Software interrupt, e.g. signals, invalid memory access, division by zero, system calls, etc –(trap) • Procedures: generic handler or interrupt vector (MS-DOS,UNIX)
  • 24. Operating-System Operations • Interrupts are an important part of a computer architecture. • Each computer design has its own interrupt mechanism, but several functions are common.
  • 25. Operating-System Operations External Interrupts • An external interrupt is a temporal suspension of a process caused by an event external to that process and performed in such a way that the process can be resumed. – I/O – Timer – Hardware failure
  • 26. Operating-System Operations • Interrupt driven by hardware • Software error or request creates exception or trap –Division by zero, request for operating system service • Other process problems include infinite loop, processes modifying each other or the operating system
  • 27. Common Functions of Interrupts • Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt • A trap is a software-generated interrupt caused either by an error or a user request • An operating system is interrupt driven
  • 28. Operating-System Operations Instruction Cycle with Interrupts • CPU checks for interrupts after each instruction. • If no interrupts, then fetch next instruction of current program. • If an interrupt is pending, then suspend execution of the current program. The processor sends an acknowledgement signal to the device that issued the interrupt so that the device can remove its interrupt signal. • Interrupt architecture saves the address of the interrupted instruction (and values of other registers).
  • 29. Operating-System Operations Instruction Cycle with Interrupts • Interrupt transfers control to the interrupt service routine (Interrupt Handler), generally through the interrupt vector, which contains the addresses of all the service routines. • Separate segments of code determine what action should be taken for each type of interrupt
  • 30. Operating-System Operations Interrupt Driven I/O • To start an I/O operation, the CPU loads the appropriate registers within the device controller. • The device controller examines the contents of these registers and determines what action to take and then performs the action. • Device controller informs CPU that it has finished its operation by causing an external interrupt
  • 31. Operating-System Operations • Interrupt Driven I/O • A disk block read example: – For disk reads, the controller reads the block (one or more sectors) from the derive serially, bit by bit, until the entire block is in the controller internal buffer. – It then performs a checksum to verify that no read errors have occurred. – The controller sends an interrupt. When the OS starts running, it can read the disk block from the controller’s buffer a byte or a word at a time by executing a loop, with each iteration reading one byte or word from the controller device register and storing it in the main memory.
  • 32. Operating-System Operations Interrupt Handler • A program that determines nature of the interrupt and performs whatever actions are needed • Control is transferred to this program • Generally part of the operating system
  • 33. Operating-System Operations: Interrupt Handling Procedure • Interrupt Handling Save interrupt information OS determine the interrupt type (by polling) Call the corresponding handlers Return to the interrupted job by the restoring important information (e.g., saved return address program counter)
  • 34. Direct Memory Access (DMA) Structure • Used for high-speed I/O devices able to transmit information at close to memory speeds • Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention • Only one interrupt is generated per block, rather than the one interrupt per byte
  • 35. Direct Memory Access (DMA) Structure • Execute the device driver to set up the registers of the DMA controller. • DMA moves blocks of data between the memory and its own buffers. • Transfer from its buffers to its devices. • Interrupt the CPU when the job is done
  • 36. • Direct Memory Access (DMA) Structure • • Recall that with interrupt driven I/O, the CPU can request data from an I/O controller one byte/word at a time which wastes the CPU time. • DMA is a scheme which allows block of data transfer from the device to the memory without the intervention of the CPU. • After setting up buffers, pointers, and counters for the I/O device by the CPU, the device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention. • Only one interrupt is generated per block, rather than the one interrupt per byte. • The OS can only use DMA if the hardware has a DMA controller.
  • 37. • Direct Memory Access, or DMA, is an absolutely essential part of any modern computing architecture. DMA allows the CPU to offload intensive memory access tasks to other components. This then frees the CPU from these menial chores and provides more cycles to more complex tasks for which it is better suited.
  • 39. Dual-Mode Operation • Dual-mode operation allows OS to protect itself and other system components • Execution of operating-system code and user defined code user mode and kernel
  • 40. Operating-System Operations • Dual-mode operation allows OS to protect itself and other system components – User mode and kernel mode – Mode bit provided by hardware • Provides ability to distinguish when system is running user code or kernel code • Some instructions designated as privileged, only executable in kernel mode • System call changes mode to kernel, return from call resets it to user
  • 41. Operating-System Operations • At system boot time, the hardware starts in kernel mode. • The operating system is then loaded and starts user applications in user mode. • Whenever a trap or interrupt occurs, the hardware switches from user mode to kernel mode.
  • 43. System Calls • System calls : – Interface between processes & OS • Definition: is how a program requests a service from an operating system’s kernel . They provide the interface between a process and operating system. • Is an interface between a user-space application and a service is provided in the kernel. 43
  • 44. System Calls • How to make system calls? – Assemble-language instructions or subroutine/functions calls in high-level language such as C or Perl? • Generation of in-line instructions or a call to a special run-time routine. • Example: read and copy of a file! – Library Calls vs System Calls 44
  • 45. System Calls • Programming interface to the services provided by the OS • Typically written in a high-level language (C or C++) 45
  • 46. System Calls • Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) • Why use APIs rather than system calls? (Note that the system-call names used throughout this text are generic) 46
  • 47. API – System Call – OS Relationship 47
  • 48. System Call Implementation • The system call interface invokes intended system call in OS kernel and returns status of the system call and any return values • The caller need know nothing about how the system call is implemented – Just needs to obey API and understand what OS will do as a result call – Most details of OS interface hidden from programmer by API • Managed by run-time support library (set of functions built into libraries included with compiler) 48
  • 49. Example of Standard API • Consider the ReadFile() function in the • Win32 API—a function for reading from a file • A description of the parameters passed to ReadFile() – HANDLE file—the file to be read – LPVOID buffer—a buffer where the data will be read into and written from – DWORD bytesToRead—the number of bytes to be read into the buffer – LPDWORD bytesRead—the number of bytes read during the last read – LPOVERLAPPED ovl—indicates if overlapped I/O is being used 49
  • 50. Standard C Library Example • C program invoking printf() library call, which calls write() system call 50
  • 51. How System Call in Unix 51
  • 52. System Call Parameter Passing • Three general methods used to pass parameters to the OS – Simplest: pass the parameters in registers • In some cases, may be more parameters than registers – Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register • This approach taken by Linux and Solaris – Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system – Block and stack methods do not limit the number or length of parameters being passed 52
  • 54. Types of System Calls • Process control • File management • Device management • Information maintenance • Communications • Protection 54
  • 55. Examples of Windows and Unix System Calls 55
  • 56. MS-DOS execution (a) At system startup (b) running a program 56
  • 59. System Programs • Provide a convenient environment for program development and execution – Some of them are simply user interfaces to system calls; others are considerably more complex • File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories 59
  • 60. System Programs • Status information – Some ask the system for info - date, time, amount of available memory, disk space, number of users – Others provide detailed performance, logging, and debugging information – Typically, these programs format and print the output to the terminal or other output devices – Some systems implement a registry - used to store and retrieve configuration information 60
  • 61. System Programs (cont’d) • File modification –Text editors to create and modify files –Special commands to search contents of files or perform transformations of the text • Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided 61
  • 62. System Programs (cont’d) • Program loading and execution- Absolute loaders, reloadable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language 62
  • 63. System Programs (cont’d) • Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems –Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another 63
  • 64. User Operating System Interface 64
  • 65. User Operating System Interface - CLI 1- Command Line Interface (CLI) or command interpreter allows direct command entry • Sometimes implemented in kernel, sometimes by systems program • Sometimes multiple flavors implemented – shells 65
  • 66. User Operating System Interface - CLI • Primarily fetches a command from user and executes it –Sometimes commands built-in, sometimes just names of programs »If the latter, adding new features doesn’t require shell modification 66
  • 67. User Operating System Interface - GUI 2- Graphical User Interface (GUI ) – User-friendly desktop metaphor interface – Usually mouse, keyboard, and monitor – Icons represent files, programs, actions, etc – Various mouse buttons over objects in the interface cause various actions (provide information, options, execute function, open directory (known as a folder) – Invented at Xerox PARC 67
  • 68. User Operating System Interface - GUI • Many systems now include both CLI and GUI interfaces – Microsoft Windows is GUI with CLI “command” shell – Apple Mac OS X as “Aqua” GUI interface with UNIX kernel underneath and shells available – Solaris is CLI with optional GUI interfaces (Java Desktop, KDE) 68
  • 69.
  • 71. Simple Structure • Called “no structure” • The operating system is a collection of procedures, each of which call any of the other whenever it requires their needs. 71
  • 72. Simple Structure • MS-DOS – written to provide the most functionality in the least space – Not divided into modules – Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated 72
  • 74. Traditional UNIX System Structure 74
  • 75. Layered Approach • The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. • With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers 75
  • 77. Microkernel System Structure • Philosophy of microkernel is to have the bare essentials in the kernel. • Removing all non-essential components from kernel and implement them in system-and - user level. Program thst results a smaller kernel called microkernal. 77
  • 79. Microkernel System Structure • Moves as much from the kernel into “user” space. • Communication takes place between user modules using message passing. • Benefits: – Easier to extend a microkernel – Easier to port the operating system to new architectures – More reliable (less code is running in kernel mode) – More secure 79