LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   giving separate stack space for each task (https://www.linuxquestions.org/questions/programming-9/giving-separate-stack-space-for-each-task-533197/)

manas_sem 02-28-2007 04:01 AM

giving separate stack space for each task
 
How to give separate stack space for each task while developing own OS.....

theNbomr 03-01-2007 03:48 PM

I'm no OS designer, but I have done a fair amount of assembler programming on x86 architecture. The stack is just wherever the stack pointer points, so when you make a context switch, simply save the value of the stack pointer, and load the stack pointer with a saved value from the new context. Create new stack space for each process at the time the process is created. If you are doing the whole thing in a high level language, then I'm at a loss.

--- rod.

Mara 03-01-2007 04:34 PM

I agree with theNbomr. I will also add that the things you need to do depend on the processor. Stack pointer (if exists) is places in different places, is changed in a different ways and so on.

In general, you may see stack as an area of memory allocated when the task is created with an address written in such a place that push/pop-like operations work.


All times are GMT -5. The time now is 01:13 PM.