hiya,
with a friend we're trying to code tss-based task switching into our system. i don't want to paste the code cause there's quite a bit of it, and it's (at least my version :p ) a bit of a mess but maybe someone has encountered the same problem, and found a way around it.
thing is that the system only performs the first switch, and then stops reacting to anything ? even irqs don?t work (but the process keeps going ? eg if it?s printing some text in a loop, it keeps doing so; even tried using 'sti' inside the 'new' process). the fact that it performs the first switch suggests, that the tss structure is set up properly (as the address of the process is in the tss). also the cs/ds/es regs are set up with the same addresses they were set when setting up the gdt, and entering pmode. interrupts are enabled in eflags (set to 0x0022 at ?startup?). we don?t use any ldt?s.
so basically when a far jump/call to a tss descriptor is performed, the system switches to the process the address of which is in the tss that the descriptor is pointing to but it?s a no-go from there. any ideas? where should we start searching for the reason? thanks.
oh, just wanted to add that we both did the thing independently (not viewing the other ones code), and we both have the same problem.
problem with tss-based task switching
Re: problem with tss-based task switching
user code cannot STI, however interupts should be loaded with flags from stack after a hard interupt
btw: what are you useing to trigger the task-switch? IRQ0?
if your using the PIT (IRQ0) then did you acknowledge?
best guess (without more information) would be:
your using the clock(IRQ0) to trigger your task-switch
your failing to send an an acknowledge to the PIC
the PIC thinks your still processing the IRQ, and therefore doesn't send you any more (first clue should be your keyboard doesn't work anymore either)
btw: what are you useing to trigger the task-switch? IRQ0?
if your using the PIT (IRQ0) then did you acknowledge?
best guess (without more information) would be:
your using the clock(IRQ0) to trigger your task-switch
your failing to send an an acknowledge to the PIC
the PIC thinks your still processing the IRQ, and therefore doesn't send you any more (first clue should be your keyboard doesn't work anymore either)
you're so right :)
ah! that was such a silly mistake not sending the PIC the 'end of interrupt' message!
thanks so much, you're a life saver. it's a school project, and we were stuck for like three days on this thing :p
thanks so much, you're a life saver. it's a school project, and we were stuck for like three days on this thing :p