IRQ stop after multi-tasking
IRQ stop after multi-tasking
hi all, ok, i was just wondering if any one has had this problem, my kernel only gets 1 irq then no more???, the first thing i do at a switch is EOI, and i know it doesn't have to do with the task becouse task1 a is running before the first IRQ, just wondering if any one has had this problem ,thx
Re:IRQ stop after multi-tasking
There could be a few reasons why this is happening. What about...
1. When you return from yuor IRQ handler, are interrupts re-enabled again?
2. Are you returning to the correct process? (task1)
3. Does the EOI code work?
Perhaps you've fixed this problem already?
If not, you need to give more information about how you're doing things. Like are you using an interrupt gate, task gate, trap, etc..
Durand.
1. When you return from yuor IRQ handler, are interrupts re-enabled again?
2. Are you returning to the correct process? (task1)
3. Does the EOI code work?
Perhaps you've fixed this problem already?
If not, you need to give more information about how you're doing things. Like are you using an interrupt gate, task gate, trap, etc..
Durand.
Re:IRQ stop after multi-tasking
I must admit that the search function isn't always as helpful as it could be, but there have been so many threads on people only receiving one interrupt that I don't really see your question validity.GLneo wrote: hi all, ok, i was just wondering if any one has had this problem, my kernel only gets 1 irq then no more???, the first thing i do at a switch is EOI, and i know it doesn't have to do with the task becouse task1 a is running before the first IRQ, just wondering if any one has had this problem ,thx
Did you try to search before posting?
Re:IRQ stop after multi-tasking
@Candy: yes, i typed stuff like intruppt and multi-tasking stop nothing came back but junk
@durand: i'm just using an interrupt because i'm running all code in the kernel at ring0
@durand: i'm just using an interrupt because i'm running all code in the kernel at ring0
Re:IRQ stop after multi-tasking
K, well, what kind of interrupt? interrupt gate, trap gate, task gate.
So, from ring 0 to ring 0 and back again? If I recall correctly, the IF flag doesn't get re-enabled if you iret back from ring 0 to ring 0. (or something like that). but i'm not sure You should get your hands on the intel development manuals and examine the behaviour of the IF flag when you return through your particular interrupt mechanism.
http://www.intel.com/design/Pentium4/do ... tm#manuals
So, from ring 0 to ring 0 and back again? If I recall correctly, the IF flag doesn't get re-enabled if you iret back from ring 0 to ring 0. (or something like that). but i'm not sure You should get your hands on the intel development manuals and examine the behaviour of the IF flag when you return through your particular interrupt mechanism.
http://www.intel.com/design/Pentium4/do ... tm#manuals
Re:IRQ stop after multi-tasking
AFAIK, since the interrupt flag is part of eflags, it should get popped from the stack when you leave the interrupt service routine (with 'iret'). So when interrupts were enabled before you entered the isr, they should be re-enabled when you leave it.
However, when you do a task switch inside the ISR (e.g. you push the state and then swap the stack), are you sure that the new stack, from which you pop the state, also has the interrupt flag set? You should check this out.
cheers Joe
However, when you do a task switch inside the ISR (e.g. you push the state and then swap the stack), are you sure that the new stack, from which you pop the state, also has the interrupt flag set? You should check this out.
cheers Joe
Re:IRQ stop after multi-tasking
Okay, I checked. The IF flag is only restored if the CPL is less than or equal to the IOPL. And the IOPL is restored only if the CPL is 0. So, perhaps your problem also lies in the IOPL values?
You are doing an iret and not a ret? If your previous task keeps working, and you haven't complained otherwise, then your stack is probably correct .
It could just be privilege levels and the like... only you will know.
You are doing an iret and not a ret? If your previous task keeps working, and you haven't complained otherwise, then your stack is probably correct .
It could just be privilege levels and the like... only you will know.
Re:IRQ stop after multi-tasking
well, i can still manualy do it: asm("int 33"); and it swicthes fine but i can only use the keboard 1 time before a fail, so i dont think my tasking code is wrong, but is this correct for eflags:
Code: Select all
stack->eflags = 0x00000202;
Re:IRQ stop after multi-tasking
I know my IRQ is lower so right at the start i do a outport(0x20, 0x20);, but thx
Re:IRQ stop after multi-tasking
sorry, I didn't see that you had already written that in your first post. Never mind if my next proposal is even dumber ... ;D
But is it possible that your handler itself gets interrupted ?
But is it possible that your handler itself gets interrupted ?
Re:IRQ stop after multi-tasking
that could be happening, because i EOI at the start
p.s. how do you do outport in asm i've tryed:
p.s. how do you do outport in asm i've tryed:
Code: Select all
mov bl, 0x20
out bl, bl
Re:IRQ stop after multi-tasking
You can only use out with dx and al/ax/eax.GLneo wrote: that could be happening, because i EOI at the start
p.s. how do you do outport in asm i've tryed:Code: Select all
mov bl, 0x20 out bl, bl
Code: Select all
out dx, al
Re:IRQ stop after multi-tasking
i hate asm
what does
mean???
what does
Code: Select all
00003473225e[CPU ] load_seg_reg: GDT: FS: index(0b77) > limit(000017)
Re:IRQ stop after multi-tasking
Hi,
Bochs tried loading FS with a descriptor that is past the limit of the GDT.
Either your GDT limit is wrong, you're loading the wrong descriptor into FS, or the CPU jumped into the middle of nowhere and started executing the wrong thing. IMHO the last possibility is most likely...
Cheers,
Brendan
Code: Select all
00003473225e[CPU ] load_seg_reg: GDT: FS: index(0b77) > limit(000017)
Either your GDT limit is wrong, you're loading the wrong descriptor into FS, or the CPU jumped into the middle of nowhere and started executing the wrong thing. IMHO the last possibility is most likely...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:IRQ stop after multi-tasking
this is the kind of things you're very likely to encounter when your ISR are messing up the stack. You e.g. pushed fs then eax and you then pop fs without removing "eax" value first, which results in garbage being loaded in the segment register.