Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Loader (computing)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Responsibilities== In [[Unix]], the loader is the [[callback (computer science)|handler]] for the [[system call]] <code>execve()</code>.<ref>{{cite web |url=http://www.opengroup.org/onlinepubs/000095399/functions/exec.html |title=exec |publisher=The Open Group |work=The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition |access-date=2008-06-23}}</ref> The Unix loader's tasks include: # validation (permissions, memory requirements etc.); # [[memory-mapped file|memory-mapping]] the executable object from the disk into [[main memory]]; # copying the [[command-line argument]]s into virtual memory; # initializing [[Processor register|registers]] (e.g., the stack pointer); # jumping to the program entry point (<code>_start</code>). In [[Microsoft Windows]] 7 and above, the loader is the <code>LdrInitializeThunk</code> function contained in [[ntdll.dll]], which does the following: # initialisation of structures in the DLL itself (i.e. [[critical section]]s, module lists); # validation of executable to load; # creation of a [[dynamic memory allocation|heap]] (via the function <code>RtlCreateHeap</code>); # allocation of environment variable block and PATH block; # addition of executable and NTDLL to the module list (a [[doubly-linked list]]); # loading of [[KERNEL32.DLL]] to obtain several important functions, for instance <code>BaseThreadInitThunk</code>; # loading of executable's imports (i.e. [[dynamic-link library|dynamic-link libraries]]) recursively (check the imports' imports, their imports and so on); # in debug mode, raising of system breakpoint; # initialisation of DLLs; # garbage collection; # calling <code>NtContinue</code> on the context parameter given to the loader function (i.e. jumping to <code>RtlUserThreadStart</code>, that will start the executable)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)