Page 1 of 1

Call gate from C

Posted: Mon Jul 14, 2003 11:00 pm
by pepito
Can I use a 'call gate' directly from C?
How?

pepito

RE:Call gate from C

Posted: Mon Jul 14, 2003 11:00 pm
by Jamethiel
It depends on the compiler.

Make a FAR function pointer variable, and assign a pointer with the call gate as a segment to it. Then call through it.

Exactly how you accomplish this depends on your compiler.

RE:Call gate from C

Posted: Tue Jul 15, 2003 11:00 pm
by pepito
I use the DJGPP compiler... It is possible?

pepito

RE:Call gate from C

Posted: Wed Jul 16, 2003 11:00 pm
by CarbonBased
Yes, you can use DJGPP to do this... possibly...

DJGPP has support for far calls, but I'm not sure how the implementation is written (I haven't used dos in ages ;)).  I would imagine a lot of the implementation is based on DPMI, in which case, it's useless for OS Development.  You'd have to write it yourself, which is going to require assembly language.

It's not a difficult process, anyway.  Just use a little inline assembly, and you'll be all set.

Cheers,
Jeff