1 / 15

CS2422 Assembly Language & System Programming

This study guide discusses the INT interrupt and the boot process of a PC, including interrupt handlers and BIOS booting. Learn about INT I/O, INT vectors, common interrupts, and the system boot process.

aseymour
Télécharger la présentation

CS2422 Assembly Language & System Programming

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. CS2422 Assembly Language & System Programming November 2, 2006

  2. Today’s Topics • INT (Interrupt). • How Does a PC Boot?

  3. Study Guide • Interrupt: Sections 13.1.3 and 13.1.4. • (Advanced) Interrupt Handler: Section 16.4. • Boot Process: http://www.pcguide.com/ref/mbsys/bios/boot.htm

  4. Interrupt • If you call your friend and his/her mom says he/she is not home, what do you do? • Do something else, and get interrupted when I/O events happen. • May be triggered by hardware or software. • INT is also used for system calls (=low-level procedures).

  5. Note that we will use the 16-bit mode in the following slides.

  6. Examples of INT I/O • Put parameters in registers • Reference: chapter 8 • Example: INT 10 • Function Code in AH • Function 06H = clear Example: Clear Screen MOV AX, 0600 MOV BH, 17 MOV CX, 0000 MOV DX, 184F INT 10

  7. Examples of I/O INT • Another Example: INT 21H • Function Code in AH • Function 09H = display • Assume the string ‘hello$’ is at DS:200 Example: Display ‘hello’ MOV AH, 09 MOV DX, 200 INT 21H

  8. INT Vectors • In 000h-3FFh (1KB) • For INT 00-FF • Each INT uses a 4-byte vector (CS:IP): • 2 bytes for IP • 2 bytes for CS • Actual code (Service Routine) is in CS:IP • IRET at the end of INT Service Routine

  9. INT Vectors: Example Main proc MOV AX,@data MOV DS, AX … … INT 21h Main endp PUSH DX PUSH CX … … IP CS 0h 4h … … 84h … … 3FFh

  10. Interrupt Vectoring Process

  11. Common Interrupts • INT 10h Video Services • INT 16h Keyboard Services • INT 17h Printer Services • INT 1Ah Time of Day • INT 1Ch User Timer Interrupt • INT 21h MS-DOS Services

  12. Boot Process (1) • CPU Reset • Blank memory, except ROM • Start running from address FFFF0 (only 16 bytes left!)

  13. Boot Process (2) • BIOS Boot and POST (Power-On Self Test) • BIOS of other device may be checked too. (e.g., Video) • Flash ROM Upgrade Possible • If booting from hard disk  1st Sector (MBR) loaded

  14. System Boot (3) • Master Boot Record (MBR) loaded. • Heard about LILO? • Remember that PC  DOS/Windows • OS (e.g., Linux, MS-DOS or Windows) is then loaded. • INT Services may be in ROM or set up while loading OS.

  15. For Further Information… • PC Guide – BIOS System Boothttp://www.pcguide.com/ref/mbsys/bios/boot.htm

More Related