apis

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
robert macabre
Member
Member
Posts: 26
Joined: Fri Nov 18, 2005 12:00 am
Location: a perfect view out of the novotel

apis

Post by robert macabre »

i was just wondering, is there a 'correct' way to make the apis available for programs i write for my operating system? i'm not to that point yet, but i'm always thinking ahead, you know? my plan right now is to pass a pointer to an "api index" function to the program, but as i recall from my experience with palm os (i never programmed c/asm in windows) you raised an interrupt to use the apis. is there a standard way to do incorporate apis, and if not, what are some of your methods?
laika, come home.
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: apis

Post by Da_Maestro »

Most OSs will require the software to raise an interrupt to access the API.

However, 386 Protected mode has a special function for this, called a "Call Gate"

A call gate works by assigning a segment number to the entry point of your API. A call or jump to any point inside this segment is redirected to the entry point of the API.

You can use the protection mechanisms to determine who can use the call gate. See the intel-docs for info on call gates
http://www.intel.com
Last edited by Da_Maestro on Tue Jan 24, 2006 12:00 am, edited 1 time in total.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
robert macabre
Member
Member
Posts: 26
Joined: Fri Nov 18, 2005 12:00 am
Location: a perfect view out of the novotel

Re: apis

Post by robert macabre »

well, i'm really not too concerned about protection because my os has one main application. i think i may just go with my "index function" method though because, like i said, it's going to have one main use. though i am interested in the plain interrupt method, it seems like it could be simple but i'm not sure of the best way to go about trying that. do you know of any online resources where i could read some theory or see some examples?
laika, come home.
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: apis

Post by Da_Maestro »

Linux source code

It's available in a few places....google it :-)
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
robert macabre
Member
Member
Posts: 26
Joined: Fri Nov 18, 2005 12:00 am
Location: a perfect view out of the novotel

Re: apis

Post by robert macabre »

thanks :]
laika, come home.
Post Reply