System interrupts load the processor. Hardware interrupts. Interrupt controller How to catch interrupts in win 7

For handling events that occur asynchronously with respect to program execution, it is best suited interrupt mechanism.

Interrupt can be considered as some special event in the system that requires an immediate response. For example, well-designed high-reliability systems use a power failure interrupt to perform procedures for writing the contents of registers and RAM to magnetic media so that when power is restored, work can continue from the same place.

It seems clear that a wide variety of interruptions are possible for a variety of reasons. Therefore, an interrupt is not just considered as such, but has a number associated with it, called an interrupt type number or simply an interrupt number. Each interrupt number is associated with one or another event. The system is able to recognize which interrupt occurred with which number and starts the procedure corresponding to this number.

Programs can themselves cause interrupts with a given number. To do this they use the INT command. These are so-called software interrupts. Software interrupts are not asynchronous, since they are called from the program (and it knows when it calls an interrupt!).

Software interrupts are convenient to use to organize access to individual modules common to all programs. For example, operating system program modules are accessible to application programs through interrupts, and there is no need to know their current address in memory when calling these modules. Application programs can install their own interrupt handlers for subsequent use by other programs. To do this, built-in interrupt handlers must be memory resident.

Hardware interrupts are caused by physical devices and arrive asynchronously. These interrupts inform the system about events related to the operation of devices, for example, that the printer has finally finished printing a character and it would be nice to issue the next character, or that the required disk sector has already been read and its contents are available to the program. Using interrupts when working with slow external devices allows you to combine I/O with data processing in the central processor and, as a result, improves overall system performance. Some interrupts (the first five in numerical order) are reserved for use by the CPU itself in case of any special events such as an attempt to divide by zero, overflow, etc.

Sometimes it is desirable to make the system insensitive to all or individual interrupts. For this they use the so-called interrupt masking. But some interrupts cannot be masked; these are non-maskable interrupts.

Note also that interrupt handlers can themselves call software interrupts, for example, to gain access to the BIOS or DOS service (BIOS service is also available through the software interrupt mechanism).

Composing your own interrupt handling programs and replacing standard DOS and BIOS handlers is responsible and complex work. It is necessary to take into account all the subtleties of the operation of the equipment and the interaction of software and hardware. When debugging, it is possible to destroy the operating system with unpredictable consequences, so you need to very carefully monitor what your program is doing.

In order to associate the address of the interrupt handler with the interrupt number, use interrupt vector table, occupying the first kilobyte of RAM - addresses from 0000:0000 to 0000:03FF. The table consists of 256 elements - FAR addresses of interrupt handlers. These elements are called interrupt vectors. The first word of the table element contains the offset, and the second word contains the address of the interrupt handler segment.

Interrupt number 0 corresponds to address 0000:0000, interrupt number 1 corresponds to address 0000:0004, etc.

The table is initialized partly by the BIOS after testing the hardware and before the operating system starts loading, and partly when loading DOS. DOS can take over some BIOS interrupts.

Let's look at the contents of the interrupt vector table. Here is the purpose of some of the most important vectors:

Description

Division error. Called automatically after DIV or IDIV commands are executed if division results in overflow (for example, division by 0). DOS usually displays an error message when handling this interrupt and stops the program from executing. For the 8086 processor, the return address points to the next instruction after the division instruction, and in the 80286 processor - to the first byte of the instruction that caused the interrupt.

Interrupt step mode. Produced after the execution of each machine instruction, if the step-by-step trace bit TF is set in the flags word. Used for debugging programs. This interrupt is not generated after executing a MOV instruction to segment registers or after loading segment registers with a POP instruction.

Hardware non-maskable interrupt. This interrupt can be used differently on different machines. Typically generated when there is a parity error in RAM and when an interrupt is requested from the coprocessor.

Interrupt for tracing. This interrupt is generated by the execution of a one-byte machine instruction with code CCh and is commonly used by debuggers to set a breakpoint.

Overflow. Generated by the INTO machine instruction if the OF flag is set. If the flag is not set, then the INTO instruction is executed as NOP. This interrupt is used to handle errors when performing arithmetic operations.

Print a screen copy. Generated by pressing the PrtScr key on the keyboard. Typically used to print a screen image. For the 80286 processor, generated when executing the BOUND machine instruction if the value being tested is outside the specified range.

Undefined opcode or instruction length greater than 10 bytes (for 80286 processor).

A special case of the absence of a mathematical coprocessor (80286 processor).

IRQ0 - interval timer interrupt, occurs 18.2 times per second.

IRQ1 - keyboard interrupt. Generated when a key is pressed or released. Used to read data from the keyboard.

IRQ2 - used for cascading hardware interrupts in AT class machines.

IRQ3 - interruption of the asynchronous port COM2.

IRQ4 - interruption of the asynchronous port COM1.

