3 ms·
Maybe! Why are Linux syscalls odd? How would you do it instead?
by jvns 13y ago
Maybe! Why are Linux syscalls odd? How would you do it instead?
- Locke1689 13y agoGiven that you're probably writing an x86 kernel, I'd suggest looking into the SYSCALL/SYSENTER instructions.
- dnautics 13y agoI could be wrong about this but if my memory serves me correctly, linux syscalls put the first argument in AX, second argument in BX, third argument in CX, and fourth argument in DX. BSD syscalls do the saner thing and just put everything on the stack.
- darkf 13y ago>BSD syscalls do the saner thing and just put everything on the stack. Is that not slower (requiring a memory store and a SUB, then a load and an ADD to pop) than just MOVing a register?