Operating System and Computer Organization Background CS 502 Spring 99 WPI MetroWest/Southboro Campus.

Slides:



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

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.
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
1 Computer System Overview OS-1 Course AA
1/26/2004CSCI 315 Operating Systems Design1 Operating System Structures Notice: The slides for this lecture have been largely based on those accompanying.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
Common System Components
Silberschatz, Galvin and Gagne  Operating System Concepts Common System Components Process Management Main Memory Management File Management.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Abhinav Kamra Computer Science, Columbia University 3.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 3: Operating-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.
CHAPTER 2 OPERATING SYSTEM OVERVIEW 1. Operating System Operating System Definition A program that controls the execution of application programs and.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
UNIX and Shell Programming (06CS36)
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
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.
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
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.
1 Chapter 2: Computer-System Structures  Computer System Operation  I/O Structure  Storage Structure  Storage Hierarchy  Hardware Protection  General.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz and Galvin  Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services System Calls.
Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection Network Structure.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
1 CSE Department MAITSandeep Tayal Operating-System Structures System Components Operating System Services System Calls System Programs System Structure.
UNIX and Shell Programming
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 3 Operating-System Structures Slide 1 Chapter 3 Operating-System Structures.
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.
BIT213,CISY Operating Systems 1
Lecture 1: Review of Computer Organization
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.
Chapter 2: Computer-System Structures(Hardware) or Architecture or Organization Computer System Operation I/O Structure Storage Structure Storage Hierarchy.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
System Components Operating System Services System Calls.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Module 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Module 3: Operating-System Structures
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.
Chapter 3: Operating-System Structures
Computer-System Architecture
Module 2: Computer-System Structures
Architectural Support for OS
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Module 2: Computer-System Structures
Architectural Support for OS
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 2: Operating-System Structures
Module 2: Computer-System Structures
Presentation transcript:

Operating System and Computer Organization Background CS 502 Spring 99 WPI MetroWest/Southboro Campus

1 Operating System Components Process Management Memory Management Persistent Storage Management File Management I/O System Management Distributed Systems and Networks Interface to the User –Shells –Graphical User Interface

2 Process Management A process is a program in execution. It is equivalent to a Virtual Computer. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. The operating system is responsible for the following activities in connection with process management: –Process creation and deletion –Process suspension and resumption –Provision of mechanisms for Process synchronization Process communication

3 Memory Management Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses is contents in the case of a system failure. The operating system is responsible for the following activities in connection with memory management: –Keep track of which parts of memory are currently being used and by whom. –Decide which process to load when memory space becomes available. –Allocate and deallocate memory space as needed.

4 Persistent Storage Management Since main memory is volatile and too small to accommodate all data and programs permanently, the computer system must provide persistent storage to back up main memory. Disks are the principle on-line storage medium. The operating system is responsible for the following activities in conjunction with disk management: –Free-space management –Storage allocation –Disk scheduling

5 File Management A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. The operating system is responsible for the following activities in connection with file management: –File creation and deletion –Directory creation and deletion –Support of primitives for manipulating files and directories –Mapping files onto persistent storage –File backup on off-line media

6 I/O System Management The I/O system consists of: –A buffer caching system –A general device-driver interface –Drivers for specific hardware devices

7 Distributed Systems and Networks A distributed system is a collection of processors that do not share memory or a clock. Each processor has its own local memory. The processors in the system are connected through a communication network. A distributed system provides user access to various system resources. Access to a shared resource allows” –Computation speed-up –Potential for increased data availability –Potential for enhanced reliability

8 User Interface A command shell or a window-based GUI provide the ability to executed application programs and convenient access to invoking systems programs. These allow for: –Process creation and management. –I/O handling, monitoring, and management –Secondary storage management –Main memory monitoring and management –File-system access –Protection –Networking –Accounting –Programming Language support

9 OS Components Common Requirements Concurrency Resource Management Protection Exceptions Asynchronous Operation and I/O Scheduling Synchronization

10 OS Motivated Architectural Features

11 Computer System Architecture CPU Cache Physical Address System Bus Virtual Address TLB/MMU Processor Memory Controller Memory Disk Controller Network Controller Printer Controller Printer Network Medium Disk

12 Computer System Operation I/O Devices and the CPU can execute concurrently. Each device controller is in charge of a particular device type. Each device controller has a local buffer. CPU moves data from/to main memory to/from the local buffers. I/O is from the device to the local buffer of the controller. Device controller informs CPU that it has finished an operation or needs attention by causing an interrupt.

