Here's the PIC init code NOTE: Calling int 0x09 in software works...... But KB press has no response.....
;Sending ICW1 to master and slave PIC mov al,00010001b out 0x20,al out 0xA0,al
;Sending base vector number of master and slave PIC mov al,20h ;base vector number of master PIC out 0x21,al mov al,28h ;base vector number of slave PIC out 0xA1,al
;Sending connection parameters between the PICs to the PICs mov al,00000100b ;IRQ2 is connected to slave PIC out 0x21,al mov al,2h ;IRQ2 of master PIC is used for the slave PIC out 0xA1,al
;Sending ICW4 to master and slave PIC mov al,00000001b ;Intel environment, manual EOI out 0x21,al out 0xA1,al ;This ends the initialization of the PICs
------------------------------------------------------------------------
;The KB Handler -- Sample Handler, just to check it is invoked or not KB_HANDLER:
pusha push gs mov ax,LINEAR_SEL mov gs,ax
mov ebx, [KB_LOC] ; KB_LOC is a Double word initialzed to 0xb8000 INC ebx INC ebx ; Every IRQ1 causes a 'K' to be displayed at consecutive location
mov byte[gs:ebx],'K'
mov al,20h ;EOI command out 020h,al ;Sending the command to the slave PIC pop gs popa iret
|