Discussion:
Segment Lengths
(too old to reply)
Huyen Tue Dao
2005-03-30 07:51:40 UTC
Permalink
From what I understand, the user memory is allocated page by page, so
it's size will be some page-size multiple. However, there isn't any
kind of page alignment of segments correct? So the start and end of
segments can be in different pages, or segments can be smaller than a
page theoretically and start at a non-page aligned address? Therefore,
as we're creating the executable image we basically have to determine
how the user memory is split up into segments, where the borders of
pages are, and then memcpy accordingly?
Iulian Neamtiu
2005-03-30 14:43:11 UTC
Permalink
Segmentation is now way easier, since all user segments start at
USER_VM_START (2GB) and their size is USER_VM_SIZE(2GB) for all user
processes.

When you copy the data and text segments from the file, probably the
best way to go is to copy them into a contiguous malloc'ed buffer and
then copy pages individually form there into the physical pages for the
process; see section 'User Memory Mapping' in the project description.

Iulian
Post by Huyen Tue Dao
From what I understand, the user memory is allocated page by page, so
it's size will be some page-size multiple. However, there isn't any
kind of page alignment of segments correct? So the start and end of
segments can be in different pages, or segments can be smaller than a
page theoretically and start at a non-page aligned address? Therefore,
as we're creating the executable image we basically have to determine
how the user memory is split up into segments, where the borders of
pages are, and then memcpy accordingly?
Loading...