The Hardware Interface

Slides:



Advertisements
Similar presentations
1 (Review of Prerequisite Material). Processes are an abstraction of the operation of computers. So, to understand operating systems, one must have a.
Advertisements

Computer System Overview
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Operating System and Computer Organization Background CS 502 Spring 99 WPI MetroWest/Southboro Campus.
OS Spring’03 Introduction Operating Systems Spring 2003.
Computer System Organization S H Srinivasan
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
TCSS 372A Computer Architecture. Getting Started Get acquainted (take pictures) Review Web Page (
TCSS 372A Computer Architecture. Getting Started Get acquainted (take pictures) Purpose, scope, and expectations of the course Expectations & strategy.
hardware and operating systems basics.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
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.
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 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
Chapter 5 - Implementing Processes Process is the most fundamental object Process is a program executing in a virtual computer Process represented in the.
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.
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.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
Lecture 1: Review of Computer Organization
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Structure and Role of a Processor
CSCE451/851 Introduction to Operating Systems
WORKING OF SCHEDULER IN OS
Introduction to Operating Systems Concepts
Introduction to Operating Systems
Interrupts and exceptions
Chapter 2: Computer-System Structures
Process concept.
Microprocessor Systems Design I
MIPS I/O and Interrupt.
Structure of Processes
Anton Burtsev February, 2017
Protection of System Resources
Interrupts In 8085 and 8086.
Day 08 Processes.
Day 09 Processes.
Input/Output.
CS 3305 System Calls Lecture 7.
Introduction of microprocessor
Von Neumann model - Memory
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems
Implementing Processes
MIPS I/O and Interrupt.
The Client-Server Model
Computer System Overview
Computer-System Architecture
Module 2: Computer-System Structures
Direct Memory Access Disk and Network transfers: awkward timing:
Architectural Support for OS
Von Neumann model - Memory
Interrupts and Exception Handling
Module 2: Computer-System Structures
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
MIPS I/O and Interrupt.
Computer System Structures
Computer System Overview
Architectural Support for OS
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Interrupts and Exception Handling
Presentation transcript:

The Hardware Interface Chapter 2 11/8/2018 Crowley OS Chap. 2

Key concepts in chapter 2 General and special-purpose registers Processor modes: user and system Memory addressing physical (or absolute) addresses and address space logical addresses and address space I/O address space Interrupts I/O devices and memory-mapped I/O 11/8/2018 Crowley OS Chap. 2

CRA-1 organization 11/8/2018 Crowley OS Chap. 2

General-purpose registers 32 general registers, each 32 bits long r0: always 0 r1: return values of functions r8, r9, r10, r11: function parameters r29: frame pointer r30: stack pointer r31: return address for function call instruction 11/8/2018 Crowley OS Chap. 2

Special-purpose registers ia: address of the next instruction to execute psw: program status word, processor state base: memory-mapping base register bound: memory-mapping bound register iia: saves ia during an interrupt ipsw: saves psw during an interrupt ip: saves interrupt-specific data iva: address of the interrupt vector area timer: interval timer 11/8/2018 Crowley OS Chap. 2

Processor modes psw bit 0: 1 if system mode, 0 if user mode User mode a user program is running certain instructions are not allowed memory mapping (base and bound) is enabled System mode the operating system is running all instructions are allowed memory mapping (base and bound) is disabled 11/8/2018 Crowley OS Chap. 2

Instruction set of the CRA-1 Load and store register (including control registers when in system mode) Load and store all register (for saving state) Move register to register System call Return from interrupt Plus many others not relevant here 11/8/2018 Crowley OS Chap. 2

CRA-1 memory and addressing 32-bit physical (a.k.a. absolute) addresses 8-bit bytes physical address space: 0 to 0xFFFFFFFF memory address space: 0 to 0xEFFFFFFF I/O address space: 0xF0000000-0xFFFFFFFF 32-bit logical addresses mapped by base and bound registers defines a logical address space 11/8/2018 Crowley OS Chap. 2

Interrupts System call: program executed a syscall Timer: timer register went from 1 to 0 a non-zero timer counts down every microsecond Disk: a disk operation completed Program error ip=0: undefined instruction ip=1: illegal instruction in user mode ip=2: logical address >= bound register 11/8/2018 Crowley OS Chap. 2

Interrupt processing Steps in handling an interrupt psw saved in ipsw, psw set to 0 interrupt parameter (if any) placed in ip register ia saved in iia new is taken from interrupt vector area (offset depends on which interrupt it is) timer and disk interrupt can be masked (recorded but delayed) by setting psw bit 0 11/8/2018 Crowley OS Chap. 2

CRA-1 I/O devices Memory-mapped I/O Disk controller and disk device registers are in the physical address space Disk controller and disk 4 Kbyte disk blocks 20 bit disk block numbers 11/8/2018 Crowley OS Chap. 2

Disk controller information const int BlockSize = 4096; enum disk_command {LoadBlock=0, StoreBlock=1}; struct disk_control_reg { unsigned int command : 1; unsigned int interrupt_enabled : 1; unsigned int disk_block : 20; unsigned int padding : 10; }; volatile disk_control_reg *Disk_control = (disk_control_reg *)0xF0000000; void **Disk_memory_addr = (void **)0xF0000004; enum disk_status { DiskIdle=0, DiskBusy=1 }; struct disk_status_reg { unsigned int busy : 1; unsigned int padding : 31; }; disk_status_reg *Disk_status = (disk_status_reg *)0xF0000008; 11/8/2018 Crowley OS Chap. 2

Simple OS code and simulators CRA-1 Simple OS code in the book, but there is no simulator MIPS Simple OS code in distribution, runs on UNIX systems a number of changes in the low-level code that interfaces to the hardware Java Simple OS code in distribution, runs on Java 1.1 systems and Java 1.1 browsers 11/8/2018 Crowley OS Chap. 2

MIPS Hardware Interface TBD 11/8/2018 Crowley OS Chap. 2

Java Hardware Interface TBD 11/8/2018 Crowley OS Chap. 2