I've tested my OS on my laptop with i5 and on a laptop of a friend and on different emulators(qemu -kernel, qemu -cdrom, VMWare), and everything was fine.
Code: Select all
//....
/*ICW1*/
outb(PIC_MASTER_CONTROL_PORT, ICW1_ENABLE_ICW4 | ICW1_INIT);
outb(PIC_SLAVE_CONTROL_PORT, ICW1_ENABLE_ICW4 | ICW1_INIT);
//If i put asm("cli"); asm("hlt"); here, everything is fine and the processor halts
/* ICW2 */
outb(PIC_MASTER_DATA_PORT, ICW2_MASTER_OFFSET_INTERRUPT_SERVICE_ROUTINES);
outb(PIC_SLAVE_DATA_PORT, ICW2_SLAVE_OFFSET_INTERRUPT_SERVICE_ROUTINES);
//PC reboots here.
/* ICW3*/
outb(PIC_MASTER_DATA_PORT, ICW3_MASTER_2ND_LINE_CONNECTED_TO_SLAVE);
outb(PIC_SLAVE_DATA_PORT, ICW3_SLAVE_CONNECTED_TO_MASTER_2ND_LINE);
//...
I tried to make some delays after each outb, but that didn't bring any positive result.
Thanks for advance.