Quote:
Originally Posted by valpa
The term demand paging denotes
|
I expect most of the uses of "demand paging" one could find are inconsistent with that definition. The whole field lacks consistent terminology.
Quote:
deferring page frame allocation until the last possible moment until the process attempts to address a page that is not present in RAM, thus causing a Page Fault exception.
|
But that does describe a behavior common to OS's that support paging. And Linux generally works that way.
Quote:
the program loader do not load program's .text .data segment into RAM, right?
|
Correct. Much of the .text segment will just be mapped into the process's address space without actually being read from the executable file. It doesn't go into physical ram until actually accessed.
Quote:
What's the duty of program loader
|
I'm sure I'm forgetting or never knew some important details. But so far as I understand, the major job of a loader is to resolve dependencies. If the executable should not start without a specific .so, the loader should identify that .so (specific path instead of the possibly generic name given by the executable) and select an address at which to map that .so. I'm not sure to what extent it also reads and patches those pages of the executable and the .so that depend on the address the loader selected for the .so.