Code: Select all
_isr0:
pusha
push gs
push fs
push ds
push es
extern _interrupt_0
call _interrupt_0
pop es
pop ds
pop fs
pop gs
popa
iret
;and here is my loadidt:
_loadidt:
push ebp
mov ebp,esp
lidt [ebp+8]
mov esp,ebp
pop ebp
ret
EDIT: and here is the PIC remap code:
Code: Select all
#ifndef PIC_H
#define PIC_H
#include "main.h"
#define PIC1 0x20
#define PIC2 0xA0
#define PIC1_COMMAND PIC1
#define PIC1_DATA (PIC1+1)
#define PIC2_COMMAND PIC2
#define PIC2_DATA (PIC2+1)
#define PIC_EOI 0x20
#define ICW1_ICW4 0x01
#define ICW1_SINGLE 0x02
#define ICW1_INTERVAL4 0x04
#define ICW1_LEVEL 0x08
#define ICW1_INIT 0x10
#define ICW4_8086 0x01
#define ICW4_AUTO 0x02
#define ICW4_BUF_SLAVE 0x08
#define ICW4_BUF_MASTER 0x0C
#define ICW4_SFNM 0x10
void remap_pics(int pic1, int pic2)
{
UCHAR a1, a2;
a1=inb(PIC1_DATA);
a2=inb(PIC2_DATA);
outb(PIC1_COMMAND, ICW1_INIT+ICW1_ICW4);
outb(PIC2_COMMAND, ICW1_INIT+ICW1_ICW4);
outb(PIC1_DATA, pic1);
outb(PIC2_DATA, pic2);
outb(PIC1_DATA, 4);
outb(PIC2_DATA, 2);
outb(PIC1_DATA, ICW4_8086);
outb(PIC2_DATA, ICW4_8086);
outb(PIC1_DATA, a1);
outb(PIC2_DATA, a2);
}
//Which I call like this:
remap_pics(0x20, 0x28);