Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2001 18:40:22 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Tim McMillen <timcm@umich.edu>
Cc:        Roelof Osinga <roelof@nisser.com>, "Albert D. Cahalan" <acahalan@cs.uml.edu>, questions@FreeBSD.ORG
Subject:   API vs. ABI (Was: OT: non-Unix history (Was: FreeBSD vs linux))
Message-ID:  <14959.30198.637838.708542@guru.mired.org>
In-Reply-To: <01012419080209.24525@tim.elnsng1.mi.home.com>
References:  <14957.31196.939559.889627@guru.mired.org> <14959.23870.728403.859934@guru.mired.org> <3A6F61DC.39E9CF0D@nisser.com> <01012419080209.24525@tim.elnsng1.mi.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Tim McMillen <timcm@umich.edu> types:
> 	The best case would be if there was a unified API (or ABI, I don't 
> understand the diff) that all applications could be written for.  This 

API is a programmers interface; the types used are programming
language types. ABI is a binary interface; the types used are the
types for the machine. Note that having an ABI implies that you've
specified a machine, but having an API doesn't.

So whereas an API might specify that foo accepts (int, long), the ABI
might call for a 16 bit int and a 32 bit int, two 32 bit ints, or a 32
bit int and a 64 bit int depending on the platform.

On the other hand, back in the days when compilers had both 16 and 32
bit modes, the ABI for foo might be fixed at a 16 bit int and a 32 bit
int, but the compiler would use an API of (int, long) in 16 bit mode,
and (short, int) in 32 bit mode.

Platforms that share an API can share source code. Platforms that
share an ABI can share binaries. When you compile a Linux programs to
run on FreeBSD, you're taking advantage of the API being similar
enough to allow that. When you run a Linux binary on FreeBSD, you're
taking advantage of FreeBSD emulating the Linux ABI.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14959.30198.637838.708542>