API & ABI
2016-03-30 10:13
309 查看
http://hi.baidu.com/sanwewe/blog/item/01d8c1d41eb67105a08bb73f.html
api 是应用程序和操作系统之间的接口,凡是符合该api标准的应用程序都可以在支持该api的操作系统上编译通过。
abi 是二进制级别的接口,规定了二进制文件的格式、内容、装载/卸载程序的要求、函数调用时的参数传递
规则、寄存器、堆栈的使用。
如果操作系统都支持该api,但是机器的体系结构不同即他们的abi不同,那么在一个机器上生成的二进制代码是不可以在另外一台机器上面运行成功的,可能因为函数调用的参数传递规则不同或者其他由abi定义的行为产生的差异性。
其实关键的是abi定义了运行时的兼容性问题,这个问题是api无法解决的。api所能解决的是静态状态下的兼容性问题。
以下摘自encyclopedia of PCMAGZINE
Definition of: API
(Application Programming Interface)
A language and message format used by an application program to
communicate with the operating system or some other control program
such as a database management system (DBMS) or communications protocol.
APIs are implemented by writing function calls in the program, which
provide the linkage to the required subroutine for execution. Thus, an
API implies that some program module is available in the computer to
perform the operation or that it must be linked into the existing
program to perform the tasks.
Definition of ABI
(Application Binary Interface)
A specification for a specific hardware platform combined with the
operating system. It is one step beyond the application program
interface (API), which defines the calls from the application to the
operating system. The ABI defines the API plus the machine language for
a particular CPU family. An API does not ensure runtime compatibility,
but an ABI does, because it defines the machine language, or runtime,
format.
api 是应用程序和操作系统之间的接口,凡是符合该api标准的应用程序都可以在支持该api的操作系统上编译通过。
abi 是二进制级别的接口,规定了二进制文件的格式、内容、装载/卸载程序的要求、函数调用时的参数传递
规则、寄存器、堆栈的使用。
如果操作系统都支持该api,但是机器的体系结构不同即他们的abi不同,那么在一个机器上生成的二进制代码是不可以在另外一台机器上面运行成功的,可能因为函数调用的参数传递规则不同或者其他由abi定义的行为产生的差异性。
其实关键的是abi定义了运行时的兼容性问题,这个问题是api无法解决的。api所能解决的是静态状态下的兼容性问题。
以下摘自encyclopedia of PCMAGZINE
Definition of: API
(Application Programming Interface)
A language and message format used by an application program to
communicate with the operating system or some other control program
such as a database management system (DBMS) or communications protocol.
APIs are implemented by writing function calls in the program, which
provide the linkage to the required subroutine for execution. Thus, an
API implies that some program module is available in the computer to
perform the operation or that it must be linked into the existing
program to perform the tasks.
Definition of ABI
(Application Binary Interface)
A specification for a specific hardware platform combined with the
operating system. It is one step beyond the application program
interface (API), which defines the calls from the application to the
operating system. The ABI defines the API plus the machine language for
a particular CPU family. An API does not ensure runtime compatibility,
but an ABI does, because it defines the machine language, or runtime,
format.
相关文章推荐
- LAMP架构中,php 与 php、php与C语言程序等 之间 的网络通信 问题
- Writing Linux LCD drivers—深入分析framebuffer设备驱动的结构
- 告诉你一个真实的毛岸英
- 僵死进程
- 【poj 3267】The Cow Lexicon 题意&题解&代码(C++)
- 望江南
- Spring 注释 @Autowired 和@Resource 的区别
- js前端培训
- linux kernel的中断子系统之(三):IRQ number和中断描述符
- (超简单2016年发布有效)PDF格式电子书批量删除顽固链接水印
- UGUI点击事件(委托)
- 阳性水草与阴性水草的区分
- Linux kernel的中断子系统之(二):IRQ Domain介绍
- 机器学习笔记—支持向量机(1)
- C++ 函数匹配和作用域声明
- JavaScript事件代理和委托(Delegation)
- 序列化、反序列化到底是什么?
- Android三种实现定时器的方法
- 设置mysql密码
- 毛泽东时代为我国经济腾飞奠定了基础