Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!indri!nic.MR.NET!shamash!tank!uxc!uxc.cso.uiuc.edu!addamax!schmitz From: schmitz@addamax.UUCP Newsgroups: comp.os.minix Subject: reprogrramming 8959A's Message-ID: <16200002@addamax> Date: 23 Apr 89 23:02:00 GMT Lines: 85 Nf-ID: #N:addamax:16200002:000:2205 Nf-From: addamax.UUCP!schmitz Apr 23 18:02:00 1989 Here's the code to reprogram the 8259A's for use in protected mode: --Michael schmitz@uiucuxc.cs.uiuc.edu!addamax inta00 EQU 020h ; I/O port for first 8259A inta01 EQU 021h ; mask register port for first 8259A intb00 EQU 0a0h ; I/O port for second 8259A -- not used below intb01 EQU 0a1h ; mask register port for second 8259A ;----------------------------------------------------------------------------; ; init_8259a ; ; Sends initialization sequences to the two 8259A's. Note that they ; ; are programmed to generate interrupt vectors starting with 32. ; ; Thus the clock, on IRQ0, generates interrupt number 32, and the ; ; keyboard, on IRQ1, generates interrupt number 33. ; ;----------------------------------------------------------------------------; init_8259a PROC mov al, 011h out inta00, al jmp SHORT $ + 2 mov al, 020h ; interrupts start at 32 out inta01, al jmp SHORT $ + 2 mov al, 04h out inta01, al jmp SHORT $ + 2 mov al, 01h out inta01, al jmp SHORT $ + 2 mov al, 011h out intb01, al jmp SHORT $ + 2 mov al, 028h ; interrupts start at 40 out intb01, al jmp SHORT $ + 2 mov al, 02h out intb01, al jmp SHORT $ + 2 mov al, 01h out intb01, al jmp SHORT $ + 2 ret init_8259a ENDP PAGE ;----------------------------------------------------------------------------; ; restore_8259a ; ; Sends initialization sequences to the two 8259A's. Note that they ; ; are programmed to generate interrupt vectors starting with 8. ; ; Thus the clock, on IRQ0, generates interrupt number 8, and the ; ; keyboard, on IRQ1, generates interrupt number 9. ; ;----------------------------------------------------------------------------; restore_8259a PROC mov al, 011h out inta00, al jmp SHORT $ + 2 mov al, 8h ; interrupts start at 8 out inta01, al jmp SHORT $ + 2 mov al, 04h out inta01, al jmp SHORT $ + 2 mov al, 01h out inta01, al jmp SHORT $ + 2 mov al, 011h out intb01, al jmp SHORT $ + 2 mov al, 10h ; interrupts start at 16 out intb01, al jmp SHORT $ + 2 mov al, 02h out intb01, al jmp SHORT $ + 2 mov al, 01h out intb01, al jmp SHORT $ + 2 ret restore_8259a ENDP