List of and documentation for system calls for XNU kernel in OSX

社会主义新天地 提交于 2019-12-05 00:21:59
Yuji

The "official" list is at Darwin page at Apple. Specifically, see the file syscalls.master in the XNU distribution. (If something you expect is missing, try a newer XNU version.)

The BSD part of the system calls comes from BSD, but there're mach calls which follow quite different conventions.

You'll definitely want to read Amit Singh's OS X kernel book, see the book's website. It's rewritten for 10.4 and mainly for PPC, but still is the greatest detailed info you can get on the kernel.

Technologeeks

XNU's system calls are, indeed, following the BSD/POSIX model, but are a subset: There are quite a few additional calls proprietary to Apple - for example, stack_snapshot (#365), iopolicy (322), proc_info(336) and others. Apple keeps those undocumented, but you can find their source in XNU. You can call undocumented system calls explicitly (by using the sys call macro and specifying the call # as first argument), but some (e.g. proc_info) are wrapped by Darwin libraries (e.g. libproc, which is part of libSystem)

syscalls.master generates the /usr/include/sys/syscall.h file, which will also give you the system call names (but not the prototypes). Singh's book describes some sys calls, but is vastly outdated, since Tiger had fewer than the 439 (in iOS6: 443) calls XNU has today. A more recent book can be found in http://www.amazon.com/Mac-OS-iOS-Internals-Apples/dp/1118057651, and its appendix actually documents all system calls (and Mach Traps), in detail.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!