Code: Select all
int a = 3, b = 0;
a/=b;
idt creat
Code: Select all
void IDT::createIdt(int n,uint offset,ushort selector,byte options)
{
InterruptDescriptorTable *idt=(InterruptDescriptorTable*) IDT_BASE + n;
ushort lOff,uOff;
lOff = offset & 0x0000FFFF; // Clear First 16 bits
uOff = (offset & 0xFFFF0000) >> 16; // Clear Lower 16 bits
idt->lowerOffset = lOff;
idt->selector = selector;
idt->reserved = 0x00;
idt->options = options;
idt->upperOffset = uOff;
}
Code: Select all
outb ( MASTER_PORT_A , 0x11 );
outb ( SLAVE_PORT_A , 0x11 );
outb ( MASTER_PORT_B , 0x20);
outb ( SLAVE_PORT_B , 0x28);
outb ( MASTER_PORT_B , 0x04);
outb ( SLAVE_PORT_B , 0x02);
outb ( MASTER_PORT_B , 0x01);
outb ( SLAVE_PORT_B , 0x01);
outb ( MASTER_PORT_B , 0xFF);
outb ( SLAVE_PORT_B , 0xFF);
asm("sti");
Code: Select all
void PIC::enableIRQ ( byte irq )
{
if(irq > 15) return;
if(irq < 8)
{
outb(MASTER_PORT_B,inb(MASTER_PORT_B)&irq);
}
else
{
irq = irq - 8;
IRQSlaveStatus |= ( 0x01 << irq );
outb(SLAVE_PORT_B,(byte) ~IRQSlaveStatus);
IRQMasterStatus = IRQMasterStatus | 0x04;
outb(MASTER_PORT_B,(byte) ~IRQMasterStatus);
}
}
Code: Select all
(0) [0x00007575] 0008:00007575 (unk. ctxt): jmp .+0xfffffffe (0x00007575) ; ebfe
<bochs:3> info cpu
eax:0x00000202, ebx:0x00008c00, ecx:0x000b809e, edx:0x000b8001
ebp:0x00000000, esp:0x0000fb70, esi:0x00007154, edi:0x00005000
eip:0x00007575, eflags:0x00000206, inhibit_mask:0
cs:s=0x0008, dl=0x00000fff, dh=0x00c09a00, valid=1
ss:s=0x0010, dl=0x00000fff, dh=0x00c09300, valid=7
ds:s=0x0010, dl=0x00000fff, dh=0x00c09200, valid=7
es:s=0x0010, dl=0x00000fff, dh=0x00c09300, valid=1
fs:s=0x0010, dl=0x00000fff, dh=0x00c09300, valid=1
gs:s=0x0010, dl=0x00000fff, dh=0x00c09300, valid=1
ldtr:s=0x0000, dl=0x0000ffff, dh=0x00008200, valid=1
tr:s=0x0000, dl=0x0000ffff, dh=0x00008300, valid=1
gdtr:base=0x00006000, limit=0x800
idtr:base=0x00006800, limit=0x110
dr0:0x00000000, dr1:0x00000000, dr2:0x00000000
dr3:0x00000000, dr6:0xffff0ff0, dr7:0x00000400
cr0:0x80000011, cr1:0x00000000, cr2:0x00000000
cr3:0x00000000, cr4:0x00000000
done