|
|
|
|
|
|
| Author |
Message |
moi *nix forums beginner
Joined: 09 Oct 2005
Posts: 5
|
Posted: Wed Jan 18, 2006 5:18 pm Post subject:
Re: excec( ) implementation basics [are ELFs mmap-ed to Process Address space?]
|
|
|
50295@web.de wrote:
| Quote: | Hi -
I've been stracing loads of stuff lately, trying to and I'm wondering
how mmap actually words/is implemented on *NIX systems. I suspect
mmaping the executable (elf binary) to the process' address space would
be a good idea. Is this how mmap is implemented? I know shared
libraries are are implemented with mmap (and quite possibly shared
memory i.e. shmget etc), but I'm not sure how exec() is implemented.
Hints anyone?
|
The best way, IMHO is to look upon it is in terms of hardware/MMU.
mmap makes clever use of the hardware, by setting up pagetable-entries,
which point to the address space and the appropriate diskpages.
The first access to a mmapped page wil cause a (page not present)
pagefault, and the page will be read in by the pagefault handler.
("faulted in")
Copy-on-write is just a useful extension to this scheme.
Execution of pages is basically the same, except for relocations,
which have to be fixed up by the loader. Don't know how that works,
I suggest you need to read the sources for that ;-]
| Quote: | Please dont ask me to take a look at the source. I have, but it made my
head spin.
|
It is supposed to make the disks spin, not your head.
HTH,
AvK |
|
| Back to top |
|
 |
50295@web.de *nix forums beginner
Joined: 09 Feb 2005
Posts: 32
|
Posted: Wed Jan 18, 2006 4:56 pm Post subject:
excec( ) implementation basics [are ELFs mmap-ed to Process Address space?]
|
|
|
Hi -
I've been stracing loads of stuff lately, trying to and I'm wondering
how mmap actually words/is implemented on *NIX systems. I suspect
mmaping the executable (elf binary) to the process' address space would
be a good idea. Is this how mmap is implemented? I know shared
libraries are are implemented with mmap (and quite possibly shared
memory i.e. shmget etc), but I'm not sure how exec() is implemented.
Hints anyone?
Please dont ask me to take a look at the source. I have, but it made my
head spin.
Thanks,
- Olumide |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Nov 22, 2008 1:57 pm | All times are GMT
|
|
Mortgage | Myspace Backgrounds | Books | Credit Card Consolidation | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|