LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices



Reply
 
Search this Thread
Old 08-15-2008, 04:02 AM   #1
valpa
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Rep: Reputation: 15
Question about page allocation when program initializing and running?


From book "ULK, 3rd", it state:
The term demand paging denotes a dynamic memory allocation technique that consists of 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.

I can conclude from these words that the program loader do not load program's .text .data segment into RAM, right?

And, What's the duty of program loader
 
Old 08-15-2008, 09:53 AM   #2
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,143

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
Quote:
Originally Posted by valpa View Post
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.
 
Old 08-19-2008, 12:26 AM   #3
valpa
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Quote:
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.
Does that mean all loadable sections of executable program are loaded via Page Exception?? From the very first instruction??

Since Page Fault Exception handler never do relocation, how about relocation execution program?

Last edited by valpa; 08-19-2008 at 12:28 AM.
 
  


Reply

Tags
management, page


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
General question on program running in console Eredeath Linux - Newbie 6 08-06-2008 02:19 PM
kernel memory page allocation problem erik_wout_ew2 Linux - Kernel 0 10-31-2006 11:27 AM
Question about running a program as a service darbien Programming 12 10-25-2006 08:19 PM
Apache running program when user leaves page The_Nerd Linux - Software 0 05-23-2004 03:30 PM
scripting or programming question - running a program ewto Linux - Newbie 2 09-05-2003 12:46 PM


All times are GMT -5. The time now is 01:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration