1 / 17

BIOS and DOS Interrupts

BIOS and DOS Interrupts. Basic Input / Outpu System Disk Operating System. Computer Interrupt. Interrupt request : a signal that immediate attention is needed Interrupt processing : what CPU does in response to request Interrupt service : what is done in software as a result.

meryl
Download Presentation

BIOS and DOS Interrupts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System

  2. Computer Interrupt Interrupt request: a signal that immediate attention is needed Interrupt processing: what CPU does in response to request Interrupt service: what is done in software as a result

  3. Computer Interrupt • 2 General Types of Interrupts: • External- generated outside CPU by other hardware • Internal- generated within CPU as a result of instruction or operation • - x86 internals: int, into, divide error, and single step • - “trap” generally means any processor generated interrupt; • in x86, usually means the single step interrupt • x86 Terminology for Interrupts: • 1) Hardware Interrupt – External, uses INTR and NMI control bus lines • 2) Software Interrupt – Internal, from int or into • 3) Processor Interrupt – traps, exceptions

  4. GND 1 40 VCC GND 1 40 VCC AD14 2 39 AD15 A14 2 39 A15 AD13 3 38 A16/S3 A13 3 38 A16/S3 AD12 4 37 A17/S4 A12 4 37 A17/S4 AD11 5 36 A18/S5 A11 5 36 A18/S5 AD10 6 35 A19/S6 A10 6 35 A19/S6 AD9 7 34 A9 7 34 SS0 AD8 8 8086 33 A8 8 8088 33 BHE/S7 AD7 9 32 AD7 9 32 MN/MX MN/MX AD6 10 31 HOLD AD6 10 31 HOLD RD RD AD5 11 30 HLDA AD5 11 30 HLDA AD4 12 29 AD4 12 29 AD3 13 28 AD3 13 28 WR WR AD2 14 27 AD2 14 27 IO/M M/IO AD1 15 26 AD1 15 26 DT/R DT/R AD0 16 25 ALE AD0 16 25 ALE DEN DEN NMI 17 24 NMI 17 24 INTR 18 23 INTR 18 23 INTA INTA CLK 19 22 READY CLK 19 22 READY TEST TEST GND 20 21 RESET GND 20 21 RESET 8086/8088 Pinout Diagrams

  5. 8086 External Interrupt Connections NMI - Non-Maskable Interrupt INTR - Interrupt Request Programmable Interrupt Controller (part of chipset) NMI Requesting Device NMI 8086 CPU Intel 8259A PIC INTR Interrupt Logic Single Step Divide Error into int Software Traps

  6. Interrupt Vector Table – IVT (in memory) • x86 has 256 interrupts, specified by Type Number or Vector • 1 byte of data must accompany each interrupt; specifies Type • Vector is a pointer (address) into Interrupt Vector Table, IVT • IVT is stored in memory from 0000:0000 to 0000:03ffh • IVT contains 256 far pointer values (addresses) • Far pointer is CS:IP values • Each far pointer is address of Interrupt Service Routine, ISR • Also referred to as Interrupt Handler When interrupt is requested, which IVT entry? Type!

  7. IVT Format 0000:0000 Offset 0000:0001 IP LSB IP MSB Interrupt 0 0000:0002 Segment 0000:0003 CS LSB CS MSB 0000:0004 Offset 0000:0005 Interrupt 1 0000:0006 Segment 0000:0007 Given a Vector, where is the ISR address stored in memory ? 0000:03fc Offset Example: int 36h Offset = (544) = 216 = 00d8h 0000:03fd Interrupt 255 0000:03fe Segment 0000:03ff

  8. What Happens During an Interrupt ? push Flags Complete Current Instruction Internal Interrupt TF=TEMP Set TEMP=TF YES NO pop IP and CS IF=0 TF=0 NMI YES NO INTR IF popf push CS and IP YES 1 0 NO TF acknowledge interrupt Resume Interrupted Procedure call ISR 1 0 Read Type Code # Fetch Next Instruction NMI YES NO

  9. callint • retiret • call pushes CS, IP and loads CS:IP with address of subroutine • int does what call does and more • ret pops IP, CS • iret pops FLAGS, IP, and CS • This is why ALL programs MUST have a stack segment, so that interrupts can be handled Similarity to Subroutine Procedure

  10. CPU Asset Content 0000h Register FLAGS IP 0000h CS ffffh DS 0000h SS 0000h ES 0000h Instruction Queue Empty halt Instruction • This instruction causes processor to enter a HALT state • HALT state is one where no further instructions are fetched nor executed until one of the following events occurs: • 1) System is reset - rising edge on RESET pin • 2) External interrupt occurs

  11. Interrupt Vector Assignments

  12. Interrupt Vector Assignments (cont.)

  13. AT – IRQ DefinitionsIBM-AT (Advanced Technology) - Intel 80286

  14. Interrupt Service Routines • ALL Interrupts • Interrupts for Inpu • Interrupts for Output

  15. Interrupts for Inpu • INT 16h / AH = 00h- get keystroke from keyboard (no echo) • INT 16h / AH = 01h- check for keystroke in the keyboard buffer • INT 21h / AH=1- read character from standard input, with echo • INT 21h / AH=6- direct console input or output • INT 21h / AH=7- character input without echo to AL • INT 21h / AH=0Ah- input of a string • INT 21h / AH=0Bh- get input status

  16. Interrupts for Output • INT 21h / AH=2- write character to standard output • INT 21h / AH=9- output of a string

  17. HW#1 • Develop an assembly program that receives a decimal number (up to max 100 digits) from user and displays its hexadecimal equivallent. • Due Date: Sunday Esfand 23rd • Mail to: MrKazari and me (vahdat@sharif.edu or vosoughivahdat@yahoo.com) • Subject: HW1 UPI2010 IDxxxxxxxx

More Related