Chapter 2 Computer-System Structure

Similar documents
Module 2: Computer-System Structures. Computer-System Architecture

CS370 Operating Systems

Chapter 1: Introduction. Chapter 1: Introduction

7/20/2008. What Operating Systems Do Computer-System Organization

Chapter 1: Introduction

Instruction Cycle. Computer-System Architecture. Computer-System Operation. Common Functions of Interrupts. Chapter 2: Computer-System Structures

Computer-System Architecture

Computer-System Architecture. Common Functions of Interrupts. Computer-System Operation. Interrupt Handling. Chapter 2: Computer-System Structures

To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Computer-System Structures

CS370 Operating Systems

CPSC 341 OS & Networks. Introduction. Dr. Yingwu Zhu

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Chapter 1: Introduction

CS420: Operating Systems

Chapter 1: Introduction

Operating System Review

CS420: Operating Systems

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Lecture 1 Introduction (Chapter 1 of Textbook)

Chapter 1: Introduction. Operating System Concepts 8th Edition,

European University of Lefke. Instructor: Dr. Arif SARI

Chapter 1: Introduction. Operating System Concepts 8 th Edition,

Operating system Dr. Shroouq J.

DM510 Operating Systems. Jacob Aae Mikkelsen

OPERATING SYSTEMS & Network OVERVIEW. 1: OS & Network Overview

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Computer System Overview

Four Components of a Computer System

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Chapter 1: Introduction. Operating System Concepts 8th Edition,

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

Common Computer-System and OS Structures

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Chapter 1 Computer System Overview

Chapter 17: Distributed Systems (DS)

Input Output (IO) Management

Architectural Support for Operating Systems

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Network Administration

OPERATING SYSTEM. PREPARED BY : DHAVAL R. PATEL Page 1. Q.1 Explain Memory

Computer Science 61C Spring Friedland and Weaver. Input/Output

CSC 553 Operating Systems

CHAPTER 17 - NETWORK AMD DISTRIBUTED SYSTEMS

Operating Systems. V. Input / Output

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

CS3600 SYSTEMS AND NETWORKS

Uniprocessor Computer Architecture Example: Cray T3E

Chapter 2: Computer-System Structures. Hmm this looks like a Computer System?

Architecture and OS. To do. q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure

Data Storage and Query Answering. Data Storage and Disk Structure (2)

Networking for Data Acquisition Systems. Fabrice Le Goff - 14/02/ ISOTDAQ

Introduction to Operating Systems. Chapter Chapter

Introduction to Operating. Chapter Chapter

UNIT 2 Data Center Environment

I/O Systems. Jo, Heeseung

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

Outline. Operating Systems: Devices and I/O p. 1/18

Contents. Introduction to Networking. Preface...i. Introduction... xix

CSE Opera+ng System Principles

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

Chapter 13: I/O Systems

Introduction to Operating Systems. Chapter Chapter

Chapter 1 Computer System Overview

Introduction to Computer Systems and Operating Systems

CS61C Machine Structures Lecture 37 Networks. No Machine is an Island!

CS330: Operating System and Lab. (Spring 2006) I/O Systems

Chapter 5 Input/Output. I/O Devices

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Part I Overview Chapter 1: Introduction

CS450/550 Operating Systems

Basic functions in operating systems

FINAL EXAM REVIEW PLEASE NOTE THE MATERIAL FROM LECTURE #16 at the end. Exam 1 Review Material

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

CSE 380 Computer Operating Systems

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

19: Networking. Networking Hardware. Mark Handley

Operating Systems. Lecture Course in Autumn Term 2015 University of Birmingham. Eike Ritter. September 22, 2015

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Course Details. Operating Systems with C/C++ Course Details. What is an Operating System?

MICROPROCESSOR MEMORY ORGANIZATION

Contents. Memory System Overview Cache Memory. Internal Memory. Virtual Memory. Memory Hierarchy. Registers In CPU Internal or Main memory

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

Module 16: Distributed System Structures

Syllabus for Computer Science General Part I

COS 140: Foundations of Computer Science

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Four Components of a Computer System. Operating System Concepts 7 th Edition, Jan 12, 2005

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

Computer Hardware and System Software Concepts

Chapter 7: Mass-storage structure & I/O systems. Operating System Concepts 8 th Edition,

