Vol. 3 3-5
PROTECTED-MODE MEMORY MANAGEMENT
More complexity can be added to this protected flat model to provide more protec-
tion. For example, for the paging mechanism to provide isolation between user and
supervisor code and data, four segments need to be defined: code and data
segments at privilege level 3 for the user, and code and data segments at privilege
level 0 for the supervisor. Usually these segments all overlay each other and start at
address 0 in the linear address space. This flat segmentation model along with a
simple paging structure can protect the operating system from applications, and by
adding a separate paging structure for each task or process, it can also protect appli-
cations from each other. Similar designs are used by several popular multitasking
operating systems.
3.2.3 Multi-Segment Model
A multi-segment model (such as the one shown in Figure 3-4) uses the full capabili-
ties of the segmentation mechanism to provided hardware enforced protection of
code, data structures, and programs and tasks. Here, each program (or task) is given
its own table of segment descriptors and its own segments. The segments can be
completely private to their assigned programs or shared among programs. Access to
all segments and to the execution environments of individual programs running on
the system is controlled by hardware.