Interfere with Administrations - PowerPoint PPT Presentation

interrupt services l.
Skip this Video
Loading SlideShow in 5 Seconds..
Interfere with Administrations PowerPoint Presentation
Interfere with Administrations

play fullscreen
1 / 11
Download Presentation
Download Presentation

Interfere with Administrations

Presentation Transcript

  1. Interrupt Services Application Programs/OS Shell ( int 21h, and others int 10h, and others (IO.SYS) DOS Services (msdos.sys) BIOS (EEPROM) Hardware (x86, Chipset and Peripherals) BIOS - Basic Input Output System DOS - Disk Operating System

  2. Which Way is Best ? • Direct is fastest but least portable • Example: Many draw programs use direct for speed • Must provide support for ALL video cards • Attempt to standardize video card drivers • BIOS has average portability since few versions • AWARD, AMI (others DELL, Mr. BIOS, ACER, etc.) • Typically lower level services than DOS • Faster since closer to HW • DOS services are slowest but most portable • Huge percentage of PCs run MS-OS • DOS ISRs generally invoke BIOS ISRs

  3. Characteristics • BIOS, DOS services can be called from ANY program -- IVT contains FAR pointers • All BIOS, most DOS, interrupt service routines preserve register contents -- EXCEPT ax • Most DOS services return an error code in ax - Error code present in ax if CF=1 • Each BIOS and DOS service has a “protocol” for passing parameters (to interrupt service routine)

  4. Customized Services • Some devices do not have services in BIOS or MSDOS.SYS • Must write a customized ISR for device and load at boot time • Device Drivers • DOS services and BIOS services are standard device drivers • DOS is actually little more than a collection of ISRs • DOS/BIOS Services were Created to Aid Programmers in IBM PC

  5. Interrupt Classification by Type Number • Remaining used by DOS/BIOS extensions or user

  6. DOS Service Interrupts 2Fh Allows Memory Resident Programs to Communicate (Mailbox) * Intended to be Invoked using int Instruction.

  7. DOS System Service Interrupt – 20h PROGRAMTERMINATE SERVICE • Original service to pass control back to DOS • Later versions of DOS added more functionality - Automatically close files, etc. • Later PROGRAM TERMINATE services • - int 21h, func 00h, 0fh, 16h, 31h, or 4ch • Should use int 21h, func 4ch unless require compatibility with earlier DOS version

  8. DOS System Service Interrupts – 25h, 26h ABSOLUTE DISK READ, WRITE • Read/Write specific PHYSICAL sectors • - Ignores the logical structure • Parameters passed in al, cx, bx, ds • al Indicates the disk • ds:bx points to memory location (data to read/write) • cx contains number of sectors • Result codes returned in al, ah • - CF=1 Indicates error, CF=0 Indicates no error

  9. DOS User Interrupts – 22h,23h,24h,28h • Type 22h – Terminate address; specifies address to go to when int 20h, 27h, 21h, func 00h, 0fh, 16h, 31h, 4ch • Type 23h – CTRL-C (CTRL-BREAK) handler • Type 24h – Critical error handler; Default produces“Abort, Retry, Ignore?” or “Abort, Retry, Fail?” • Type 28h – DOS idle; Used by DOS when waiting for an event (i.e. “wait” for a keystroke)

  10. DOS System Service Interrupt – 21h GENERAL SERVICES • Function specified in ah – Over 100! • Can be grouped into categories • I/O services – char. I/O only – keyboard, port (eg. COM1) • Printer services – func 5 only – output ASCII in dl to LPT1 • Disk services – read, write, open, close, structure, etc. • System services – set “hooks”, device information, etc. • Network services – get name, redirect to remote device • Date/Time services – retrieve and format from BIOS al Contains day (0-6) dh Contains month (1-12) cx Contains year (1980-2099) dl Contains day (1-31)

  11. BIOS – Service Routines • Compatibility – OS can change, BIOS change not as likely • 12 basic BIOS services – Categorized in 5 groups • Peripheral Devices (10h, 13h, 14h, 15h, 16h, 17h) • Equipment Status (11h, 12h) • Time/Date Service (1ah) • Print Screen Key (05h) • Special Services (18h, 19h) • Many ISRs have several different functions • eg. int 10h (video) has 25 functions