Re: interrupt magic

From: Anton Altaparmakov (aia21@cam.ac.uk)
Date: Sat Sep 23 2000 - 08:22:19 EDT

  • Next message: Peter Samuelson: "Re: Is now possible to mount the same filesystem at multiple mountpoints?"

    I can't remember anything about protected mode interrupt handlers nor have
    I ever looked at Linux interrupt handling but at least in real mode from my
    good old PC/DOS programming days I seem to remember that if you are hooking
    a hardware interrupt vector then you have to issue a end of interrupt (EOI)
    to the 8259A interrupt controller (PIC) before doing the iret, for example
    like so:

    ; Note: this uses "dst, src" operand ordering not the
    ; "reversed" ordering used by gcc asm.
             push ax
             mov al,20h ; Nonspecific EOI
             out 20h,al ; Write PIC output control word OCW2
             pop ax
             iret

    Might this be the problem (or whatever the equivalent specific is in Linux
    / pmode)?

    Just my 2p.

    Regards,

             Anton

    At 07:49 23/09/2000, Julien Oster wrote:
    >Hello,
    >
    >I'm currently using 2.4.0-test5 and no APIC.
    >
    >I'm trying to learn a bit about protected mode programming on i386
    >architectures.
    >
    >Looking at the interrupts, the interrupt descriptor table, interrupt gates
    >and all those things I wanted to experiment a bit to see if I understood
    >correctly.
    >
    >So I wrote the opcode 0xCF (IRET) into the first byte of the interrupt
    >handler for the keyboard controller (I got the address of the handler
    >directly from the IDT) and checked if I still have a keyboard.
    >
    >No, I had no keyboard, but one thing confused me. After waiting a bit,
    >I got the kernel complaining about lost interrupts from the harddisk. The
    >ethernet card said pretty much the same thing. And plugging in an USB
    >device made the kernel also complain.
    >
    >So it seems that I "masked" out a little bit more than the keyboard
    >interrupt (IRQ 1, entry 0x21 in the IDT). And it happens with _every_
    >interrupt I try with: when it gets called once, the kernel fails.
    >
    >I did a lot of debugging, read a lot of C and assembler source code... but
    >I simply can't find what it is that renders the computer in such an
    >unusable state.
    >
    >So... what do interrupt handlers, even the dummy standard ones, do to keep
    >the system running... and why won't it work without that?
    >
    >Thanks,
    >Julien
    >
    >
    >
    >-
    >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    >the body of a message to majordomo@vger.kernel.org
    >Please read the FAQ at http://www.tux.org/lkml/

    -- 
    

    "Education is what remains after one has forgotten everything he learned in school." - Albert Einstein

    -- Anton Altaparmakov Voice: 01223-333541(lab) / 07712-632205(mobile) Christ's College eMail: AntonA@bigfoot.com Cambridge CB2 3BU ICQ: 8561279 United Kingdom WWW: http://www-stu.christs.cam.ac.uk/~aia21/

    - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 08:22:36 EDT