) What is Abi?

Source: Internet
Author: User

Abi is the protocol between systems and applications. A binary (exec, Lib) must comply with Abi to run on the corresponding system.
for example, no matter what kind of compiler I use on a PC, as long as I generate an elf file that complies with Linux, use the corresponding Instruction Set (such as Intel, PPC, or iSCSI ). it can be run on a Linux machine. call the system or someone else's lib.
Abi defines the binary file format and content, as well as the requirements for loading/uninstalling the Program , and the parameter transfer rules for function calls, registers, stack usage, etc.

Abi (Application binary Interface)CodeLayer-by-layer interface. First, let's talk about the API (especially the system call ),
An API is basically an interface unrelated to the hardware platform but closely related to the operating system. An API call defines an operation on the kernel and the operation parameters. Call the API in the form of C-language conferencing functions.

Abi is an interface closer to hardware than an API. It specifies the calling rules between binary codes. For example!
An application calls a function or system call in The. So library. If its compiler can find the called function or System
If it is called, the compilation can be the same, that is, the API used is correct. However, this call is far from successful .....

First, if the compiled code, library function, and System Call Code are not a hardware platform, the application cannot run together with the called code, the call fails.

Even if library functions, system calls, and CALLS run on the same hardware platform, they may not succeed. Because the program is eventually compiled into binary code and is loaded into the memory for running. Therefore, when calling a library function or system call, the application must first set parameters in the method and location (memory or register) specified by the library function or system call, then, the call code is redirected to the starting point of the called code through interruption or other methods for execution. The called code goes from the specified position to the parameter. After processing, the result is placed in the specified position, finally, the application retrieves the result from the specified location. The call is complete!

In my opinion, the location where parameters and results are stored in this process is within the scope specified by ABI. The jump address or interrupt number of the called program is also within the scope specified by ABI. If there is no clear specification for the location of the access parameters and results, or the call and called parties do not comply with the unified specification, the call may not succeed at all; if the library function path provided by the system is incorrect, the call will not succeed. If the interrupted code is incorrectly used, the call will not be correct. Abi is a specification for the application at this level.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.