Page 2 of 2

Re:I'm Multitasking! (not sure why :) )

Posted: Wed Oct 12, 2005 5:09 pm
by Cjmovie

Code: Select all

 //PUSH ds, es, fs, gs / POP gs, fs, es, ds
*Stack-- = 0x10; //DS
*Stack-- = 0x10; //ES
*Stack-- = 0x10; //FS
*Stack-- = 0x10; //GS
to:

Code: Select all

 //PUSH ds, es, fs, gs / POP gs, fs, es, ds
*Stack-- = 0x10; //DS
*Stack-- = 0x10; //ES
*Stack-- = 0x10; //FS
*Stack = 0x10; //GS
I just noticed if I press continue, it will call my ISR, allowing me to see all the values in the dump offset by exactly one DWORD. So this fixes that.

Now another problem (I'm getting tired of having to ask questions/sorry for asking so many):

When it gets called, it never gets called again. It seems interrupts somehow got disabled or something.
The only thing is that I added an inline "sti" to the loop of both tasks, and it still won't return to the handler again.

Any ideas?

Re:I'm Multitasking! (not sure why :) )

Posted: Wed Oct 12, 2005 8:06 pm
by proxy
in the C handler send an EOI...

iirc it is outb(0x20, 0x20)

good luck

proxy

Re:I'm Multitasking! (not sure why :) )

Posted: Wed Oct 12, 2005 8:38 pm
by Cjmovie
Lol, I figured that out about...5 minutes ago.

[RANT]
I'm so happy! I figured it out myself! (well, the answer to THAT problem, at least)
[/RANT]

I'd like to thank you, proxy, and everyone else. My first multi-thread (not task, as it's all in the same address space...) OS.

[RANT]
Yay!
[/RANT]

Re:I'm Multitasking! (not sure why :) )

Posted: Wed Oct 12, 2005 9:26 pm
by proxy
one thing about your threads stack is you forgot that stacks are _pre_ decrement, not post so the correct code (which would have avoided your second to last problem) would be:

Code: Select all

*--stack = 0x10;
*--stack = 0x10;
*--stack = 0x10;
*--stack = 0x10;
etc etc

and doing so also eliminates the need to do these 2 lines of code:

Code: Select all


TaskList[a].esp0--;              //Offset kernel stack into actual 4kb page

TaskList[a].esp3--;              //Offset user/app stack into actual 4kb page
good luck and nice to see you got it working.

proxy

Re:I'm Multitasking! (not sure why :) )

Posted: Sat Nov 19, 2005 2:34 pm
by samuelgoto
I am having the same problem. Did you found the solution for this problem ? I am probably at the same point as you ( trying to implement multitasking with ring3->ring0 stack based task switch ).

If you did, please, give me a hint on how to debug ( since it is probably an assimetry between pushs and pops, loading garbage on a descriptor ) ...

Re:I'm Multitasking! (not sure why :) )

Posted: Sat Nov 19, 2005 7:49 pm
by Cjmovie
What same problem? And, I've yet to think about RING3 processes; I'm working on Driver Interfaces.....