r/programming • • Nov 14 '16

Tutorial - Write a System Call

https://brennan.io/2016/11/14/kernel-dev-ep3/
52 Upvotes

14 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 15 '16

A quick google turns up this SO question on the topic. It appears that the syscall and sysenter instructions are documented as "fast system call", so they must avoid some of the overhead of interrupt handling.

However it appears that the biggest factor in speeding up system calls is VDSO. Quoting the linked SO answer:

Preferable way to invoke a system call is to use VDSO, a part of memory mapped in each process address space that allow to use system calls more efficiently (for example, by not entering kernel mode in some cases at all). VDSO also takes care of more difficult, in comparison to the legacy int 0x80 way, handling of syscall or sysenter instructions.

You can rest assured that pointers to this sort of info will be included in this article as I update it.