Interruptverarbeitung in Betriebssystemen

Total Page:16

File Type:pdf, Size:1020Kb

Interruptverarbeitung in Betriebssystemen Interruptverarbeitung in Betriebssystemen Sommersemester 2015 Prof. Dr. Peter Mandl Prof. Dr. Peter Mandl Seite 1 Gesamtüberblick 1. Einführung in Computersysteme 2. Entwicklung von Betriebssystemen 3. Architekturansätze 4. Interruptverarbeitung in Betriebssystemen 5. Prozesse und Threads 6. CPU-Scheduling 7. Synchronisation und Kommunikation Interruptklassen 8. Speicherverwaltung 9. Geräte- und Dateiverwaltung Asynchrone Interrupts Synchrone Interrupts (nicht vorhersehbar und auch (vorhersehbar und auch 10. Betriebssystemvirtualisierung nicht reproduzierbar) reproduzierbar) Exceptions Systemcalls (Software-Interrupts) Unterbrechung vor der Ausführung, Faults z. B. Page Fault = Seitenfehler Unterbrechung vor der Ausführung, Traps z. B. Division durch 0 Prof. Dr. Peter Mandl Seite 2 Zielsetzung . Konzepte und Abläufe der Interruptverarbeitung in Betriebssystemen kennenlernen und verstehen . Unterscheidung der verschiedenen Interrupt- Klassen vornehmen können . Ablauf eines asynchronen Interrupts erläutern können . Ablauf eines (synchronen) Systemcalls erläutern können Prof. Dr. Peter Mandl Seite 3 Überblick 1. Begriffe und Klassifizierung 2. Zusammenspiel der Komponenten 3. Systemdienste und Systemcalls Prof. Dr. Peter Mandl Seite 4 Polling Polling => Busy Waiting (aktives Warten) Gerät 1 while() { Ready-Bit for (alle Geräte) { if (Gerät[i].Ready-Bit == 1 ) { CPU Gerät 2 doAction(); Ready-Bit } … } } Gerät n Ready-Bit = 1 bedeutet, Gerät ist bereit, es sind Ready-Bit z.B. Daten abzuholen Prof. Dr. Peter Mandl Seite 5 Interrupt Interrupt = Unterbrechung = Trap Abgrenzung zu Polling - Kein aktives Abfragen von Ereignisquellen Gründe für Interrupts: - Betriebssystembedingungen - Asynchrone Ereignisse Verursacher: Hardware oder Software Abschaltung (Maskierung) von Interrupts ist möglich, sollte aber für sehr kurze Zeit sein Manchmal unbedingt erforderlich (siehe später Interrupt Service Routinen) Prof. Dr. Peter Mandl Seite 6 Synchron und asynchron Synchrone Interrupts: Von der CPU ausgelöste Ausnahmen (für das laufende Programm gedacht) - Division durch 0 - Speicherzugriffsverletzung Asynchrone Interrupts: Treten unabhängig davon auf, was das System gerade ausführt - Netzwerkadapter meldet ankommende Nachricht - Plattenspeicher meldet Zustellung eines Blocks Prof. Dr. Peter Mandl Seite 7 Interrupt-Klassifizierung Interruptklassen Asynchrone Interrupts Synchrone Interrupts (nicht vorhersehbar und auch (vorhersehbar und auch nicht reproduzierbar) reproduzierbar) Systemcalls Exceptions (auch als Traps oder Software- Interrupts bezeichnet) Faults Unterbrechung vor der Ausführung, z.B. Page Fault = Seitenfehler Unterbrechung nach der Ausführung, Traps z.B. Division durch 0 Prof. Dr. Peter Mandl Seite 8 Überblick 1. Begriffe und Klassifizierung 2. Zusammenspiel der Komponenten 3. Systemdienste und Systemcalls Prof. Dr. Peter Mandl Seite 9 Interrupt-Bearbeitung: Zusammenspiel Interrupts führen dazu, dass Code außerhalb des normalen Programmflusses ausgeführt wird Steuerung wird an eine definierte Position im Kernel übergeben Interrupt-Service- Routine (ISR) 1: Gerät ist fertig Interrupt Festplatte 2: Interrupt Controller Clock CPU 3: CPU-Handling Tastatur Drucker Bus Prof. Dr. Peter Mandl Seite 10 Interrupt-Bearbeitung: Befehlszyklus Prüfung, ob Interrupt anliegt, ist Teil des Befehlszyklus Prüfung am Ende eines Maschinenbefehls Fetch (Befehl aus Speicher holen) Execute (Befehl ausführen) Prüfung, ob Interrupt vorliegt Bei Multiprozessoren bzw. Mehrkernprozessoren: nein IRQ ja Dispatching eines Prozessors/Kerns Programmzähler notwendig, um anstehenden Interrupt auf Startadresse der ISR setzen zu bearbeiten Prof. Dr. Peter Mandl Seite 11 Interrupt-Vektor-Tabelle und Adressierung Interrupt Request (IRQ) wird vom Gerät gesendet und identifiziert das Gerät Abbildung IRQ Int-Nr durch Hardware in einem Interrupt Controller Int-Nr ist der Index für die Interrupt-Vektor-Tabelle (IVT) Die IVT wird über die CPU adressiert IVT-Aufbau durch Prozessor vorgegeben: Bei Intel 256 IVT-Einträge für Exceptions, Systemcalls (Traps) und Geräteinterrupts IVT IRQInt-Nr 0 Interruptvektor 1 Interruptvektor SVR 0 2 3 SVR 1 … Prof. Dr. Peter Mandl Seite 12 Interrupt-Service-Routine (ISR) Interrupt Anwendungsprogramm 1: Interrupt Usermodus Controller 2: Ack Verteiler (Interrupt-Bearbeitung) 3: 4: Interrupt-Vektor- 5: - E/A-Geräte benachrichtigen die Tabelle CPU, wenn sie einen Dienst Kernelmodus 01 ISR1 02 benötigen 03 ISR2 ISR3 - Dadurch kann die CPU maximal n ausgenutzt werden, da sie parallel zur Ein-/Ausgabe etwas anderes ISRn machen kann Adressraum ISR = Interrupt Service Routine Prof. Dr. Peter Mandl Seite 13 Interrupt-Bearbeitung: Ablauf Beliebiges ISR Programm Normale Programmbearbeitung Zeitpunkt des Interrupt Laufender Maschinenbefehl wird noch zu Ende geführt. Registersatz wird auf den Stack gerettet. Adressierung über Interrupt- Vektortabelle Niedriger priorisierte Inter- rupts werden deaktiviert. ... Alten Zustand wieder- Rückkehr Normale Programmbearbeitung herstellen (Register,...). fortsetzen Prof. Dr. Peter Mandl Seite 14 Beispiel: Intel 8259A-Controller Intel 8259A PIC = Programmable Controller = Multiplexer für Hardware-Interrupts - Ein integrierter Schaltkreis zur Verwaltung mehrerer Hardware- Interrupts - Aufgabe: Überwacht Interrupt-Leitungen (IRQ), speichert sie und gibt sie an die CPUs weiter - 8 Interrupt-Eingänge: Eingang 0 hat höchste Priorität - Seit IBM PC XT eingesetzt - Oft wurden zwei PICs in einem PC genutzt Neuere Versionen - APIC = Advanced PIC mit 256 Interrupt-Eingängen wird bei x86- Architekturen eingesetzt - SAPIC = Streamlined Advanced Programmable Interrupt Controller wird bei IA64-Architekturen eingesetzt Prof. Dr. Peter Mandl Seite 15 Gerät - Interrupt-Controller - CPU - Betriebssystem Übertragung der Interrupt-Request-Nummer, Mapping IRQ Int-Nr. IRQ 0 Gerät 1 D0-D7 Interrupt- Handling IRQ 1 Betriebs- Gerät 2 CPU 8259A system ... INT IRQ 7 Gerät 8 INTA Prof. Dr. Peter Mandl Seite 16 Beispiel: Intel 8259A-Controller Innenleben Intel 8259A, vereinfacht 8259A Interrupt- IRQ0-7 D0-D7 In-Service- Daten- Request- Register (ISR) bus- Register(IRR) Puffer CPU Interrupt-Masken- Register (IMR) INTR Steuerlogik INTA Prof. Dr. Peter Mandl Seite 17 Beispiel: Intel 8259A-Controller kaskadiert CPU INTA (Bearbeitung durch CPU bestätigt) IRQ 0 0 timer output 1 keyboard CPU 08 real time clock 09 s/w - int a0h IRQ 2 D0 – D7 10 reserved Intel 8259 Intel 8259 11 reserved (Adressierung des Interrupts) Master Slave 12 PS/2 mouse 13 coprocessor CPU INTR 14 hard disk IMR 15 reserved 03 serial 2 04 serial 1 05 parallel 2 INTA = Interrrupt Acknowledge INTR = Interruptmeldung an CPU 06 floppy IMR = Interrupt Mask Register 07 parallel 1 IRQ = Interrupt Request PIC = Programmable Interrupt Controller APIC = Advanced PIC Prof. Dr. Peter Mandl Seite 18 Interrupt-Dispatching bei Mehrkernprozessoren Dispatching-Algorithmus im Interrupt-Dispatcher wählt einen Kern aus, der den Interrupt bearbeiten soll Kommunikationssystem Local APIC Kern 1 Local APIC Kern 2 Interrupt Interrupt Dispatcher Interrupts (z.B. I/O-APIC Controller … im Chipsatz) Local APIC Kern n Mehrkernprozessor Prof. Dr. Peter Mandl Seite 19 Fallbeispiel: Windows, Interrupt-Bearbeitung (1) Interrupt-Service-Routinen Asynchrone Interrupts Ausnahme- Ausnahme- Hardware-Interrupt InHtearrnudplet-rService- Handler E/A-Geräte, Taktgeber Routine Synchrone Interrupts Ausnahme- Ausnahme- Systemcall Handler SyHsatenmdldeirenste Ausnahme- Ausnahme- Exceptions (Traps, Abort) Ausnahmen HAaunsdnlearhme- verteiler Handler Busfehler, Stromausfall, Handler Division durch 0,... Seitenfehler- Page Faults Handler Prof. Dr. Peter Mandl Seite 20 Fallbeispiel: Windows, Interrupt-Bearbeitung (2) Windows hat eine eigene Interrupt-Verwaltung Über sog. Interrupt Request Levels (IRQL) ordnet der Kernel den Interrupts eigene Prioritäten zu Nur Interrupts mit höherem IRQL können Interruptbearbeitung auf niedrigerem IRQL unterbrechen Über eine Interrupt Dispatch Tabelle (IDT) wird festgehalten, welche ISR für welchen Interrupt zuständig ist Prof. Dr. Peter Mandl Seite 21 Fallbeispiel: Windows, Interrupt-Bearbeitung (3) Interrupt Request Levels (IRQLs) in der IA32- Architektur IRQL Bezeichnung Beschreibung 31 High-Level Maschinen-Check und katastrophale Fehler 30 Power-Level Strom/Spannungsproblem 29 IPI-Level Interprocessor Interrupt 28 Clock-Level Clock-Interrupt 27 Sync-Level Prozessorübergreifende Synchronisation 3-26 Device-Levels Abbildung auf IRQs der Geräte je nach verbautem Interrupt-Controller 2 Dispatch/DPC-Level Dispatching und Ausführung von Deferred Procedure Calls 1 APC-Level Ausführung von Asynchronous Procedure Calls nach Ein-/Ausgabe-Requests 0 Passive-Level Normale Threadausführung Prof. Dr. Peter Mandl Seite 22 Fallbeispiel: Windows, Interrupt-Bearbeitung (4) Interrupt Request Levels (IRQLs) in der x64- und der IA64-Architektur IRQL Bezeichnung Beschreibung 15 High-Level Maschinen-Check und katastrophale Fehler 14 Power-Level Strom/Spannungsproblem und Interprozessor-Interrupt 13 Clock-Level Clock-Interrupt 12 Synch-Level Prozessorübergreifende Synchronisation 3-11 Device-Levels Abbildung auf IRQs der Geräte je nach verbautem Interrupt-Controller 2 Dispatch/DPC-Level Dispatching und Ausführung von Deferred Procedure Calls 1 APC-Level Ausführung von Asynchronous Procedure Calls 0 Passive-Level Normale Threadausführung Prof. Dr. Peter Mandl Seite 23 Fallbeispiel: Windows, Interrupt-Bearbeitung (5) Interrupt Controller Interrupt-Verteiler-Code Interrupt-Service-
Recommended publications
  • Programmable Interrupt Controller
    Programmable Interrupt Controller Dr. Wajiha Shah Outline • Explain how the x86 executes interrupts by using the interrupt vector table and interrupt routines. • List the differences between interrupts and CALL instructions. • Describe the differences between hardware and software interrupts. • Examine the ISR for any interrupt, given its interrupt number. • Describe the function of each pin of the 8259 programmable interrupt controller (PIC) chip. • Explain the purpose of each of the four control words of the 8259 and demonstrate how they are programmed. • Examine the interrupts in x86 PC1s. 8088/86 INTERRUPTS • An interrupt is an external event that informs the CPU that a device needs its service. – In 8088/86 there are a total of 256 interrupts. • INT 00, INT 01, ..., INT FF (sometimes called TYPEs). • When an interrupt is executed the processor: – Saves the flag register (FR), instruction pointer (IP), and code segment register (CS) on the stack,. – Goes to a fixed memory location. • In x86, always four times the value of the interrupt number. 8088/86 INTERRUPTS interrupt service routine (ISR) 1. When an interrupt is invoked it is asked to run a program to perform a certain service. 2. There must be a program associated with every interrupt . 3. This program is commonly referred to as an interrupt service routine (ISR), and also called the interrupt handler. 4. When an interrupt is invoked, the CPU runs the interrupt service routine. 8088/86 INTERRUPTS interrupt service routine (ISR) – For every interrupt there are allocated four bytes of memory in the interrupt vector table. – Two bytes for the IP. – Two for the CS of the ISR.
    [Show full text]
  • 16-Bit MS-DOS Programming (MS-DOS & BIOS-Level Programming )
    Microprocessors (0630371) Fall 2010/2011 – Lecture Notes # 20 16-Bit MS-DOS Programming (MS-DOS & BIOS-level Programming ) Objectives Real-Address Mode MS-DOS Memory Organization MS-DOS Memory Map Interrupts Mechanism—Introduction Interrupts Mechanism — Steps Types of Interrupts 8086/8088 Pinout Diagrams Redirecting Input-Output INT Instruction Interrupt Vectoring Process Common Interrupts Real-Address Mode Real-address mode (16-bit mode) programs have the following characteristics: o Max 1 megabyte addressable RAM o Single tasking o No memory boundary protection o Offsets are 16 bits IBM PC-DOS: first Real-address OS for IBM-PC Later renamed to MS-DOS, owned by Microsoft MS-DOS Memory Organization Interrupt Vector Table BIOS & DOS data Software BIOS MS-DOS kernel Resident command processor Transient programs Video graphics & text Reserved (device controllers) ROM BIOS MS-DOS Memory Map Address FFFFF R O M BIO S F0000 Reserved C0000 Video Text & Graphics B8000 V R A M Video Graphics A0000 Transient Command Processor Transient Program Area (available for application programs) Resident Command Processor 640K R A M DOS Kernel, Device Drivers Software BIOS BIOS & DOS Data 00400 Interrupt Vector Table 00000 Interrupt Mechanism—Introduction Devices such as the keyboard, the monitor, hard disks etc. can cause such interrupts, when they require service of some kind, such as to get or receive a byte. For example, when you press a key on the keyboard this causes an interrupt. When the Microprocessor is interrupted, it completes the current instruction, and then pushes onto the stack the flags register plus the address of the next instruction (the return address).
    [Show full text]
  • 8259 Programmable Interrupt Controller
    edge of each clock pulse. When the counter reaches zero, the OUT goes low and the counter is reloaded with the full count and the whole process is repeated. 3) In this way, if the count is odd, the output will be high for (n+1)/2 counts and low for (n-1)/2 count MODE 4 : Software Triggered Strobe In this mode , the OUT is high; It goes low for one clock period at the end of the count. The count must be loaded subsequently outputs MODE 5 : Hardware triggered strobe (Retriggerable). Initially, the out is low, and when the gate pulse is triggered from low to high, The count begins. At the end of count, the OUT goes low for one clock period. 8259 programmable interrupt controller 8259 is Programmable Interrupt Controller (PIC) It is a tool for managing the interrupt requests. 8259 is a very flexible peripheral controller chip: PIC can deal with up to 64 interrupt inputs interrupts can be masked various priority schemes can also programmed. There are 5 hardware interrupts and 2 hardware interrupts in 8085 and 8086 respectively. But by connecting 8259 with CPU, we can increase the interrupt handling capability. 8259 combines the multi interrupt input sources into a single interrupt output. Interfacing of single PIC provides 8 interrupts inputs from IR0-IR7. For example, Interfacing of 8085 and 8259 increases the interrupt handling capability of 8085 microprocessor from 5 to 8 interrupt levels. Features of 8259 PIC microprocessor – 1. Intel 8259 is designed for Intel 8085 and Intel 8086 microprocessor. 2.
    [Show full text]
  • The Programmable Interrupt Controller
    The Programmable Interrupt Controller SYSC-3006 Interrupt Controller • Before : The 8086 processor has two hardware interrupt signals • We’ve seen at least 2 interrupt sources. 8086 Timer Keyboard NMI INTR (INT 8) (INT 9) bus • “Decides from which vector table location to load ISR address” SYSC-3006 Interrupt Vectors: Deciding which ISR to run • Auto-vectored interrupts: vector predefined as part of CPU design – For each HW signal, CPU goes to a particular interrupt-type in vector table. – 8086 Example: NMI (auto-vectored -> Interrupt-type 2) • NMI asserted, 8086 executes INT type 2 interrupt behaviour: – save processor state – obtain ISR address from vector 2 (memory address 0:8) – execute type 2 ISR • More than one device shares the NMI signal? (e.g. RAM and power supply) – NMI ISR must check (poll) each device (which one caused the interrupt?) SYSC-3006 Interrupt Vectors: Deciding which ISR to run • Vectored interrupts: vector determined during systems design. – CPU performs “interrupt-acknowledge” cycle -> reads interrupt-type from data bus • Interrupting device can provide interrupt-type • 8086: interrupt controller (IC) External hardware – Vectored interrupts: robust method for multiple devices connected to single interrupt line (no polling!) • Interrupt-type: mapping to unique ISR for each device • Interrupt controller acts as a multiplexer – 8086 Example: INTR is a vectored interrupt SYSC-3006 Interrupt Controller • Interrupt controller acts as a funnel for multiple device interrupts – Allows many devices to share the 8086’s single
    [Show full text]
  • And PC 750 (Type 6887)
    Technical Information Manual PC 730 (Type 6877) and PC 750 (Type 6887) Technical Information Manual IBM PC 730 (Type 6877) and PC 750 (Type 6887) Note Before using this information and the product it supports, be sure to read the general information under Appendix B, “Notices and Trademarks” on page 65. First Edition (June 1996) The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time. It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. Requests for technical information about IBM products should be made to your IBM reseller or IBM marketing representative. IBM may have patents or pending patent applications covering subject matter in this document.
    [Show full text]
  • Popcorn Linux: Enabling Efficient Inter-Core Communication in a Linux-Based Multikernel Operating System
    Popcorn Linux: enabling efficient inter-core communication in a Linux-based multikernel operating system Benjamin H. Shelton Thesis submitted to the Faculty of the Virginia Polytechnic Institute and State University in partial fulfillment of the requirements for the degree of Master of Science in Computer Engineering Binoy Ravindran Christopher Jules White Paul E. Plassman May 2, 2013 Blacksburg, Virginia Keywords: Operating systems, multikernel, high-performance computing, heterogeneous computing, multicore, scalability, message passing Copyright 2013, Benjamin H. Shelton Popcorn Linux: enabling efficient inter-core communication in a Linux-based multikernel operating system Benjamin H. Shelton (ABSTRACT) As manufacturers introduce new machines with more cores, more NUMA-like architectures, and more tightly integrated heterogeneous processors, the traditional abstraction of a mono- lithic OS running on a SMP system is encountering new challenges. One proposed path forward is the multikernel operating system. Previous efforts have shown promising results both in scalability and in support for heterogeneity. However, one effort’s source code is not freely available (FOS), and the other effort is not self-hosting and does not support a majority of existing applications (Barrelfish). In this thesis, we present Popcorn, a Linux-based multikernel operating system. While Popcorn was a group effort, the boot layer code and the memory partitioning code are the authors work, and we present them in detail here. To our knowledge, we are the first to support multiple instances of the Linux kernel on a 64-bit x86 machine and to support more than 4 kernels running simultaneously. We demonstrate that existing subsystems within Linux can be leveraged to meet the design goals of a multikernel OS.
    [Show full text]
  • AL8259 Core Application Note Rev
    AL8259 Core Application Note Rev. [10/2012] 10-24-2012 AL8259 Core Application Note Table of Contents General Information ................................................................................................................................. 3 Features .................................................................................................................................................... 3 Block Diagram ........................................................................................................................................... 3 Contents .................................................................................................................................................... 4 A. Behavioral ..................................................................................................................................... 4 B. Synthesizable ................................................................................................................................ 4 C. Test Vectors .................................................................................................................................. 4 Interface .................................................................................................................................................... 5 Core Implementation Data ....................................................................................................................... 6 Deliverables ..............................................................................................................................................
    [Show full text]
  • Introduction to 8259(Interrupt Controller)
    INTRODUCTION TO 8259(INTERRUPT CONTROLLER) The Intel 8259 is a Programmable Interrupt Controllers (PIC) designed and developed to work with the Intel 8085 and Intel 8086 microprocessors. The 8259 acts as a multiplexer, combining multiple interrupt input sources into a single interrupt output to interrupt a microprocessor. The Programmable Interrupt Controller (PIC) functions as an overall manager in an Interrupt-Driven system environment. Most of the microprocessors have limited number of interrupt lines to accept interrupt (For e.g. Intel 8085 has 5 interrupt input pins). Therefore it is not possible for the microprocessor to handle interrupts by several I/O devices. When the number of I/O devices is more than the number of Interrupt lines of the microprocessor, such controllers are required. 8259 is used when several I/O devices need to transfer data using interrupt and they are to be connected to the same interrupt line of the microprocessor. It accepts requests from the peripheral devices, resolve their priority to entertain the peripheral with highest priority and issues an interrupt to the CPU based on this determination. FEATURES OF 8259 It is a LSI chip enclosed with 28 pins DIP (Dual in line package). It uses NMOS technology and requires a single +5V DC power supply. It can accept 8 interrupt requests (IRQ) simultaneously. All these 8 interrupts are vectored priority interrupts. It has internal priority resolver to determine the interrupts priority. It can be cascaded in master-slave configuration to get 64 levels of interrupts. The 8259 is designed to minimize the software and real time overhead in handling multi-level priority interrupts.
    [Show full text]
  • Computer Organization & Assembly Languages MS-DOS & BIOS-Level
    Computer Organization & Assembly Languages MS-DOS & BIOS-level Programming Pu-Jen Cheng Adapted from the slides prepared by Kip Irvine for the book, Assembly Language for Intel-Based Computers, 5th Ed Chapter Overview MS-DOS and the IBM-PC MS-DOS Function Calls (INT 21h) Standard MS -DOS File I/O Services MS-DOS and the IBM-PC Real-Address Mode MS-DOS Memory Organization MS-DOS Memoryyp Map Redirecting Input-Output Software Interrupts INT Instruction Interrupt Vectoring Process Common Interrupts Real-Address Mode Real-address mode (16-bit mode) programs have the following characteristics: ¾ Max 1 megabyte addressable RAM ¾ Singggle tasking ¾ No memory boundary protection ¾ Offsets are 16 bits IBM PC-DOS: first Real-address OS for IBM-PC ¾ Has roots in Gary Kildall's highly successful Digital Research CP/M ¾ Later renamed to MS-DOS, owned by Microsoft Memory Models NEAR and FAR Segments NEAR segment ¾ requires only a 16-bit offset ¾ faster execution than FAR FAR segment ¾ 32-bit offset: requires setting both segment and offset values ¾ slower execution than NEAR .MODEL Directive The .MODEL directive determines the names and grouping of segments .model tiny ¾ code and data belong to same segment (NEAR) ¾ .com file ext ens ion .model small ¾ both code and data are NEAR ¾ data and stack grouped into DGROUP .model medium ¾ code is FAR, data is NEAR .MODEL Directive .model compact ¾ code is NEAR, data is FAR .model huge & .model large ¾ both code and data are FAR .model flat ¾ both code and data are 32-bit NEAR MS-DOS
    [Show full text]
  • A8259 Programmable Interrupt Controller Data Sheet
    a8259 Programmable ® Interrupt Controller July 1997, ver. 1 Data Sheet Features ■ Optimized for FLEX® and MAX® architectures ■ Offers eight levels of individually maskable interrupts ■ Expandable to 64 interrupts ■ Offers a flexible priority resolution scheme ■ Provides programmable interrupt modes and vectors ■ Uses approximately 399 logic elements (LEs) in FLEX devices ■ Functionally based on the Intel 8259 device, except as noted in the “Variations & Clarifications” section on page 79 General The Altera® a8259 MegaCore™ function is a programmable interrupt controller. The a8259 can be initialized by the microprocessor through Description eight data bus lines (din[7..0] and dout[7..0]), and the ncs, nrd, nwr, int, and ninta control signals. Figure 1 shows the symbol for the a8259. Figure 1. a8259 Symbol A8259 nMRST CLK nCS nWR nRD A0 INT nINTA CASOUT[2..0] nSP CAS_EN CASIN[2..0] DOUT[7..0] IR[7..0] nEN DIN[7..0] Altera Corporation 57 A-DS-A8259-01 a8259 Programmable Interrupt Controller Data Sheet Table 1 describes the input and output ports of the a8259. Table 1. a8259 Ports Name Type Polarity Description nmrst Input Low Master reset. When nmrst is asserted, all internal registers assume their default state. The a8259 is idle, awaiting initialization. clk Input – Clock. All registers are clocked on the positive edge of the clock. ncs Input Low Chip select. When low, this signal enables the nwr and nrd signals and register access to and from the a8259. nwr Input Low Write control. When this signal is low (and ncs signal is also low), it enables write transactions to the a8259.
    [Show full text]
  • Sns College of Engineering
    SNS COLLEGE OF ENGINEERING Programmable Interrupt Controller (8259) The 8086 has only 2 interrupt line. If I/O devices need more interrupt line to transfer data, we go for Programmable Interrupt controllers. The Intel 8259 is a Programmable Interrupt Controller (PIC) designed for the Intel 8085 and Intel 8086 microprocessors. K.SANGEETHA/MPMC/I/O & MEMORY INTEFACING / unit -3 1 SNS COLLEGE OF ENGINEERING Important Features • In computing, a programmable interrupt controller (PIC) is a device that is used to combine several sources of interrupt onto one or more CPU lines, while allowing priority levels to be assigned to its interrupt outputs. K.SANGEETHA/MPMC/I/O & MEMORY INTEFACING / unit - 3 SNS COLLEGE OF ENGINEERING • PICs typically have a common set of registers: • Interrupt Request Register (IRR), • In-Service Register (ISR), • Interrupt Mask Register (IMR). • The IRR sores the interrupts request that is coming from 8 interrupt lines • The ISR register stores all the interrupts that are currently being serviced • The IMR stores the masking bits ie which interrupts are to be ignored and not acknowledged. K.SANGEETHA/MPMC/I/O & MEMORY INTEFACING / unit - 3 SNS COLLEGE OF ENGINEERING Block Diagram K.SANGEETHA/MPMC/I/O & MEMORY INTEFACING / unit - 3 SNS COLLEGE OF ENGINEERING Block Diagram Description • There are three registers, an Interrupt Mask Register (IMR), an Interrupt Request Register (IRR), and an In-Service Register (ISR). • Data bus buffer and read-write logic: are used to configure the internal registers of the chip. • Interrupt mast register (IMR): is used to enable or mask out the individual interrupt inputs through bits M0 to M7.
    [Show full text]
  • 8259A Programmable Interrupt C Ontroller (8259A/8259A-2)
    8259A PROGRAMMABLE INTERRUPT C ONTROLLER (8259A/8259A-2) Features Y 8086, 8088 Compatible Y MCS-80, MCS-85 ompatible Y Eight-Level Priority Controller Y Expandable to 64 Levels Y Programmable Interrupt Modes Y Individual Request Mask Capability Y Single a 5V Supply (No Clocks) Y Available in 28-Pin DIP and 28-Lead PLCC Package 4.6.1 FUNCTIONAL DESCRIPTION Intel 8259A Programmable Interrupt Controller handles up to eight vectored priority interrupts for the CPU. It is cascadable for up to 64 vectored priority interrupts without additional circuitry. It is packaged in a 28-pin DIP, us es NMOS technology and requires a single a 5V supply. Circui try is static, requiring no clock input. The 8259A is designed to minimize the software and real time overhead in handling multi- level priority inter- rupts. It has several modes, permitting optimization for a variety of system requirements. The 8259A is fully upward compatible with the Intel 8259. Software originally written for the 8259 will operate the 8259A in all 8259 equivalent modes (MCS-80/85, Non- Buffered, Edge Triggered). Interrupts in Microcomputer Systems Microcomputer system design requires that I.O de- vices such as keyboardd s, isplays, sensors and oth- er components receive servicing in a an efficient manner so that large amounts of the total system tasks can be assumed by the microcomputer with little or no effect on throughput. The most common method of servicing such devic- es is the Polled approach. This is where the proces- sor must test each device in sequence and in effect „„ask‟‟ each one if it needs servicing.
    [Show full text]