IRQ5 - interrupt from the hard disk controller for XT.

IRQ6 - interrupt is generated by the floppy disk controller after the operation is completed.

IRQ7 - printer interrupt. Generated by the printer when it is ready to perform another operation. Many printer adapters do not use this interrupt.

Video adapter maintenance.

Determining the configuration of devices in the system.

Determining the size of RAM in the system.

Disk system maintenance.

Serial I/O.

Advanced service for AT computers.

Keyboard maintenance.

Printer maintenance.

Run BASIC in ROM, if available.

Watch service.

Interrupt handler Ctrl-Break.

The interrupt occurs 18.2 times per second and is called programmatically by the timer interrupt handler.

Video table address for the 6845 video adapter controller.

Pointer to the floppy disk parameter table.

Pointer to a graphics table for characters with ASCII codes 128-255.

Used by DOS or reserved for DOS.

Interrupts reserved for the user.

Not used.

IRQ8 - real time clock interrupt.

IRQ9 - interrupt from the EGA controller.

IRQ10 - reserved.

IRQ11 - reserved.

IRQ12 - reserved.

IRQ13 - interrupt from the math coprocessor.

IRQ14 - interrupt from the hard disk controller.

IRQ15 - reserved.

Not used.

Reserved for BASIC.

Used by the BASIC interpreter.

Here we will discuss important topics such as: interrupt handling, interrupt vectors, software interrupts, IRQ, in general, let's talk about interruptions.

Idea interrupts was proposed in the mid-50s and the main purpose of introducing interrupts was to implement a synchronous operating mode and implement parallel operation of individual computer devices.

Interrupts And interrupt handling depend on the type of computer, therefore their implementation is classified as machine-dependent properties of operating systems.

Interrupt(interrupt) is a signal that causes the computer to change the usual order of execution of instructions by the processor.

The appearance of such signals is due to such events, How:

  • completion of I/O operations.
  • expiration of a predetermined time interval.
  • attempt to divide by zero.
  • hardware failure, etc.

Interrupt handling

Each interruption has a number associated with it, called interrupt type number or simply interrupt number. The system can recognize which interrupt, what number it occurred with, and launches the interrupt processing program corresponding to this number. Thus, when an interrupt signal is received, control is forced to be transferred from the executing program to the system, and through it to the interrupt handler.

For example interrupt with number 9 - a keyboard interrupt, which is generated when a key is pressed and released. Used to read data from the keyboard. Denoted in the OS as IRQ 1, where IRQ is the interrupt designation, and 1 is the interrupt priority. Interrupt request data can be analyzed in Device Manager:

Interrupt handler– an interrupt handling program, which is part of the OS, designed to perform actions in response to the condition that caused the interrupt.

Let's assume that when an interrupt signal arrives from some source, program A is in solution. As a result, control is automatically transferred to the interrupt handler. After processing is completed, control can be transferred again to the point in program A where its execution was interrupted:

Interrupt vectors

The addresses of programs corresponding to various interrupts are collected in a table called interrupt vector table.

The microprocessor requires a simple way to determine the location of the interrupt service routine and this is accomplished by using interrupt vector tables.

Interrupt vector table occupies the first kilobyte of RAM - addresses from 0000:0000 to 0000:03FF. The table consists of 256 elements - FAR addresses of interrupt handlers. These elements are called interrupt vectors. The first word of the table element contains the offset, and the second word contains the address of the interrupt handler segment. Vectors are simply complete program memory addresses (in segmented form) that must be activated when an interrupt occurs.

Interrupt number 0 corresponds to address 0000:0000, interrupt number 1 corresponds to address 0000:0004, etc. This address consists of a pair of 2-byte words, so each vector occupies four bytes.

You can view the interrupt vector table on your computer if you use the DEBUG program. Use the D command to print the contents of the beginning of memory: D 0:0. The DEBUG program will show you the first 128 bytes or 32 vectors, which might look something like this:

0000:0000 E8 4E 9A 01 00 00 00 00-C3 E2 00 F0 00 00 00 00
0000:0010 F0 01 70 00 54 FF 00 F0-05 18 00 F0 05 18 00 F0
0000:0020 2C 08 51 17 D0 0A 51 17-AD 08 54 08 E8 05 01 2F
0000:0030 FA 05 01 2F 05 18 00 F0-57 EF 00 F0 F0 01 70 00
0000:0040 90 13 C7 13 4D F8 00 F0-41 F8 00 F0 3E 0A 51 17
0000:0050 5C 00 B7 25 59 F8 00 F0-E2 0A 51 17 9C 00 B7 25
0000:0060 00 00 00 F6 8E 00 DE 09-6E FE 00 F0 F2 00 7B 09
0000:0070 27 08 51 17 A4 F0 00 F0-22 05 00 00 00 00 00 F0

