Replying to the whole list this time:

Hi,
>>
>> If you configure two segments over the same range in the physical address
>> space in the GDT there will be no protection enforced as such. You have
>> effectively allowed read/write and execute to all the address space.
>> However, and I may be wrong on this one, it was my understanding that with a
>> flat-model the LDT can be used to have task specific segments, allowing you
>> to set up and enforce 'separate' data, stack and code segments for tasks.
>>
>> However, even this isn't necessary if you use a flat-model in the GDT and
>> then use paging; the individual pages can be configured as
>> read/write/execute. As such, any area of the address space that you want to
>> act as a code "segment", for example, could be marked as read/executable,
>> whilst a data or stack "segment" (or set of pages) could be marked as
>> read/write.
>>
>> With regards to your final question, I am not entirely sure. I suspect
>> that you would need to modify and then load in a new GDT in order to adjust
>> the segment sizes.
>>
>> Hope this helps,
>>
>> Michael F Clarke
>> MEng Software Engineering
>> PhD Student, Aberystwyth University
>>
>>
>> On 29 September 2010 18:28, Sri Ram Vemulpali <[email protected]>wrote:
>>
>>> Hi All,
>>>
>>>      I have a doubt regarding implementation of segmentation in OS.
>>>
>>>      Since GDT is used to implement the segmentation, in that table
>>> you add all segments descriptors dividing the linear address space.
>>>      In a flat model you assign for every descriptor the base as 0x0
>>> and limit as 4GB. This way every DS,CS sees the complete 4GB memory.
>>>      But how is the segment protection implemented. I mean if
>>> segments are not divided with different base address and limit
>>> preventing
>>>      overlapping, there is a possibility of stepping in to other
>>> segment. So, why is the flat model is implemented. Also, If I strictly
>>> implement
>>>      segmentation without paging, then I can have only 8192 segments
>>> of size 64kb for whole 4GB address space. Then I have all the segment
>>>      descriptors in the GDT. Now if some task uses all its complete
>>> segment size, and needs some more space, then is it possible to assign
>>>      another DS segment. If so, how is that accomplished, since we
>>> need to load in DS new index of segment descriptor and keep track of
>>> all
>>>      indexes in to GDT.
>>>
>>>      Can anyone explain how above mentioned things can be achieved.
>>> --
>>> Regards,
>>> Sri.
>>>
>>> --
>>> To unsubscribe from this list: send an email with
>>> "unsubscribe kernelnewbies" to [email protected]
>>> Please read the FAQ at http://kernelnewbies.org/FAQ
>>>
>>>
>>
>

Reply via email to