Hi,
I am confused at the point where we set registers as soon as we into protected mode. Especially when setting stack-segment with the same selector as data-segment. This means that they will have the same base-limit address. My question is this: Stack,data and code won't 'interfere' with each other while they are in the same segment(just different access-types)?Thanks.
Segments initiation problem
Moderator:Moderators
Re: Segments initiation problem
Hello,
The code, data, and stack all share the same linear address space and so can interfere with the others if not careful. This reflects a flat address space where segmentation is not used (all kernel segments start and end at the same place.) Of course, you can always still use segmentation but its not really useful if you plan to use paging and makes compatibility harder (other architectures that don't support it and C compilers that assume a flat memory model.)
The code, data, and stack all share the same linear address space and so can interfere with the others if not careful. This reflects a flat address space where segmentation is not used (all kernel segments start and end at the same place.) Of course, you can always still use segmentation but its not really useful if you plan to use paging and makes compatibility harder (other architectures that don't support it and C compilers that assume a flat memory model.)