Transcription:

Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual Memory 11. File Systems Chapter 2 Computer-System Structure

Computer-System Structure Objective: General knowledge of the structure of a computer system. CPU printer printer controller tape-drive controller tape drivers memory controller disk controller memory disks Device controllers: synchronize and manage access to devices. Booting Bootstrap program: Initialize all aspects of the system, e.g., CPU registers, device controllers, memory, etc. Load and run the OS Operating system: run init to initialize system processes, e.g., various daemons, login processes, after the kernel has been bootstrapped. (/etc/rc* & init or /sbin/rc* & init)

Interrupt 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) process execution interrupt handler return Procedures: generic handler or interrupt vector (MS-DOS,UNIX) Interrupt Handling Procedure interrupted process fixed address per interrupt type system stack handler interrupted address, registers... Saving of the address of the interrupted instruction: fixed locations or stacks Interrupt disabling or enabling issues: lost interrupt?! prioritized interrupts masking

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 addr. program counter) indexed by a unique device number Interrupt Vector 0 1 n --- --- --- --- --- --- --- --- --- Interrupt Handlers (Interrupt Service Routines) I/O Structure The device drivers are responsible of moving data between the peripheral devices and their local buffer storages. CPU printer printer controller registers buffers tape-drive controller tape drivers memory controller memory DMA registers buffers disk

I/O Structure I/O operation a. CPU sets up specific controller registers within the controller. b. Read: devices controller buffers memory Write: memory controller buffers devices c. Notify the completion of the operation by triggering an interrupt I/O Types a. Synchronous I/O Issues: overlapping of computations and IO activities, concurrent I/O activities, etc. I/O system call wait till the completion or wait instruction (idle till interrupted) looping or polling wait for an interrupt Loop: jmp Loop

I/O types b. Asynchronous I/O wait till the completion *efficiency sync wait mechanisms!! I/O Types user Requesting process wait Device driver user Requesting process Device driver Kernel Interrupt handler Kernel Interrupt handler Hardware data transfer Hardware data transfer Time Synchronous I/O Time Asynchronous I/O

I/O Types A Device-Status Table Approach card reader 1 status: idle line printer 3 status: busy disk unit 3 status: idle... Tracking of many I/O requests type-ahead service Request addr. 38596 len?1372 Request file:xx Record Addr. len Request file:yy Record Addr. len process 1 process 2 DMA Goal: Release CPU from handling excessive interrupts! E.g. 9600-baud terminal 2-microsecond service / 1000 microseconds High-speed device: 2-microsecond service / 4 microseconds Procedure 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.

Storage Structure CPU HW-Managed Primary Storage volatile storage SW-Managed Secondary Storage nonvolatile storage registers cache memory Magnetic Disks Access time: a cycle Access time: several cycles Access time: many cycles Tertiary Storage removable media CD-ROMs/DVDs Jukeboxes * Differences: Size, Cost, Speed, Volatility Memory Memory R1 R2 R3... Device Controller Processor can have direct access! Intermediate storage for data in the registers of device controllers Memory-Mapped I/O (PC & Mac) (1) Frequently used devices (2) Devices must be fast, such as video controller, or special I/O instructions is used to move data between memory & device controller registers Programmed I/O polling or interrupt-driven handling

track Magnetic disks sector cylinder platter spindle r/w head arm assembly disk arm Transfer Rate Random- Access Time Seek time in x ms Rotational latency in y ms 60~200 times/sec Magnetic Disks Disks Fixed-head disks: More r/w heads v.s. fast track switching Moving-head disks (hard disk) Primary concerns: Cost, Size, Speed Computer host controller disk controller disk drives (cache disks) Floppy disk slow rotation, low capacity, low density, but less expensive Tapes: backup or data transfer bet machines

Storage Hierarchy Speed Volatile Storage Cost register Cache Main Memory Electronic Disk Magnetic Disk High hitting rate instruction & data cache combined cache Faster than magnetic disk nonvolatile?! Alias: RAM Disks Optical Disk Magnetic Tape Sequential Access XX GB/350F Storage Hierarchy Caching Information is copied to a faster storage system on a temporary basis Assumption: Data will be used again soon. Programmable registers, instr. Cache, etc. Cache Management Cache Size and the Replacement Policy Movement of Information Between Hierarchy Hardware Design & Controlling Operating Systems

