POV-Ray : Newsgroups : povray.off-topic : Does anybody know this? : Re: Does anybody know this? Server Time
11 Oct 2024 11:10:39 EDT (-0400)
  Re: Does anybody know this?  
From: Sabrina Kilian
Date: 1 Dec 2007 11:53:14
Message: <4751917a@news.povray.org>
Orchid XP v7 wrote:
> Warp wrote:
>> Orchid XP v7 <voi### [at] devnull> wrote:
>>> How does this stuff work with Windoze?
>>
>>   When you have your compiler installed, you download the Windows SDK
>> which contains the necessary header files. Then you call the functions
>> defined in these header files.
> 
> Fair enough, but how exactly does it work under the covers? As in, how
> does it ultimately find the address of the code you want to call?
> 
> (I'm sure in the normal course of events you'll never need to know or
> care about this stuff. I'm just curios...)

The compiler recognizes that you are calling functions that aren't being
directly compiled into the code, and leaves dummy values in the Jump
instructions. During the linking or loading phase, those values are
replaced by addresses in memory.

At a lower level, the object files/DLL have a table that instructs the
linker/loader as to how far into that file a certain function is. When
that gets loaded into memory, in the case of a DLL at run time, the
linker/loader can take that memory location and basically do a search
and replace.

There is another level of misdirection, in that most of the time the
library is loaded into the user processes' virtual memory. This means
the address isn't really the actual location of the library in RAM, but
that is more a hardware level thing.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.