To: dtauritz AT wi DOT leidenuniv DOT nl (D.R.Tauritz) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Interrupt handling Date: Tue, 11 Oct 94 08:41:20 +0200 From: "Eli Zaretskii" > In the file sb.c (djgpp/contrib/sblaster) both protected mode and real mode > interrupt handlers are installed. Why is this? I thought DJGPP was a > protected mode only package! Your program indeed runs in protected mode, but the processor is still switched to real mode from time to time, e.g. when DOS services are required (file I/O etc.). If you only install a protected-mode interrupt handler, you will lose the interrupts which occur when the CPU is in real mode, because the mechanism for calling interrupt routine is entirely different in these two modes. > Anyway, I wrote something similar to the real & > protected mode combo used in sb.c, alas, without success, my interrupt > handler installs without giving an error but the installed interrupt routine > is never called... Does the original code of sb.c work for you? If so, the changes you've introduced are the culprit. One thing I would check (based on what you say about IRQ 10/INT 72h) is that you must enable both IRQ 10 in the second Programmable Interrupt Controller (PIC), at port 0xa0, and IRQ 2 in the first PIC, at port 0x20, during initialization. Also, at the end of the interrupt routine you must send ``End-of-interrupt'' (EOI) signal to both these PICs. The original code of sb.c only deals with PIC no.1, because it uses IRQ 7. Btw, the interrupts which come from the hardware peripherals like timer chip, SB card etc., are called _hardware_ interrupts. Software interrupt is the one invoked by the CPU by issuing the INT XX machine instruction. Eli Zaretskii