Reputation: 59
I study about segmentation and paging in linux.i want to know is it correct? segmentation : a user process into multiple segments and assigns a different protection mode for each of them.
Paging:In virtual Memory is used for demand-paged
Do i understand correctly ?
Upvotes: 1
Views: 200
Reputation: 56038
The English in your question is very poor, and I'm not sure I understood it completely. But here's the answer to the question I think you were asking.
Segments are not a feature of the core of Linux exactly. They are a feature of the object-file format. And yes, you have their purpose largely correct. They exist to flag different kinds of data in an executable image. The loader, upon loading the binary into memory, will then assign the data to pages, and it will change the protection mode on some pages in response to the segment type.
And yes, paging is a virtual memory concept, and much more a part of core Linux. A page is a region of memory that can be assigned a protection mode, be swapped to disk or be otherwise manipulated.
Now, when an ELF executable is mapped into memory, it is 'demand paged'. This means that all the pages that make up the executable are flagged as needing to be swapped in. This is so the OS doesn't have to fetch all the pages off disk into memory when the program may only need some of them.
Upvotes: 3