Live data from Hacker News

OS X BSD System Calls Reference

dyjakan.sigsegv.pl

1–10 of 27 posts

Re: OS X BSD System Calls Reference

#3
post #2

Note that the BSD system calls do not cover the full functionality of OSX, and the mach interfaces are necessary. For example, sleep() needs to use the Mach message interfaces.

Embrace and extend? How is this different to Android vs. the Linux kernel?

Re: OS X BSD System Calls Reference

#4
Seeing all of the syscalls in one place really puts things in perspective. The #ifdef markers are a nice touch, too.

This makes me wonder, what would this look like for plan9? Just FS-related syscalls, and that's it? Curious...

Re: OS X BSD System Calls Reference

#5
post #4

Seeing all of the syscalls in one place really puts things in perspective. The #ifdef markers are a nice touch, too. This makes me wonder, what would this look like for plan9? Just FS-related syscalls, and that's it? Curious...

This makes me wonder, what would this look like for plan9?

http://aiju.de/misc/plan9-syscalls

Re: OS X BSD System Calls Reference

#6
post #2

Note that the BSD system calls do not cover the full functionality of OSX, and the mach interfaces are necessary. For example, sleep() needs to use the Mach message interfaces.

Embrace and extend? How is this different to Android vs. the Linux kernel?

"The kernel of NeXTSTEP is based upon the Mach kernel, which was originally developed at Carnegie Mellon University, with additional kernel layers and low-level user space code derived from select parts of BSD." [1]

NeXTSTEP became the basis for OS X. It meets the Single UNIX Specification [2].

[1] https://en.wikipedia.org/wiki/OS_X#History

[2] https://en.wikipedia.org/wiki/Single_UNIX_Specification#OS_X

Re: OS X BSD System Calls Reference

#7
post #6

Earlier quoted context omitted.

Embrace and extend? How is this different to Android vs. the Linux kernel?

"The kernel of NeXTSTEP is based upon the Mach kernel, which was originally developed at Carnegie Mellon University, with additional kernel layers and low-level user space code derived from select parts of BSD." [1] NeXTSTEP became the basis for OS X. It meets the Single UNIX Specification [2]. [1] https://en.wikipedia.org/wiki/OS_X#History [2] https://en.wikipedia.org/wiki/Single_UNIX_Specification#OS_X

That doesn't answer my question.

Both Android and OSX are listed under https://en.wikipedia.org/wiki/POSIX#Mostly_POSIX-compliant

What I would like to know is, is there any fundamental difference in how the two have derived from their predecessors, ie. Android kernel from the Linux kernel and OSX's XNU kernel from the NexTSTEP/BSD kernels, specifically in terms of compatibility concerns.

(Edit reply to below: Yes but my understanding is that the Android kernel changed fundamental system calls, such as those used for memory allocation, forcing everything userland to be rewritten. Is the 'two systems' of XNU you describe not, therefore, similar in its effect on compatibility?)

Re: OS X BSD System Calls Reference

#9
post #2

Note that the BSD system calls do not cover the full functionality of OSX, and the mach interfaces are necessary. For example, sleep() needs to use the Mach message interfaces.

Why can't sleep() be implemented on top of select(0, 0, 0, 0, timeout)?

Re: OS X BSD System Calls Reference

#10
post #6

Earlier quoted context omitted.

"The kernel of NeXTSTEP is based upon the Mach kernel, which was originally developed at Carnegie Mellon University, with additional kernel layers and low-level user space code derived from select parts of BSD." [1] NeXTSTEP became the basis for OS X. It meets the Single UNIX Specification [2]. [1] https://en.wikipedia.org/wiki/OS_X#History [2] https://en.wikipedia.org/wiki/Single_UNIX_Specification#OS_X

That doesn't answer my question. Both Android and OSX are listed under https://en.wikipedia.org/wiki/POSIX#Mostly_POSIX-compliant What I would like to know is, is there any fundamental difference in how the two have derived from their predecessors, ie. Android kernel from the Linux kernel and OSX's XNU kernel from the NexTSTEP/BSD kernels, specifically in terms of compatibility concerns. (Edit reply to below: Yes but…

The Linux kernel has only one set of system calls. Everything you can do with Linux, you can do through it's syscall interface. Android doesn't change this, although it ships a different, more minimal libc.

The OSX kernel has two, due to it's bolt-on nature. Mach message passing and BSD system calls. As far as I am aware, the BSD system calls is an emulation layer, and is not entirely complete.

As a user, you don't care; the quirks of both systems are papered over by libc, which does the appropriate syscall dance to create a posix compliant system. (For an example of a Linux quirk, 'exit()' on Linux doesn't actually exit the process, it only exits the current thread).

Post reply on HN