PIC initialization problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kwr
Posts: 1
Joined: Sun May 03, 2015 11:46 am

PIC initialization problem

Post by kwr »

Somewhy I can't run my OS on my PC with AMD Sempron. It crashes after ICW2.
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);

        //...
Full source can be found at https://github.com/K-Wr/ZftOS/blob/mast ... terrupts.c
I tried to make some delays after each outb, but that didn't bring any positive result.
Thanks for advance.
Post Reply