Multitasking hell

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.
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Post by matthias »

hailstorm wrote:Matthias: Ouch. :D

DELETED TEXT...
[dutch]
ach ja, iig bedankt voor het idee :p
[/dutch]
The source of my problems is in the source.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post by carbonBased »

matthias wrote:
hailstorm wrote:I hope this helps:

Try to clear the busy bit of the tss you are switching to, before you make the switch. It might be the problem...
Uhm if you'd taken some time to read my code, you could have seen that the task only has the interruptable flag set. So won't help
That's what you create the TSS with, yes, but the processor can/will still set the busy bit itself. You're switch_to function doesn't check for the busy bit before jumping to the task.

Also, I hate to say it, but usually the more code that's posted, the less likely people are to actually look at it :) I'm bad for it, myself.

Sadly, I can't be of much help... :( Are you still not getting any exceptions? In other words, is it still just hanging? This seems weird to me... makes me think the jump is actually happening, but potentially to the wrong location. If something were wrong and/or corrupt, I would expect an exception (have you confirmed that all your exception handlers are functional, by the way?)

Cheers,
Jeff
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Post by matthias »

carbonBased wrote:snap
Sorry for the longish code, my ISR's are OK, and do you know what the strangest part is? On a real machine it hangs but in MSVPC it restarts due to an error, would like to know which. No exception is given not even an invalid TSS exception or something.
The source of my problems is in the source.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post by hailstorm »

You are welcome!

I thought I saw an error, but luckily i saw just in time your type of linked list handling.. Sorry for that.

[dutch]
Dat vind ik trouwens een beetje vage code, het is volgens mij nog niet helemaal af... [-X In die zin, het is waarschijnlijk niet volledig operationeel. Helaas lag daar de fout echter niet...
[/dutch]
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Post by matthias »

hailstorm wrote:You are welcome!

I thought I saw an error, but luckily i saw just in time your type of linked list handling.. Sorry for that.

[dutch]
Dat vind ik trouwens een beetje vage code, het is volgens mij nog niet helemaal af... [-X In die zin, het is waarschijnlijk niet volledig operationeel. Helaas lag daar de fout echter niet...
[/dutch]
offtopic:

Ik kan wel die code helemaal uitschrijven, maar wat heeft dat voor zin als de basis niet werkt?! Het is idd nog niet af dat klopt, maar ik wil eerst even het switchen aan de praat krijgen, daarna ga ik verder op prioriteiten, mutexes semaphores noem het maar op ;)
The source of my problems is in the source.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post by hailstorm »

B.t.w. Can you explain in detail how the cpu is going to use the/your stack on a task switch? I think that the stack is initialized in an faulty way.
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Post by matthias »

Tomorrow, I have to go and sleep now, have to go and study tomorrow.

Regards,

Matthias
The source of my problems is in the source.
blackcatcoder
Member
Member
Posts: 132
Joined: Wed Nov 03, 2004 12:00 am
Location: Austria
Contact:

Post by blackcatcoder »

I think the problem is in the GDT table.

Can you please post the GDT entry for the tss ?
Post Reply