Broadly speaking, the gate crossing mechanisms for system calls may be divided into three categories, each of which presents different problems for parameter passing. For each of these broad categories, there are two issues the kernel must address when it receives a pointer from the user: How does the kernel determine if the pointer is valid -- that is, does the pointer point to an object the user is entitled to manipulate, and how does the kernel access the object referenced by the pointer?
First, there are systems like the Hawk where the memory management unit is turned off whenever a system call takes place, so user programs run in virtual memory, while kernel code runs in real memory.
Second, there are systems like Multics, where the kernel and user program share an address space (it was a virtual address space in Multics, but this the problem is the same if it is not virtual).
Third, there are systems where the user operates in one virtual address space and the kernel operates in another. In such a system, a kernel call can be viewed as switching from one page table to another.
Write pseudocode for a disk interrupt service routine for this system, and then modify it to support a decent disk scheduling algorithm.
How would you change the data structures detailed in part A if the page table were divided into segments, where each segment of the page table can be stored either in a page frame or on disk. Assume, for the moment, that there is only one address space.
How would you change the data structures detailed in part A to allow multiple coexisting address spaces, perhaps one per process, so that the pages occupying the page frames in main memory could, at times, belong to different address spaces.
What is the relationship, if any, between the heap manager used to allocate space for user applications and the heap manager user to allocate space for kernel data structures? Do these heap managers have any necessary relationship to the paged virtual memory addressing structure of the machine?
Does the mechanism for allocating page frames or pages to virtual address spaces have any necessary relationship to these heap managers?