Talk:System Calls

From OSDev Wiki
Jump to: navigation, search


I noticed this on the page: "A similar instruction pair has been created by AMD: Syscall/Sysret. However the behaviour of these instructions are different from Intel's."

This is not entirely correct. AMD and Intel both have Sysenter and Sysexit. In long mode on an AMD 64 bit processor, you must use Syscall/Sysret, but in legacy mode (not compatibility) either will work. I haven't looked up how this works on an intel machine. I assume it's similar for long mode as the MSRs required to configure Sysenter/Sysexit only leave room for 32 bit addresses.

--Speal 09:11, 20 February 2008 (CST)

I fail to see why that argument makes that line of text on the page incorrect. Intel introduced sysenter/sysexit. AMD introduced syscall/sysret. Both share the goal of getting in and out of kernel mode as fast as possible. Only the way it is done differs. That both may or may not be implemented on one processor isn't at all the point that's being made, no? - Combuster 16:24, 20 February 2008 (CST)
The text seems to suggest that AMD doesn't have sysenter/sysexit, which is not true. The distinction is important since sysenter/sysexit don't work in long mode. I'd be willing to draft an addition for the syscall/sysret use in long mode in the next few days. --Speal 20:34, 20 February 2008 (CST)

Are you going to include argument passing methods? Such as using the stack, or registers, etc etc --Earlz 14:02, 9 April 2009 (UTC)

Note about read() vs write() being used to stop kernel structures: read() provides a userspace controlled pointer to which the kernel writes data, write() provides a userspace controlled pointer from which the kernel reads data. Therefore a pointer check failure on write() can not be used to overwrite kernel data, but a pointer check failure on read() can.

Dormito 16:39, 16 February 2021 (CST)

Personal tools