views:

9

answers:

1

Hi,

I am getting confuse with all those terms:

ABI, calling convention, and hardware architecture.

The ABI is link with the architecture: x86-64 have a different ABI than the i386. But then you can also define your own calling convention cdecl...

Well so what is the link between all those concept? Which one is defining the other one?

Mostly I think I am confuse with ABI. What do you put inside a part from calling convention?

Thanks

+1  A: 

This is a vast topic still to give you some pointers:

The ABI (application binary interface) cover the details that need to be specified in order that application can work on a certain system (usually with an operating system). So, to get to examples:

  • data type sizes (for example C standard gives just minimum requirements for the types. int type should at least as big as short, and short has to be 16 bits.)
  • layout in memory of structures and bitfields
  • calling convention (when a function is invoked where it can find it's parameters, which in registers, which on stack etc)
  • stack frame (what it is present on the stack, useful for a debugger)
  • system call numbers
  • others

Basically any detail that needs to be known in order to build a program that runs together with some other components (libraries, OS) can be included in an ABI. Some ABI specify more and some specify less details.

The hardware architecture can be also seen as a specification but of even lower level (it's about hardware not software). The hardware architecture specifies things like the instruction set available, memory hierarchy and how to access peripherals. For one hardware architecture there can be different ABI-s. Also you can have the same ABI for multiple (but usually similar) hardware architecture.

vladmihaisima