Vectors are stored as “words in reverse”: first the offset, and then the segment. For example, the first four bytes that DEBUG showed above (E8 4E 9A 01) can be converted to the segmented address 019A:4EE8.

You can find three types of addresses in vector table. These may be addresses pointing to the ROM-BIOS, which can be identified by the hexadecimal digit F that precedes the segment number. These can be addresses that point to main memory (as in the example: 019A:4EE8). These addresses may point to DOS routines or to a resident program (such as SideKick or Prokey), or they may point to the DEBUG program itself (since DEBUG must temporarily control the interrupt). Vectors can also consist of only zeros when the interrupt with this number is not currently being processed.

The table is initialized partly by the BIOS after testing the hardware and before the operating system starts loading, and partly when the operating system boots.

Below is the purpose of some vectors:

Description
0 Division error. Called automatically after executing a DIV or IDIV command if the division results in an overflow (for example, division by 0).
2 Hardware non-maskable interrupt. This interrupt can be used differently on different machines. Typically generated when there is a parity error in RAM and when an interrupt is requested from the coprocessor.
5 Print a screen copy. Generated by pressing the PrtScr key on the keyboard. Typically used to print a screen image.
8 IRQ0 - interval timer interrupt, occurs 18.2 times per second.
9 IRQ1 - keyboard interrupt. Generated when a key is pressed or released. Used to read data from the keyboard.
A IRQ2 - used for cascading hardware interrupts in AT class machines
B IRQ3 - interruption of the asynchronous port COM2.
C IRQ4 - interruption of the asynchronous port COM1.
D IRQ5 - interrupt from the hard disk controller for XT.
E IRQ6 - An interrupt is generated by the floppy disk controller after the operation is completed.
F IRQ7 - printer interrupt. Generated by the printer when it is ready to perform another operation. Many printer adapters do not use this interrupt.
10 Video adapter maintenance.
11 Determining the configuration of devices in the system.
12 Determining the size of RAM in the system.
13 Disk system maintenance.
14 Serial I/O.
1A Watch service.
1B Interrupt handler Ctrl-Break.
70 IRQ8 - real time clock interrupt.
71 IRQ9 - interrupt from the EGA controller.
75 IRQ13 - interrupt from the math coprocessor.
76 IRQ14 - interrupt from the hard drive controller.
77 IRQ15 - reserved.

IRQ0 - IRQ15 are hardware interrupts.

Interrupt handling mechanism

When processing each interrupt, the following sequence of actions must be performed:

  • Perceiving an interrupt request: receiving the signal and identifying the interrupt.
  • Remembering the state of an interrupted process: determined by the value of the program counter (the address of the next instruction) and the contents of the processor registers.
  • Transfer of control to the interrupting program (the starting address of the interrupt processing subroutine is entered into the program counter, and information from the processor status word is entered into the corresponding registers).
  • Interrupt handling.
  • Restoring an interrupted process and returning to an interrupted program.

The main functions of the interrupt mechanism:

  1. interrupt recognition or classification.
  2. transfer of control to the interrupt handler accordingly.
  3. correct return to the interrupted program (before control is transferred to the interrupt handler, the contents of the processor registers are stored either in direct access memory or on the system stack).

Types of interrupts

Interruptions that occur during the operation of a computer system can be divided into 4 groups:

Hardware interrupts are called by physical devices and occur asynchronously in relation to the program, i.e. In general, it is impossible to predict when and for what reason a program will be interrupted.

Hardware interrupts are not coordinated with software. When an interrupt is called, the processor stops what it's doing, executes the interrupt, and then returns to where it was.

External interrupts arise from a signal from some external device, for example:

  • An interrupt that informs the system that the required disk sector has already been read and its contents are available to the program.
  • An interrupt that informs the system that the printer has finished printing a character and needs to issue the next character.
  • Interruptions due to power failure.
  • The normal completion of some I/O operation (pressing a key on the keyboard).
  • Timer interrupt.

Timer interrupt called by an interval timer. This timer contains a register that can be assigned a specific initial value using a special privileged instruction. The value of this register is automatically decremented by 1 after every millisecond of time. When this value becomes zero, a timer interrupt occurs. An interval timer like this is used by the operating system to determine how long a user program can remain under control of the machine.

Maskable and non-maskable external interrupts

There are two special external signals among the processor input signals, with which you can interrupt the execution of the current program and thereby switch the operation of the central processor. These are the signals NMI(Non Mascable Interrupt, non-maskable interrupt) INTR(interrupt request, interrupt request).

Accordingly, external interrupts are divided into two types: non-maskable and maskable.