Storage Hierarchy Coherency and Consistency Among several storage levels (vertical) Multitasking vs unitasking Among units of the same storage level, (horizontal), e.g. cache coherency Multiprocessor or distributed systems CPU Cache CPU cache Memory Memory Hardware Protection Goal: Prevent errors and misuse! E.g., input errors of a program in a simple batch operating system E.g., the modifications of data and code segments of another process or OS Dual-Mode Operations a mode bit User-mode executions except those after a trap or an interrupt occurs. Monitor-mode (system mode, privileged mode, supervisor mode) Privileged instruction:machine instructions that may cause harm

Hardware Protection System Calls trap to OS for executing privileged instructions. Resources to protect I/O devices, Memory, CPU I/O Protection (I/O devices are scare resources!) I/O instructions are privileged. User programs must issue I/O through OS User programs can never gain control over the computer in the system mode. Hardware Protection kernel job1 job2 Memory Protection Goal: Prevent a user program from modifying the code or data structures of either the OS or other users! Instructions to modify the memory space for a process are privileged. Base register Limit register Check for every memory address by hardware

Hardware Protection CPU Protection Goal Prevent user programs from sucking up CPU power! Use a timer to implement time-sharing or to compute the current time. Instructions that modify timers are privileged. Computer control is turned over to OS for every time-slice of time! Terms: time-sharing, context switch Network Structure Local-Area Network (LAN) Characteristics: Geographically distributed in a small area, e.g., an office with different computers and peripheral devices. More reliable and better speed High-quality cables, e.g., twisted pair cables for 10BaseT Ethernet or fiber optic cables for 100BaseT Ethernet Started in 1970s Configurations: multiaccess bus, ring, star networks (with gateways)

Network Structure Wide-Area Network (WAN) Emerged in late 1960s (Arpanet in 1968) World Wide Web (WWW) Utilize TCP/IP over ARPANET/Internet. Definition of Intranet : roughly speaking for any network under one authorization, e.g., a company or a school. Often in a Local Area Network (LAN), or connected LAN s. Having one (or several) gateway with the outside world. In general, it has a higher bandwidth because of a LAN. Network Structure WAN HINET TARNET gateway Intranet Intranet A Intranet A Intranet gateway Intranet router

Network Structure WAN Router With a Routing table Use some routing protocol, e.g., to maintain network topology by broadcasting. Connecting several subnets (of the same IP-orhigher-layer protocols) for forwarding packets to proper subnets. Gateway Functionality containing that of routers. Connecting several subnets (of different or the same networks, e.g., Bitnet and Internet)for forwarding packets to proper subnets. Network Structure WAN Connections between networks T1: 1.544 mbps, T3: 45mbps (28T1) Telephone-system services over T1 Modems Conversion of the analog signal and digital signal

Network Layers in Linux applications BSD sockets Applications Kernel INET sockets TCP UDP Network Layer Internet Protocol (IP) ARP PPP SLIP Ethernet TCP/IP IP Address: 140.123.101.1 256*256*256*256 combinations 140.123 -> Network Address 101.1 -> Host Address Subnet: 140.123.101 and 140.123.102 Mapping of IP addresses and host names Static assignments: /etc/hosts Dynamic acquisition: DNS (Domain Name Server) /etc/resolv.confg If /etc/hosts is out-of-date, re-check it up with DNS! Domain name: cs.ccu.edu.tw as a domain name for 140.123.100, 140.123. 101, and 140.123.103

TCP/IP Transmission Control Protocol (TCP) Reliable point-to-point packet transmissions. Applications which communicate over TCP/IP with each another must provide IP addresses and port numbers. /etc/services Port# 80 for a web server. User Datagram Protocol (UDP) Unreliable point-to-point services. Both are over IP. TCP/IP Mapping of Ethernet physical addresses and IP addresses Each Ethernet card has a built-in Ethernet physical address, e.g., 08-01-2b-00-50-A6. Ethernet cards only recognize frames with their physical addresses. Linux uses ARP (Address Resolution Protocol) to know and maintain the mapping. Broadcast requests over Ethernet for IP address resolution over ARP. Machines with the indicated IP addresses reply with their Ethernet physical addresses.

TCP/IP A TCP packet TCP header + Data An IP packet IP header Data An Ethernet frame Ethernet header Data Each IP packet has an indicator of which protocol used, e.g., TCP or UDP