POV-Ray : Newsgroups : povray.off-topic : Does anybody know this? : Re: Does anybody know this? Server Time
11 Oct 2024 11:12:03 EDT (-0400)
  Re: Does anybody know this?  
From: Darren New
Date: 1 Dec 2007 13:08:02
Message: <4751a302$1@news.povray.org>
Warp wrote:
> Orchid XP v7 <voi### [at] devnull> wrote:
>> 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?
> 
>   AFAIK the system libraries perform kernel calls (in both Windows and
> Linux). Basically the kernel knows the library and accepts its calls
> (while it's not possible to do it directly from user code). A kernel
> function call is probably little more than a 'call' machine code to
> a certain address in the kernel space. 

That's called a "call gate". Not many CPUs use that any more, especially 
those with memory mapping and VM handling.

Wikipedia is your friend: http://en.wikipedia.org/wiki/System_call

(BTW, this is why C isn't particularly better than any other language 
for this stuff. There's no way to specify something like "load register 
EAX with 0x80 and then do a system interrupt call.)

BTW, even CP/M on the 8080 and DOS on the 8086 used interrupt calls to 
dispatch to the OS, even tho there were no privilege reasons to do so.

If you're not familiar with how modern systems do interrupts and 
privileges and such at the assember/hardware level, it's hard to go into 
too much detail. If you *are* familiar, then it should be pretty 
obvious. :-)

-- 
   Darren New / San Diego, CA, USA (PST)
     It's not feature creep if you put it
     at the end and adjust the release date.


Post a reply to this message

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