Professional Documents
Culture Documents
(1854)
Submitted To: Mam Ayesha Afzal Date: 21, Oct, 2011 Section: A
DEPARTMENT OF COMPUTER SCIENCE FACULTY OF ENGINEERING, TECHNOLOGY & MANAGEMENT SCIENCES LAHORE COLLEGE FOR WOMEN UNIVERSITY, LAHORE
Question no1:
What are the Interrupts? What are the types of the Interrupts?
Interrupts:
An interrupt is a routine that interrupts the execution of a program so that the system can take special actions. The interrupt routine executes and normally returns to the interrupted procedure, which resumes its execution.
Types of Interrupts:
The interrupts can be classified into three types depending on the origin of the interrupts Hardware Interrupt Software Interrupt Processor exception
Hardware Interrupts:
Hardware interrupts are also called External Interrupts. A device external to the processor causes a hardware interrupt. The two lines that can signal external interrupts are the NMI line (Non-Mask able Interrupt) and the interrupt request line (INTR). The NMI line is used to report memory and I/O parity errors. The INTR line report request from external devices such as timer, keyboard, serial port, fixed disk, and diskette drives, and parallel ports (interrupts 05H to 0Fh).
Software Interrupts:
Software interrupts are used by programs to request system services. A software interrupt occurs when a program calls an interrupt routine using INT instruction. For example the interrupt number for doing I/O operations s INT 21H. The software interrupts are also known as internal interrupts. The software interrupts are non-mask able and are used to access DOS procedures.
Processor Exception:
A processor exception arises when a condition arises inside the processor, such as divide over
Lahore Collage For Women University Page 2
flow, which requires special handling. Each condition corresponds to a unique interrupt type. For example, divide overflow is type 0, so when the overflow occurs in a divide instruction the 8088 automatically executes interrupt 0 to handle the overflow condition.
Question no 2:
What is difference between BIOS and DOS Interrupts?
BIOS Interrupt:
BIOS refer to (Basic Input Output System) it is responsible for booting of your system. BIOS contain a set of input /output routines and tables that indicate the status of the systems devices. Both operating system and user programs can request BIOS routines for communication with devices attached to the system. The method of interfacing with the BIOS is by means of software interrupts. The interrupt types 0 to 1FH are known as BIOS interrupts. Since the BIOS routines offers its own services under a few different interrupt vector numbers. For example: INT 10H Video services INT 11H Equipment list INT 12H Conv. memory size INT 13H Disk I/O INT 14H Serial port I/O INT 15H AT services; APM INT 16H Keyboard I/O INT 17H Printer I/O INT 18H ROM-BASIC INT 19H Bootstrap INT 1aH Time I/O; MRCI hook
DOS Interrupt:
DOS (Disk Operating System) is an operating system that user uses by entering commands in command prompt (to open in windows press starter). DOS is the acronym for Disk operating System. The interrupt types 20H-3FH are serviced by DOS routines that provide high-level service to hardware as well as system resources such as files and directories. The most useful is INT 21H which provides many functions for doing keyboard, video and file operations. Following are the DOS interrupts: INT 20H Terminate a program INT 21H DOS Services INT 22H Terminate address INT 23H Control-Break address INT 24H Critical Error Handler address INT 25H/26H Absolute Disk Read/Write INT 27H Terminate but Stay Resident INT 28H DOS Idle (safe to pop up) INT 29H DOS Internal Fast Screen Write INT 2eH Perform DOS Command INT 2fH Multiplex (DoubleSpace, spooler, TSR control, other APIs) INT 31H DPMI DOS Protected Mode Interface Services.
Question no 3:
Briefly describe the INT 21H of DOS with its functions?
Interrupt 21H and Its Functions:
The interrupt types 20h-3Fh are serviced by DOS routines that provide high-level service to hardware as well as system resources such as files and directories. The most useful is INT 21H, which provides many functions for doing keyboard, video, and file operations.
3Ch: Create a File 3Dh: Open a File 3Eh: Close a File Handle 3Fh: Read from a File 40h: Write to a File 41h: Delete a File from a Specified Directory
Creates a new file Opens a file Closes the specified file handle Transfers the specified number of bytes from a file to a buffer Transfers the specified number of bytes from a buffer into a file
Places the full path name of the current directory in the area pointed by DS:SI. Allocates the requested number of paragraphs of memory Frees the specified allocated memory Terminates the current process and transfers control to the invoking process.
DL = Day (1-31)