Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

tomjen3 is literally correct that the system call interface used here (int $0x80) still works.

However the system call interface used by most Linux programs today is different in two important respects:

(1) Most(?) current Linux programs run on x86-64 and I'm not sure if int $0x80 is even implemented for this architecture. Whether or not it's implemented, it is not the one which is used normally. Programs use a special 'syscall' instruction:

http://repo.or.cz/w/glibc.git/blob/HEAD:/sysdeps/unix/sysv/l...

(2) Even on 32 bit i?86, int $0x80 has not been used by ordinary compiled programs for a long time. This is because software interrupts were discovered to be very slow, since all registers are saved whether you need to or not. There are faster methods to enter the kernel now. Originally the replacement was to use the Intel 'sysenter' instruction. This was slow too. It was replaced by a "call gate" via %gs, see ENTER_KERNEL here:

http://repo.or.cz/w/glibc.git/blob/HEAD:/sysdeps/unix/sysv/l...

I think modern code on 32 bit ix86 now uses 'syscall' where available. It's hard to keep up, and a detail that doesn't matter for anyone except a handful of kernel and glibc hackers.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: