Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is int 0x80 is the only interrupt number used in linux assembly programming?

Do we use only 80H in assembly programming to request a service to linux kernel?

what is the utility of other interrupt numbers in linux?

I am transitioning from windows to linux.

like image 797
KawaiKx Avatar asked Nov 01 '22 12:11

KawaiKx


1 Answers

int3 (the debug breakpoint) and int 80h (old system call) are the two software interrupts commonly used on linux. Hardware interrupts are used by device drivers, but those probably don't concern you.

That said, on 32 bit systems the kernel provides code mapped into each process that can be invoked to perform a system call and it will use the most appropriate mechanism automatically (syscall, sysenter or int 80h). Since all 64 bit systems support the syscall instruction, that's the one normally used in long mode. Note that 64 bit system call numbers differ from 32 bit.

Finally, you don't typically use system calls from assembly on linux. You either use the c library or avoid system calls entirely because they are slow and one of the main uses of assembly is for speed. There are exceptions of course, such as security-related code or compiler/language development.

like image 166
Jester Avatar answered Nov 09 '22 13:11

Jester