13 Central Processing Unit Processor Registers –User-visible registers Data Registers Address Registers –Control and Status registers IA: Instruction Address IR: Instruction Register PSW: Program Status Word Instruction Execution Start Fetch Next Instruction Execute Instruction Halt Fetch Cycle Execute Cycle

14 Processor (cont.) Instruction Classes –Non-privileged Processor-memory Data Processing –Arithmetic –Shift Operations Flow control –Branch –Subroutine linkage –Privileged Processor-I/O Control

15 Architectural Features Kernel/User Mode Protected Instructions Address Translation Exception and Trap Vectors Interrupts Communication with I/O Controllers Timer Atomic Instructions

16 Dual Mode Architecture To protect the system from aberrant users, some instructions are restricted to use only by the operating system. Users (I.e. in user mode) may not: –Address I/O directly –Use instructions that manipulate the state of memory (page table pointers, TLB load, etc.) –Set the mode bits that determine user or kernel mode –Halt the machine In kernel mode, the OS can do all these things.

17 Dual Mode (Cont.) Mode bit added to computer hardware to indicate the current mode: kernel (0) or user (1) When an interruption occurs (exception or interrupt), hardware switches to kernel mode. Further discussion of crossing protection boundaries is deferred until after the discussion on interruptions. Kernel ModeUser Mode interruption set user mode

18 Address Translation –When executing in kernel mode, the operating system has unrestricted access to both the OS memory and the users’ memory –The load instructions for the base and limit registers must be privileged instructions CPU basebase + limit >= < Memory address yes no Trap to operating system with an address exception

19 The Memory Hierarchy –As one goes down the memory hierarchy, the following occur: Decreasing cost per bit Increasing capacity Increasing access time Decreasing frequency of access of the memory by the processor Registers Cache Main Memory Disk Cache Magnetic Disk Removable Media

20 Interruptions Interruption – an event in a computer system disrupting the normal instruction execution flow. Interruption Classes –Program, called Exception or Trap Synchronous with the instruction stream Arithmetic overflow, divide by zero, illegal instruction, illegal memory reference, etc. –Timer, called Interrupt Asynchronous Interval timer –I/O, called Interrupt Asynchronous I/O normal completion or error condition (abnormal completion) –Hardware Failure

21 Program Flow

22 Instruction Control Flow and Instruction Cycle with Interrupts 1 2 i i+1 M User Program Interrupt Handler

23 Simple Interrupt Processing

24 Interrupt Example

25 Multiple Interrupts Two approaches –Disable interrupts while an interrupt is being processed. –Sequential interrupt processing

26 Nested Interrupts –Define priorities for interrupts and allow an interrupt of higher priority to cause a lower priority interrupt handler to be interrupted.

27 Nested Interrupt Example –Assume a printer, a disk, and a comm line, with priorities of 2, 4, and 5 respectively. (Bigger number is more important).

28 I/O Communication Two techniques for interface: –I/O Instructions –“Memory-mapped I/O” Three techniques for controlling the operation of the I/O from the CPU: –Programmed I/O I/O instruction categories –Control –Test –Read, write –Interrupt-driven I/O –Direct memory access (DMA)

29 Block Input Example

30 CPU Protection – The Interval Timer Interval Timer – interrupts computer after specified period to ensure operating system maintains control. –Timer is decremented on every clock tick –When timer reaches the value 0, an interrupt occurs Timer is commonly used to implement time sharing Timer is also used to compute the current time. Load timer must be a privileged instruction.

31 A Hypothetical HW Interface Consider a hypothetical system consisting of: –A CPU with an interval timer –Memory –A Disk Controller

32 General-Purpose Registers r0: always loads 0, store is a no-op r1: return value from procedures r8: first parameter to a function call (or system call) r9 to r11: second, third, and fourth parameters to a function call (or system call) r29: the frame pointer r30: the stack pointer r31: the return address from a procedure call

33 Control Registers –ia: the instruction address register contains the address of the next instruction –psw: the program status word. Bit 0 is processor mode, Bit 1 is interrupt enable –base: the memory base register is added to all addresses when the system is in user mode –bound: the memory bound register is the address limit (user mode). –iia: the interrupt instruction address register stores the value of the ia register before an exception. –ipsw: the interrupt program status word –ip: the interrupt parameter –iva: the interrupt vector address register –timer: the interval timer register

34 Instruction Set load store loadAll storeAll move syscall rti

35 Interrupt Example

36 System Call Example