Call gate from C

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

Call gate from C

Post by pepito »

Can I use a 'call gate' directly from C?
How?

pepito
Jamethiel

RE:Call gate from C

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

RE:Call gate from C

Post by pepito »

I use the DJGPP compiler... It is possible?

pepito
CarbonBased

RE:Call gate from C

Post 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
Post Reply