Often, when executing critical sections of programs, in order to ensure that a certain sequence of instructions is executed entirely, it is necessary to disable interrupts (that is, make the system insensitive to all or individual interrupts). This can be done using the CLI command. It must be placed at the beginning of the critical sequence of instructions, and at the end there must be an STI instruction that allows the processor to accept interrupts. The CLI command disables only maskable interrupts; non-maskable ones are always processed by the processor.

Thus, the presence of an interrupt signal does not necessarily cause the running program to be interrupted. The processor may have means of protection against interruptions: disabling the interrupt system, masking (inhibiting) individual interrupt signals. Interrupts that cannot be masked are non-maskable interrupts.

Internal interrupts are caused by events that are associated with the operation of the processor and are synchronous with its operations, namely, an interrupt occurs when:

  • in case of addressing violation (a forbidden or non-existent address is indicated in the address part of the executed command, access to a missing segment or page when organizing virtual memory mechanisms);
  • if there is an unused binary combination in the code field.
  • when divided by zero.
  • when order overflows or disappears.
  • when detecting parity errors, errors in the operation of various hardware devices by monitoring means.

Software interrupts

Programs can themselves cause interrupts with a given number. To do this they use the INT command. With this command, the processor performs almost the same actions as with regular interrupts, but only this happens at a predictable point in the program - where the programmer placed this command. That's why software interrupts are not asynchronous (the program "knows" when it calls an interrupt).

Software interrupts in the literal sense, they are not interrupts, since they are only a specific way of calling procedures - not by address, but by number in the table.

Mechanism software interrupts was specifically introduced in order to:

  1. switching to system program modules did not occur simply as a transition to a subroutine, but in exactly the same way as regular interrupts. This ensures that the processor automatically switches to privileged mode with the ability to execute any commands.
  2. the use of software interrupts leads to more compact program code compared to the use of standard procedure execution instructions.

Example (software interrupts):

  • privileged command in user mode.
  • address is out of range.
  • violation of memory protection.
  • arithmetic overflow, page missing.
  • violation of segment protection.
  • going beyond the segment boundary.

A simplified diagram handling various types of interrupts can be represented as follows:

KP is an interrupt controller, has several levels (lines) for connecting device controllers (indicated in the diagram by KU). It is possible to connect controllers in cascade, when another interrupt controller is connected to one of its inputs. CPU – central processing unit.

Hardware interrupts are generated by computer devices when there is a need to service them. Unlike software interrupts, which are called scheduled by the application program itself, hardware interrupts always occur asynchronously with respect to running programs. In addition, multiple interrupts may occur simultaneously. The selection of one of them for processing is carried out based on the priorities assigned to each type of interrupt.

Each interrupt is assigned a unique priority. If several interrupts occur simultaneously, the system gives preference to the highest priority one, postponing the processing of the remaining interrupts for a while.

In the case of an interruption of the interrupt service program itself, we speak of nested interrupt. Priority levels are abbreviated IRQ0 - IRQ15 or IRQ0 - IRQ23 (depending on the chip implementation).

Interrupting the time of day is given maximum priority, because if it is constantly lost, the system clock will be incorrect. A keyboard interrupt is triggered when a key is pressed or released; it triggers a chain of events that usually ends with the key code being placed in the keyboard buffer (from where it can then be retrieved by software interrupts).

And finally, the implementation of the interrupt handling mechanism

In the machine, for each interrupt class there is a corresponding one. interrupt work area. For example, there is an area corresponding to a timer interrupt. When a timer interrupt occurs, the contents of all registers are stored in this area (for example, skipping the first few words). Then, from these missing words, the values ​​\u200b\u200bthat were previously entered there are extracted, which are rewritten into the counter (pointer) of the machine's commands and into the status word (or into the flag register). Loading and saving of registers is carried out automatically by the machine hardware.

Loading the program counter with a new address value automatically causes control to be transferred to the corresponding instruction. This address, previously stored in the interrupt work area, is the starting address of the standard timer interrupt routine. Loading the status word also causes certain changes in the state of the processor.

After performing any required action in response to an interrupt request, the standard interrupt routine executes a processor state load command, which transfers control to the interrupted program. This happens as follows: the load processor state command causes the stored contents of the status word, program counter and other registers to be loaded from the corresponding words of the save area, starting from the address specified in the command. This restores the register contents and processor state to what they were at the time of the interrupt. Control is then transferred to the command that was interrupted before execution.

Saving and restoring processor state and register contents is called context switch operation.

Most machines have what is called a status word, which contains some of the information used to handle interrupts. One of the elements of this word (for example, first) is a sign, determining which mode the processor is in: user or supervisor.

Regular programs are in user mode (sign equal to zero). When an interrupt occurs, the new content loaded status word has a flag of 1, which automatically puts the processor into supervisor mode. In this mode, it becomes possible to use privileged commands. Before the value of the status word is saved, another element (for example, the second one) will be set to a value indicating the reason for the interrupt:

  • A software interrupt displays the type of condition that caused it, such as division by zero.
  • When an I/O interrupt occurs, the channel number that caused the interrupt is recorded.

