Interrupt problems
Interrupt problems
Hello,
My OS started to do some horrible things. I am programming PIT now to IRQ0. I am in PM. Before this, all interrupts and exceptions were fine, I could call the interrupt with no problems. But now I checked and no interrupt is working at all. Here's what I get from bochs:
Bochs is exiting with the following message:
[CPU ] exception(): 3rd (13) exception with no resolution
And here's from VMWare:
Virtual machine kernel stack error (hardware reset)
Does anyone had the same problem or anyone has a good ideas about it?
Thanks in advance.
My OS started to do some horrible things. I am programming PIT now to IRQ0. I am in PM. Before this, all interrupts and exceptions were fine, I could call the interrupt with no problems. But now I checked and no interrupt is working at all. Here's what I get from bochs:
Bochs is exiting with the following message:
[CPU ] exception(): 3rd (13) exception with no resolution
And here's from VMWare:
Virtual machine kernel stack error (hardware reset)
Does anyone had the same problem or anyone has a good ideas about it?
Thanks in advance.
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Re:Interrupt problems
- IDT entery for IRQ0 is corrupted
- PIC/IOAPIC controller is not configured correctly (sending bad vector to CPU)
- Bad interrupt handler
- and many other things...
Be more specific, provide some code ...
- PIC/IOAPIC controller is not configured correctly (sending bad vector to CPU)
- Bad interrupt handler
- and many other things...
Be more specific, provide some code ...
It could mean anything. This happens all the time.Bochs is exiting with the following message:
[CPU ] exception(): 3rd (13) exception with no resolution
And here's from VMWare:
Virtual machine kernel stack error (hardware reset)
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:Interrupt problems
If you look in the bochs log file. It should show something like.
[start of log]
... way down at the end .... <down>
... right here it would have some (x) exception or two.
... check here to find what exception or IRQ is causing it..
[CPU ] exception(): 3rd (13) exception with no resolution
... down here is the dump_cpu information ...
[end of log]
I am not certain but that stack error could be causing the exception 13. It might be the interrupt handler starting.. using the stack with a bad SS or ESP or something.
[start of log]
... way down at the end .... <down>
... right here it would have some (x) exception or two.
... check here to find what exception or IRQ is causing it..
[CPU ] exception(): 3rd (13) exception with no resolution
... down here is the dump_cpu information ...
[end of log]
I am not certain but that stack error could be causing the exception 13. It might be the interrupt handler starting.. using the stack with a bad SS or ESP or something.
Re:Interrupt problems
Here is my kernel's source code:
http://193.219.53.186/vladas/kernel.zip
http://193.219.53.186/vladas/kernel.zip
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
Re:Interrupt problems
Code: Select all
oid LoadIDT() {
??????idtreg.limit = &idt[0] - &idt[1] - 1;
??????idtreg.base = (unsigned long*) &idt[0];
??????asm volatile("LIDT %0 ": :"m" (idtreg));
??????
??????// Exceptions
??????SetInt(0, int00);
??????SetInt(0, int01);
??????SetInt(0, int02);
??????SetInt(0, int03);
??????SetInt(0, int04);
??????SetInt(0, int05);
??????SetInt(0, int06);
??????SetInt(0, int07);
??????SetInt(0, int08);
??????SetInt(0, int09);
??????SetInt(0, int10);
??????SetInt(0, int12);
??????SetInt(0, int13);
??????SetInt(0, int14);
??????SetInt(0, int16);
??????SetInt(0, int17);
??????SetInt(0, int18);
??????SetInt(0, int19);
??????
??????// IRQs
??????SetInt(0, int32); // PIT - Programmable Interval Timer IRQ
}
void SetInt(int number, void *handler) {
??????idt[number].low_offset = (unsigned int)handler;
??????idt[number].seg_selector = 0x08;
??????idt[number].settings = 0x8E00;
??????idt[number].high_offset = ((unsigned int)handler >> 16);
}
Code: Select all
int_descriptor idt[1];
Code: Select all
int_descriptor idt[255];
Code: Select all
???init_pics();
???print("PICs remapped to 0x20 and 0x28.", white);
???
???LoadIDT();
Code: Select all
void init_pics() {
??????outb(0x20, 0x11);
??????outb(0xA0, 0x11);
??????outb(0x21, 0x20);
??????outb(0xA1, 0x28);
??????outb(0x21, 0x04);
??????outb(0xA1, 0x02);
??????outb(0x21, 0x01);
??????outb(0xA1, 0x01);
??????outb(0x21, 0xFF);
}
Code: Select all
outb(0x21, 0xFF)
Code: Select all
[BITS 32]
[GLOBAL entry]
[EXTERN _k_main]
entry:
???call _k_main
???cli
???hlt
Code: Select all
_int32:
mov byte [0xb800], 'a'
???mov byte [0xb801], 0x07
???;jmp $
???;hlt
???;cmp byte [_isrfunc], 1
???
???;je pitsleep
???;jmp pitwrong
???;pitsleep:
???;???call _pit_sleep
???;pitwrong:
???;mov al, 20h
???;out 20h, al
???iret
Code: Select all
cli
hlt
iret
Code: Select all
>>>> int_descriptor idt[1];
asm volatile ("int $0x1");
The PIC was remapped to 0x20.
Code: Select all
>>>>outb(0x21, 0x20);
>>>>outb(0xA1, 0x28);
asm volatile ("int $0x20") - calls the timer.
Code: Select all
SetInt(0x20, int32); // PIT - Programmable Interval Timer IRQ
Re:Interrupt problems
Code: Select all
int_descriptor idt[1];
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
Re:Interrupt problems
How did that work before setting PIT?
Re:Interrupt problems
I don't know, maybe I checked it when I didn't have exceptions yet. With one interrupt only as a test one. I think:)