Protecting Task Memory
Posted: Sun Nov 09, 2003 9:53 pm
I can only really think of two ways to keep tasks from writing in each other's memory. The first is to change the segment and limits whenever you switch tasks (so if a task tries to go out of its area, it will seg fault). This seems a pretty reasonable thing to do on the x86, but apparently most systems don't support segments.
The second is to only have the page tables for the current task marked as present. However, this would mean that during task switching you would have to mark all the old task's memory as not present and all the new task's memory as present. So I'm wondering if it is reasonable to do all this during the task switch or if it would take up too much time (task switching is supposed to be as fast as possible after all).
Also, are there any other ways of doing this?
The second is to only have the page tables for the current task marked as present. However, this would mean that during task switching you would have to mark all the old task's memory as not present and all the new task's memory as present. So I'm wondering if it is reasonable to do all this during the task switch or if it would take up too much time (task switching is supposed to be as fast as possible after all).
Also, are there any other ways of doing this?