The third element indicates whether the processor is executing instructions or is idle. The fourth element contains a pointer identifying the currently executing program. The fifth element contains the interrupt mask, which is used to control interrupt enablement (MASK field).

This field is used to prevent certain types of interrupts from occurring until the first one has been processed. In MASK, each bit corresponds to a certain interrupt class. If a bit is set to 1, then interrupts of the corresponding class are enabled, if set to 0, then they are disabled. In the latter case they say that they camouflaged(they are also called prohibited or closed). However, masked interrupts are not lost because the signal that caused the interrupt is retained by the hardware. An interrupt temporarily delayed in this way is called postponed. When (due to MASK being cleared) interrupts of the corresponding class are enabled again, the signal is recognized and the interrupt occurs.

Interrupt masking is under the control of the operating system and depends on the MASK value in the status word, which is stored in advance in the work area of ​​each interrupt. It is possible to disable all interrupts by setting all MASK bits to zero. In reality there is no need to do this.

A common problem with the Windows operating system of any edition is the loading of computer resources by “internal” processes. One such process is a system interrupt, which can seriously load the computer's resources, which will be displayed in the Task Manager. The most common situation is when a system interrupt loads the processor, causing the computer to seriously lose performance. In this article, we will look at why this happens and whether it is possible to disable system interrupts in Windows.

System interrupts: what is this process

The System Interrupts process is constantly running by default in the Windows operating system, but during normal operation it should not load system components by more than 5%. If this process has a more serious impact on computer resources, this indicates a hardware problem, namely a malfunction of one of the computer components.

When “System interrupts” load the processor, this may indicate problems with the video card, motherboard, RAM or other element of the system unit. The central processor tries to supplement the missing power resulting from the malfunction of the component using its own resources, as evidenced by the “System Interrupts” process. Most often, the problem of malfunctioning computer components is associated with complete or partial incompatibility of the running program (or game) with the drivers of the computer components.

How to disable system interrupts

As noted above, system interrupts are nothing more than an indicator that Windows is making additional access to CPU resources. It is not possible to disable system interrupts to improve computer performance, and you need to look for a problem in the operation of PC components. To do this, it is convenient to use the DPC Latency Checker application, which can be downloaded for free on the Internet from the developers’ website. The program allows you to identify faulty computer components.

To diagnose your system with the DPC Latency Checker application, launch it and wait. It will take some time to check the computer, after which the user will see on the graph if there are problems in the operation of system components. The application will also indicate possible errors and advise you to look for them by disconnecting the devices.

To do this, go to “Device Manager” by right-clicking on “Start” and selecting the appropriate item, and start disabling devices one by one. After each shutdown, check in the Task Manager and the DPC Latency Checker application to see if the problems with CPU load due to system interrupts have been resolved. If the problem persists, turn the device back on and move on to the next one.

Important: While disabling components in Device Manager, do not disable Computer, Processor, and System Devices, otherwise this will cause the computer to reboot unexpectedly.

When you find a device that, when disconnected, will reduce the load on the processor to normal, update the drivers for this component from the official developer website.

Note: If attempts have been made to disable all system components, but the System Interrupts process continues to load the system, try updating the processor drivers.

In a situation where the tips given above do not help to cope with the problem of processor loading by system interrupts, you can try the following methods to correct the situation:

It is worth noting that you should not disable system interrupts through the Task Manager; this will cause the system to crash, but will not solve the problem.

Probably the most common interrupt contention (IRQ) is related to the integrated serial COM2 port found on modern motherboards and the internal modem (meaning a full internal PC modem, not a software modem, also called WinModem). The fact is that a full-fledged internal modem already has support for a certain port; By default, this port is assigned to COM2, and the system usually also has a second serial port enabled. Thus, the system ends up with two identical ports that use the same resources (interrupts and I/O port addresses).

The solution to this problem is quite simple: you should enter the system BIOS Setup and disable the built-in COM2 port. Additionally, you might consider disabling the COM1 port, which is also rarely used. Disabling unused COMx ports is one of the best ways to free up interrupts (IRQs) for other devices.

Another common conflict also involves serial ports. In the standard interrupt allocation table, you may have noticed that IRQ3 is assigned to COM2 and IRQ4 is assigned to COM1. The problem arises when additional COM3 and/or COM4 ports are added to the system and free interrupts are not manually assigned to them (by default they use the same IRQ3 and IRQ4).

