From owner-freebsd-questions Wed Jan 24 16:40:41 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id AA81537B400 for ; Wed, 24 Jan 2001 16:40:23 -0800 (PST) Received: (qmail 16474 invoked by uid 100); 25 Jan 2001 00:40:22 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14959.30198.637838.708542@guru.mired.org> Date: Wed, 24 Jan 2001 18:40:22 -0600 (CST) To: Tim McMillen Cc: Roelof Osinga , "Albert D. Cahalan" , questions@FreeBSD.ORG Subject: API vs. ABI (Was: OT: non-Unix history (Was: FreeBSD vs linux)) 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> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Tim McMillen 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. 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