Im trying to ensure I understand the difference and implications of one model over the other.
Flat is where you set up 2 Segments in the GDT, a Code and a Data segment, both running at CPL=0, and set to use from 0 -> 4GB of memory.
Segmented is where you set up (for example) 4 Segments in the GDT, a Code and Data segment running at CPL=0 using say the first 1MB of memory; and a Code and Data segment running at CPL=3, which uses from 1MB -> 4GB of memory.
If you choose the segmented model, when you perform a System Call you would need to modify CS and DS to point to the kernel segments, and then restore them where you exit correct? The OS would still be responsible for ensuring 2 user processes do not access each others memory, but the cpu can now ensure user processes do not touch kernel memory.
Under the flat model, the os is responsible for all memory security.
Flat vs Segmented Memory Model
-
- Posts: 7
- Joined: Fri Feb 04, 2005 12:00 am
Flat vs Segmented Memory Model
---
Unfortunately, while all answers are replies, not all replies are answers
Unfortunately, while all answers are replies, not all replies are answers
Re: Flat vs Segmented Memory Model
1-The relation CPL/DPL is arbitrary - project dependent only.
2-Segmentation don't depend only of OS - There are few compiler that suport segmentation in 32 bits. OS menange securrity in any model of memory - A hardware security can be achived by virtual memory suported by a large number of architetures.
3 - Segmentation is out of future x86 .
4 - Segmentation increase the programing dificulty.
2-Segmentation don't depend only of OS - There are few compiler that suport segmentation in 32 bits. OS menange securrity in any model of memory - A hardware security can be achived by virtual memory suported by a large number of architetures.
3 - Segmentation is out of future x86 .
4 - Segmentation increase the programing dificulty.