This is what wikipedia says:
In computer software, an application binary interface (ABI) describes the low-level interface between an application (or any type of) program and the operating system or another application.
ABIs cover details such as data type, size, and alignment; the calling convention, which controls how functions' arguments are passed and return values retrieved; the system call numbers and how an application should make system calls to the operating system; and in the case of a complete operating system ABI, the binary format of object files, program libraries and so on. A complete ABI, such as the Intel Binary Compatibility Standard (iBCS), allows a program from one operating system supporting that ABI to run without modifications on any other such system, provided that necessary shared libraries are present, and similar prerequisites are fulfilled.
I guess that an ABI is a convention or standard, and compilers/linkers use this convention to produce object codes. Is that right? If so who made these conventions(companies or some organization)? What was it like when there was no ABIs? Is there documents about these ABIs that we can refer to?
Application Binary Interface (ABI) describes a low-level interface between two applications or an application and operating system. ABI covers data type, size, alignment, calling convention, the system call numbers and how an application should make system calls to OS.
The Contract Application Binary Interface (ABI) is the standard way to interact with contracts in the Ethereum ecosystem, both from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type, as described in this specification.
(Application Binary Interface) A specification for a specific hardware platform combined with the operating system.
As C++ evolved over the years, the Application Binary Interface (ABI) used by a compiler often needed changes to support new or evolving language features. Consequently, programmers were expected to recompile all their binaries with every new compiler release.
You're correct about the definition of an ABI, up to a point. The classic example is the syscall
interface in Linux (and other UNIXes).
They are a standard way for code to request the operating system to carry out certain duties.
As such, they're decided by the people that wrote the OS or, in the case where the syscalls
have been added later, by whoever added them (in cases where the OS allows this). For example, the Linux syscall
interface on x86 states that you load the syscall
number into eax
, with other parameters placed in ebx
, ecx
and so on, depending on the syscall
you're making (eax
).
Typically, it's not the compiler or linker which do the work of interfacing, rather it's the libraries provided for the language you're using.
Returning to Linux, the GNU C libraries contain code for fopen
(for example) which eventually call the relevant syscall
to perform the lower level tasks (syscall number 5, open
). A list of the syscalls
can be found in this PDF file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With