Re: excec( ) implementation basics [are ELFs mmap-ed to Process Address
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: excec( ) implementation basics [are ELFs mmap-ed to Process Address




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: excec( ) implementation basics [are ELFs mmap-ed to Process Address  
moi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-18-06 10:55 PM

50295@web.de wrote:
> 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 ;-]

> 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.

> Thanks,
>
> - Olumide
>

HTH,
AvK





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:17 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register