Adding to the complexity, some port cards do not allow the selection of interrupts other than IRQ3 and IRQ4. As a result, assigning IRQ3 to COM4 and IRQ4 to COM3 results in a conflict with COM1 and COM2 that also use these interrupts: the two ports cannot share the same interrupt control channel at the same time. When working in DOS, this was possible because only one task could be performed at a time, but in Windows and OS/2 this is completely impossible. In order for a computer to be able to use more than two parallel COM ports, a multiport card is required, which, in addition to interrupts numbered 3 and 4, allows the use of additional interrupts. Sharing interrupts is in principle acceptable for devices that would not normally operate simultaneously (or continuously). Ports do not fall into this device category. You can use the scanner and modem interrupts together, but even in this case, if they are used simultaneously, a conflict will arise. Fortunately, most devices that previously used ports (such as mice, label printers, and external modems) now connect to USB ports, so today's computer users shouldn't have to deal with the need to support multiple ports.

If you still need to use multiple serial ports, the best solution is to buy a multiport card, which either provides the ability to set non-conflicting interrupts, or contains its own processor that allows you to distribute one system interrupt among several ports. Some older multiport cards had an ISA interface, but today they have been replaced by PCI cards, which also have performance advantages.

If some device mentioned in the table is missing (for example, the built-in mouse port (IRQ12) or the second parallel port (IRQ5)), their interrupts can be considered available. For example, a second parallel port can be found extremely rarely, so the IRQ5 interrupt assigned to it is most often used for the sound adapter card. Similarly, IRQ15 is used for the secondary IDE controller. If the system does not have disk devices connected to the secondary IDE channel, you can disable this controller in the BIOS, thereby freeing up another interrupt for other devices.

It should be noted that the easiest way to check your interrupt settings is in Windows Device Manager. In Windows 95b, there is the HWDIAG program, and in Windows 98 and later, there is the System Information console. These utilities allow you to get a detailed report on resource usage in the system, as well as installed device drivers and Windows registry entries for each device. On Windows XP and Vista systems, system information is provided by the Msinfo32 program.

To ensure the maximum number of shared interrupts possible on a modern system without ISA sockets, follow these steps when running the system BIOS.

  1. Disable all unused ports in the system BIOS. For example, if you are using USB ports instead of serial and parallel ports, disable them. As a result, up to three interrupts can be released.
  2. Specify the IRQ interrupt released in step 1 in the list of available interrupts for PCI/PnP devices. Depending on the BIOS version, the corresponding parameters are available in the PnP/PCI Resource Exclusion or PnP/PCI Configuration section.
  3. Enable the Reset Configuration Data option to clear the IRQ routing tables in the CMOS memory.
  4. Save your changes and exit the BIOS setup utility.

In this article I would like to talk about what may never remind you of yourself, and may even cost your nerves after assembling or upgrading a computer: freezes, spontaneous reboots, persistent reluctance to boot, constant “blue screens of death”, inability to detect devices, incorrect work... The list goes on for a long time. Very often, such “glitches” occur precisely because of interruptions, and if you are interested in computers, then you should definitely know where and why such problems appear and, probably most importantly, how to deal with them.

What it is?

Interrupts or IRQ (Interrupt Request) are signals that tell the processor that it is necessary to process a request received from a device, and the controller of this very device sends these signals to the processor, that is, with the help of IRQ the processor responds to various events.

It just so happens that when developing any technology, some restrictions are created, not on purpose, of course, but because of some feature of this innovation or simply a shortcoming. The same thing happened with interruptions. Initially, when IBM was developing the IBM PC architecture (already in 1980-81 of the last millennium), not so many of them were laid down (8), then, however, they added the same number, taking one “old” interrupt under the controller of the new ones, but I I wouldn’t say that this was enough. And then IBM ceased to be the only one working on the PC platform, and, in order to avoid incompatibility with others, no one added any more interrupts.

What problems might there be?

When the IBM PC architecture was just being created, few interrupts were created, only eight, as I already wrote, and they were given to all sorts of “nonsense”, like COM ports, although the IBM engineers are justified by the fact that there was not much choice, they had to look for it later. Obviously, no one predicted such a future for the platform, so for its highlight, that is, the possibility of expansion, only one interrupt was left, which was then occupied by the controller of the second “eight” IRQ. However, it is worth noting that additional interrupts could (and can) be released by disabling the various ISA devices that occupy them: ports, floppy drives. So, errors, or conflicts, occur when several devices try to operate on the same interrupt. This is very problematic, because many modern devices, especially sound cards and all kinds of multimedia processors, carry several devices at once. Even the simplest “sound speakers” have at least four devices on board. This is what an interrupt map looks like in a modern computer:

IRQ Description
0 Timer
1 Keyboard
2 Controller IRQ 8-15
3 COM2
4 COM1
5 LPT2
6 FDD controller
7 LPT1
8 Real Time Clock
9 Free
10 Free
11 Free
12 PS/2 (for mouse)
13 Coprocessor
14 HDD controller
15 HDD controller

