Page 1 of 1

Basic Multitasking

Posted: Sat Apr 12, 2003 4:08 pm
by shad
In order to switch to a task its necessary to use the SEG:OFF syntax right? Anyway, how do you do that from C, with an address thats not constant. For instance: void exec_task( unsigned long *offset );

call CODE_SEL: PARAM1, would be what id think, but obviously that doesnt work or i would have posted this.

Re:Basic Multitasking

Posted: Sat Apr 12, 2003 4:39 pm
by Ozguxxx
First of all there is nothing like "basic multitasking" because multitasking is itself a huge research area among computer science guys and these days in which I am trying to get out of this process management hell, I cannot think of something like "basic multitasking". (dont take this personally... :) ) Anyway... If you want to do "basic task switching", -it seems you are trying to use hardware task switching- you must do either of these:

call TSS_Desciptor:0 -> nests current task, you must iret after finishing new task. Back link of outgoing task is set.

jmp TSS_Desciptor:0 -> does not nest current task, no iret is needed, I recommend using this since I cannot find any place for using nested tasks for now. :)

Hope these help... Good luck.

Re:Basic Multitasking

Posted: Sat Apr 12, 2003 4:48 pm
by shad
Thanks, can i get an example of that in C? There is multitasking done at the software level without the tss and ****?

Re:Basic Multitasking

Posted: Sun Apr 13, 2003 4:40 am
by Ozguxxx
Oh, so your doing software task switching, Im sorry then you will have to go here and do whatever you can: http://www.mega-tokyo.com/forum/index.php?board=1;action=search