I was looking at different relationships that can exist between an operating system and a user process. I came across the figure below. It shows an architecture where the OS functions execute with user processes.
1) I wanted clarification on the part of the diagram labeled OS function. Is this part exactly the same for all user processes? In other words, is this shared code that each process accesses?
2) Is the only difference between the process switching functions (grey base in diagram) and the OS functions that the OS functions run as user processes whereas the process switching functions operate as OS processes? Why does there have to be such a difference?
Accompanying text to provide context to the diagram:
"An alternative that is common with operating systems on smaller computers (PCs, workstations) is to execute virtually all OS software in the context of a user process.The view is that the OS is primarily a collection of routines that the user calls to perform various functions, executed within the environment of the user’s process.... At any given point, the OS is managing n process images......... When an interrupt, trap, or supervisor call occurs, the processor is placed in kernel mode and control is passed to the OS. To pass control from a user program to the OS, the mode context is saved and a mode switch takes place to an operating system routine. However, execution continues within the current user process. Thus, a process switch is not performed, just a mode switch within the same process."
(P.136 Operating Systems by Stallings)