So what does this mean? Can you install only three additional devices on a modern computer? Judging by the table, yes, but not everything is so scary. For example, do you have an LPT2 port? I doubt it very much. This means that if there is no port, then the interrupt is free. So, theoretically, the following interrupts can be released:

IRQ Description
3 The port can be freed up by disabling it in the BIOS. I think in most cases he is already free.
4 You can also turn it off. But it is used much more often: mice, modems, scanners.
5 I have already written about this. Almost always free.
6 If you are assembling a new computer, especially for home, the benefits of the good old flopper are much less than even a couple of years ago. Many people already have CD-RW drives. More space, more reliable, faster, although it’s too early to bury FDD... The flop can be disabled and free up IRQ.
7 If you have a USB printer, you can bury...
12 Most modern computers have mice like this. You can install a rodent on COM, but you will block another interrupt, you can also buy a mouse on USB, but this will be a manic fight for IRQ :)
14 Weak without a screw? Although, theoretically, it is possible...
15 Even if you only have two IDE devices, it is better to separate them into two different channels. It will work faster. But the interrupt can be released.

It's already easier. But is this enough? I go into system properties (I have Windows XP Professional). Start -> All Programs -> Accessories -> System Tools -> System Information. Further in the program window: Hardware resources -> Interrupts (IRQ). This is what I see there:

IRQ Description
0 System timer
1 Standard (101/102 keys) or PS/2 Microsoft Natural keyboard
3 Serial port (COM2)
4 Serial port (COM1)
5 Conexant SoftK56 Data Fax Voice Speakerphone
5
5 VIA Rev 5 USB Universal Host Controller
6 Standard floppy controller
8 CMOS and clock
9 Microsoft ACPI compliant system
10 Avance AC"97 Audio for VIA (R) Audio Controller
11 ATI RADEON VE DDR
12 PS/2 compatible mouse
13 Numerical data processor
14 Primary IDE channel
15 Secondary IDE channel

The question is: what does my internal modem, which, by the way, carries several devices, do on one interrupt (from the missing LPT2) with two USB controllers at once? Here's what.

A solution has been found

It's the beginning of the nineties. The system bus (ISA - Industrial Standard Architecture), which operated at the processor frequency, has already exhausted itself. And all because it could normally transmit data only at a frequency of 8 MHz, which was quite enough for all sorts of PC/XT/AT/286/386. And such an advanced processor as the 486 worked at a much higher frequency. I had to slow down this bus, which had a negative effect on the frequency. In 1989, a 32-bit EISA bus was developed - Extended Industrial Standard Architecture, which operated at a frequency of 10 MHz, but this was just an attempt to make a bicycle out of a cart, simply correcting ISA errors. Around this time, IBM created the MCA bus, which did not catch on. The VESA bus (or VL-bus) was also created, but it could only work with the Intel 486. And so in 1991, as an internal project, Intel began developing a completely new local PCI bus - Personal Component Interconnect. It was developed, one might say, from scratch, and was not just another patch to ISA, which gave it great advantages. For example, it operated at a fixed frequency of 33 MHz, plus the processor had its own high-speed bus, which allowed it to access the cache and RAM at the frequency at which it needed, and not rely on the technical limitations of the local bus. The new PCI bus could carry a decent load: up to ten slots. All video adapters are connected to PCI, because the AGP bus is just a “screwed-on” PCI with a higher clock frequency - 66 MHz. The ISA system bus, which is present on all modern computers in the form of COM and LPT ports and floppy disks, is also connected to it (via the controller). True, the need for it is becoming less and less: flop drives are idle due to the fault of CD-R/RW, COM/LPT due to the fault of USB... So this PCI bus, without which not a single modern motherboard can do, has become a solution to the problem of interruptions.

As you know, computers can only operate with “1” and “0” or “there is a signal” and “there is no signal.” If an ISA device puts a “1” signal on the line, then no matter how you set your units to another device on the same line, the controller will not respond to them. In the case of PCI, the controller checks the signal source and only then processes it. This allows you to place several devices on one interrupt. Theoretically, yes, but keep in mind that you should not “hang” older and newer devices on the same IRQ channel. There is also an opinion that you should not put anything on the same interrupt with the sound card, errors may appear. This, of course, does not always happen, but it is better to think of something more reliable.

We've arrived...

You are a good person, you don’t mind anything for your computer. So you bought the coolest video card, printer, scanner, professional sound, and aggravated this matter with a modem, network adapter, and even a TV tuner. That's where the "glitches" started. No matter how you swap them in the slots, nothing works, no matter what. What to do?

Setting interrupts from the BIOS

