giving separate stack space for each task
How to give separate stack space for each task while developing own OS.....
|
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. |
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. |