OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
OS Spring’03 Introduction Operating Systems Spring 2003.
Abhinav Kamra Computer Science, Columbia University 2.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 2: Computer-System Structures.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Computer-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures 1/31/03 Computer System Operation I/O Structure.
A. Frank - P. Weisberg Operating Systems Functional View of Operating System.
1/21/2010CSCI 315 Operating Systems Design1 Computer System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Chapter 2: Computer-System Structures
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Operating System Concepts Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
2.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 2: Computer-System Structures Computer System Operation I/O Structure.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 2: Computer-System Structures Computer System Operation I/O Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: Computer-System Structures
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2 Computer-System Structures n Computer System Operation n I/O Structure.
1 CSE Department MAITSandeep Tayal Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
2: Computer-System Structures
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Chapter 2: Computer-System Structures 2.1 Computer System Operation 2.5 Hardware Protection 2.6 Network Structure.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 4 Computer Systems Review.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Review of Computer System Organization. Computer Startup For a computer to start running when it is first powered up, it needs to execute an initial program.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CS4315A. Berrached:CMS:UHD1 Operating Systems and Computer Organization Chapter 4.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 2: Computer-System Structures(Hardware) or Architecture or Organization Computer System Operation I/O Structure Storage Structure Storage Hierarchy.
Chapter 2. Computer-System Structure Device controllers: synchronize and manage access to devices.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
CSCE451/851 Introduction to Operating Systems
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Computer-System Architecture
Module 2: Computer-System Structures
Architectural Support for OS
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
Module 2: Computer-System Structures
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Architectural Support for OS
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Presentation transcript:

OSes: 2. Structs 1 Operating Systems v Objective –to give a (selective) overview of computer system architectures Certificate Program in Software Development CSE-TC and CSIM, AIT September -- November, Computer-System Structures (Ch. 2, S&G)

OSes: 2. Structs 2 Contents 1.A Modern Computer System 2.Interrupts 3.I/O 4.Caching 5.Protection

OSes: 2. Structs 3 1. A Modern Computer System Fig 2.1, p.24 CPU disk controller printer controller tape-drive controller memory controller memory Line Printer system bus continued I/O controller

OSes: 2. Structs 4 v CPU and device controllers (drivers) can execute concurrently. v Access to shared memory must be controlled. v A hard-wired bootstrap program loads and starts the OS kernel.

OSes: 2. Structs 5 2. Interrupts v Modern OSes are driven by interrupts (traps) sent when events occur in hardware or software. v Types of events: –completion of I/O, division by 0, system calls, etc. continued

OSes: 2. Structs 6 v An interrupt causes the OS to stop its current task, and switch execution to an interrupt-processing routine. v At the end of the routine, the old task is resumed –the old task’s details must be stored during the interrupt processing continued

OSes: 2. Structs 7 v The addresses of the interrupt routines are stored in a fixed segment of memory (an interrupt vector). v The OS selects a routine from the interrupt vector based on the ‘type’ of the interrupt it received. continued

OSes: 2. Structs 8 v Features of interrupts: –disabling of other interrupts during interrupt processing –prioritisation

OSes: 2. Structs 9 System Calls v System calls are implemented using interrupts. Fig 2.9, p.44 : system call n : case n : read : user program resident monitor return 3 trap to monitor 1 perform I/O 2

OSes: 2. Structs I/O v Synchronous I/O –the user process waits during I/O processing v Asynchronous I/O –control returns to the user without waiting for the I/O to complete

OSes: 2. Structs 11 I/O Forms Fig. 2.3, p.27 requesting process device driver interrupt handler hardware data transfer user kernel time Synchronous requesting process device driver interrupt handler hardware data transfer user kernel time Asynchronous

OSes: 2. Structs Synchronous I/O v Waiting is done either with: –a special wait instruction –a busy-wait loop, such as: loop: jmp loop v A busy-wait generates instruction fetches, and so may lead to contention with the I/O. v Only one I/O process involved.

OSes: 2. Structs Asynchronous I/O v Big advantage: the CPU is not affected while slow I/O is carried out. v Many I/O requests can be in action at once –the implementation requires an I/O device status table

OSes: 2. Structs 14 I/O Device Status Table Fig 2.4, p.28 dev: card reader 1 status: idle dev: line printer 3 status: busy dev: disk unit 1 status: idle dev: disk unit 2 status: idle dev: disk unit 3 status: busy : file: xxx op: read addr: length: 2000 file: yyy op: write addr: 6543 length: 500 PID: 3445 addr: length: 1345

OSes: 2. Structs Direct Memory Access (DMA) v Device controllers transfer data blocks to/from memory directly, bypassing the CPU –only one interrupt generated per block –much faster than interrupt driven character transfer

OSes: 2. Structs Memory Mapped I/O v I/O device registers is mapped to memory so that reads/writes to those memory addresses go straight to the device –used for fast and frequently used device –e.g. video controller, serial port

OSes: 2. Structs Caching v The cache is fast memory between the CPU and main memory –the CPU looks in the cache first for data –new data taken from main memory is also placed in the cache for quick access next time v Instruction caching v Cache management –can affect performance drastically

OSes: 2. Structs 18 Cache Coherency v Must ensure that the data in the cache is always the same as its original version in main memory. v Complicated by multiprocessor and distributed environments –several caches, replicated memory

OSes: 2. Structs Protection v 5.1. Dual-mode Operation v 5.2. Memory Protection v 5.3. CPU Protection

OSes: 2. Structs Dual-mode Operation v User mode v Monitor mode –supervisor mode, root, superuser, system mode, priveleged mode v Implemented in hardware v OS always runs in monitor mode

OSes: 2. Structs Memory Protection v The interrupt vector must be protected from modification by users. v The interrupt processing routines must be similarily protected.

OSes: 2. Structs 22 Partitioning Memory Fig 2.7, p.40 monitor job 1 job 2 job3 job base register limit register

OSes: 2. Structs 23 v Only addresses within the job’s memory space are accessible. CPU >=< basebase + limit trap to OS monitor -- addressing error memory address yes no Fig 2.8, p.41

OSes: 2. Structs CPU Protection v Each process is interrupted after a fixed time –this breaks infinite loops in poor code which would otherwise hog the CPU –allows the OS to time-slice users by context switching