So on what basis are interruptions distributed? When the system boots, the BIOS distributes interrupts as follows: the IRQ lines of all devices that support Plug"n"Play technology, and these are all modern devices, receive one free interrupt. If the interrupts are over, but there are still uncovered devices, the BIOS distributes them in a second round, which is why it turns out that several devices received one interrupt. Everything will work wonderfully if two PCI devices receive one interrupt, but what if PCI + ISA or ISA + ISA? That's it, conflict. We need to get our hands on this process.

Next, it's worth noting that I'm using an Epox 8K3AP motherboard with Award BIOS 6.00PG. The most convenient and logical way to configure IRQs is to assign them manually. Go to PCI/PnP Configurations. There are INT Pin n Assignment settings (this is mine, but you may have this too), and names such as Slot n Use IRQ (I remember exactly, it was like that in Award BIOS v. 4.51 PG); PCI Slot n Priority or something something like that). Each item in this menu corresponds to one of four IRQ lines, so you can assign a different interrupt to each line.

There is another way to reassign IRQs. Go to the same PCI/PnP Configurations, there is an IRQ resources item (to go there you need to set the value of the Resources controlled by parameter to Manual), and this is exactly what we need now. There will be settings for each possible interrupt. I'm pretty sure that all numbers will have an option related to the PCI bus, for example, PCI/ISA or PCI device, it depends on your BIOS version. But we need one or more interrupts to remain missed, that is, reserved for ISA devices. So, on the interrupt that you want to leave, you simply set a value like Legacy ISA. In more modern computers, everything has become much simpler due to the lack of ISA slots, which means that you cannot add your own ISA devices, and the system itself will deal with system ones, such as a flop or serial/parallel ports. In such systems, the value Reserved appears instead of the Legacy ISA value, that is, you can simply leave the interrupt free. This may be needed in a rather theoretical case, if you received a device that does not support Plug"n"Play, then the BIOS simply will not see it.

There is another useful item in the same menu. Information about installed hardware is stored in ESCD (Extended System Configuration Data). This information is checked each time before accessing the hard drive to start the operating system. Naturally, when the configuration changes, the ESCD is updated, and when an update occurs, the IRQs also change. Setting the Reset Configuration Data option to Enabled will reset the ESCD the next time you restart.

Award 6.00, which is the BIOS installed on most motherboards, has another interesting “feature”. If you go to Power Management Setup "IRQ/Event Activity Detect" IRQs Activity Monitoring, then there you can configure which devices will wake up the computer at which interrupts. There you can also see the current distribution of IRQ numbers, but you can’t always rely on this, and here’s why:

Setting up interrupts from Windows

After the BIOS, Windows pokes its nose into the process of distributing IRQ numbers. In order for it to do everything correctly, even though Windows does not always interfere in this process, you must ALWAYS have the latest motherboard drivers. This is very important, especially if you built/bought a modern computer, with a motherboard on a new or relatively new chipset and installed some kind of Windows 98 on it all... Personally, I know a lot of people who think something like this: on my motherboard There are no bells and whistles on the board, everything is according to the standard, no “firewood” is needed... This is completely wrong. For the system to function properly, especially when interrupts are shared, Windows needs to recognize the chipset and load the IRQ Miniport. Don’t forget to also install fresh or at least “native” drivers for all devices, this will help the system work correctly.

If you are using Windows 9x, then in order to find out whether interrupts are distributed correctly or to correct them, go to the system properties, to do this, on the Devices tab, find the System devices scroll, and then PCI Bus. If the IRQ Miniport is loaded, then everything is fine. In Win 9x, you can reserve interrupts, just like in the BIOS. In the same device manager, find Computer and call its properties. But in order to set a specific interrupt for a specific device, you need to go to its properties and on the Resources tab set the desired interrupt. Unfortunately, this is only possible in Win 9x; in Win XP, I neither looked for nor found how to cancel the automatic configuration.

If you are using the newer Win 2000 or XP, which in my opinion is a more reasonable choice, then you may encounter some problems. Do you know what ACPI (Advanced Configuration and Power Interface) is? This is a special configuration interface. It contains a lot of useful things, but in Win 2K/XP it can really annoy you. Especially if the system has ISA boards. Because of it, Windows distributes all PCI devices that are located in the same connectors to one interrupt (that’s why I have a USB with a modem on IRQ 5, and the rest on others), well, at least the contents of the AGP slot and the AC "97 codec they didn’t push it there ;). Because of this, if you do not turn off ACPI in the BIOS before installing Windows, you won’t be able to reassign IRQs. I already wrote above how to see their distribution. And to change the situation, you will have to turn off ACPI in the BIOS (ACPI Functions item). in the Power Management Setup section) and change the Computer device driver in the device manager from Computer with ACPI to Standard Computer Although, personally, I would not really like to lose such functions directly related to ACPI, such as automatically turning off the computer or turning it on from the keyboard. By the way. , sometimes this method of canceling ACPI does not work, so you have to turn it off in the BIOS and rearrange Windows.