Does anyone know where to find a summary table or cheatsheet for the Linux system call in Assembly? I am invoking Linux system calls through the int 0x80 instruction and I need a quick reference to determine which register contains which value from time to time.
Linux System CallsPut the system call number in the EAX register. Store the arguments to the system call in the registers EBX, ECX, etc. Call the relevant interrupt (80h). The result is usually returned in the EAX register.
System call table is an array of function pointers. It is defined in kernel space as variable sys_call_table and it contains pointers to functions which implement system calls. Index of each function pointer in the array is the system call number for that syscall.
INT is the assembly mnemonic for "interrupt". The code after it specifies the interrupt code. (80h/0x80 or 128 in decimal is the Unix System Call interrupt) When running in Real Mode (16-bit on a 32-bit chip), interrupts are handled by the BIOS.
The system calls can also be found in /usr/include/asm/unistd.h, which will point you to unistd32.h or unistd64.h
Here's an archive of a really good online reference with links to documentation and kernel source code.
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