Ask Different (Apple)
Q&A for power users of Apple hardware and software
Latest Questions
88
votes
6
answers
55183
views
Why is macOS often referred to as 'Darwin'?
In several languages, instead of returning something like "macOS", the command to view the operating system instead returns ``` Darwin ``` I see this in languages like R, and node. Why is macOS sometimes called Darwin??
In several languages, instead of returning something like "macOS", the command to view the operating system instead returns
Darwin
I see this in languages like R, and node.
Why is macOS sometimes called Darwin??
stevec
(5633 rep)
Sep 23, 2020, 01:53 AM
• Last activity: Oct 19, 2024, 09:15 AM
-3
votes
1
answers
104
views
Console syslogd code 360
On MacOS's Console app which lists syslogd events on the system.log, there are no public definitions for the error numbers which is unhelpful and not in-line with transparency of linux systems. Apple support said I would need to come into the store for their engineers to try and answer my question (...
On MacOS's Console app which lists syslogd events on the system.log, there are no public definitions for the error numbers which is unhelpful and not in-line with transparency of linux systems. Apple support said I would need to come into the store for their engineers to try and answer my question (as stated below). Event id descriptions should be public so we can diagnose our computer issues.
As a computer programmer with many years experience on linux (as we know Darwin is based on Free BSD), I've never had such a problem finding codes such as this to debug (in this case disconnection issues). In particular, on my m1 laptop, I get the below message, the question is what does code 360 mean?
Sep 10 11:01:49 Mycomp syslogd: ASL Sender Statistics
As an example, in the following answer on the Apple forum, the meaning of the code (in that case 337) was never stated. Knowing your error codes is step 1.
https://discussions.apple.com/thread/254267411
I hope this question is not removed because having access to event codes is essential to identify proper operation of our Mac computers. See the following for general info about syslog events. I might find this number by searching through low level linux logs using the terminal, but I shouldn't have to:
https://ackcent.com/basics-linux-events-logging/
neal
(1 rep)
Sep 11, 2024, 06:34 PM
• Last activity: Sep 11, 2024, 07:09 PM
0
votes
1
answers
447
views
xattr: bad interpreter: No such file or directory
When I execute the `xattr` command, it returns the error: ```` /usr/local/bin/xattr: /usr/local/opt/python@3.11/bin/python3.11: bad interpreter: No such file or directory ```` `file /usr/bin/xattr` returns: ```` /usr/bin/xattr: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit exec...
When I execute the
xattr
command, it returns the error:
`
/usr/local/bin/xattr: /usr/local/opt/python@3.11/bin/python3.11: bad interpreter: No such file or directory
`
file /usr/bin/xattr
returns:
`
/usr/bin/xattr: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/xattr (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/xattr (for architecture arm64e): Mach-O 64-bit executable arm64e
`
which python3
returns /usr/bin/python3
and my env
doesn't have any python entries.
This is my .zshrc
file:
`
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/sbin:$PATH"
# Created by pipx
on 2023-11-25 17:42:38
export PATH="$PATH:/Users/rhpt/.local/bin"
`
I do not have python 3.11 but I do have python 3.12 installed. Running Sonoma 14.2 on an Intel iMac.
I do not understand why xattr
is trying to execute a python script. How can I get Terminal to use the executable instead of trying to execute python?
RHPT
(788 rep)
Jan 18, 2024, 05:44 AM
• Last activity: Jan 18, 2024, 09:08 AM
14
votes
1
answers
26196
views
What does the time command do on zsh Mac terminal? And what is the output of "children"?
This is what I got from the terminal command "time". shell 0.32s user 0.08s system 0% cpu 6:09.64 total children 0.10s user 0.16s system 0% cpu 6:09.64 total What is children?
This is what I got from the terminal command "time".
shell 0.32s user 0.08s system 0% cpu 6:09.64 total
children 0.10s user 0.16s system 0% cpu 6:09.64 total
What is children?
ExIgnorantiaAdSapientiam
(149 rep)
Jul 16, 2021, 04:38 AM
• Last activity: Oct 10, 2023, 07:59 AM
1
votes
0
answers
83
views
g++ setting proper @rpath when building SFML
I'm trying to build an SFML sample without xcode (for reasons :-)). The prebuilt samples comes with: ``` pong> otool -L pong pong: @rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio (compatibility version 2.5.0, current version 2.5.1) @rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics (c...
I'm trying to build an SFML sample without xcode (for reasons :-)).
The prebuilt samples comes with:
pong> otool -L pong
pong:
@rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-window.framework/Versions/2.5.1/sfml-window (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-system.framework/Versions/2.5.1/sfml-system (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 19.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
When I build it myself (build command follows), I rather obtain:
pong> otool -L a.out
a.out:
@rpath/libsfml-system.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-window.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-graphics.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-audio.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
This prevents my built version from running, as it fails to load the library. How would I tell g++
to generate the same @rpath
s as those prebuilt?
The build command I used is:
g++ Pong.cpp -I ../../include -L ../../lib/ -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
In case this makes any difference, this is on Ventura.
Jeffrey
(111 rep)
Mar 25, 2023, 06:49 PM
• Last activity: Mar 25, 2023, 08:33 PM
0
votes
1
answers
638
views
What is the user 'mobile' for on iPad?
I just `ssh`ed to a jailbroken iPad(Pro 3, iOS 14.2), and found other than `root` and `daemon`, there's an existing user `mobile`, which seems to come with the system. I was wondering 1. what the user is for? 2. if I do not change the password, can others ssh to my device with this account? 3. if I...
I just
ssh
ed to a jailbroken iPad(Pro 3, iOS 14.2), and found other than root
and daemon
, there's an existing user mobile
, which seems to come with the system. I was wondering
1. what the user is for?
2. if I do not change the password, can others ssh to my device with this account?
3. if I do change the password, can it mess with the normal system operation?
Shukai Ni
Jul 20, 2022, 01:12 AM
• Last activity: Mar 17, 2023, 03:08 AM
15
votes
4
answers
14796
views
Why is 'xattr' not working?
When I attempt to execute `xattr` in Terminal, I get Traceback (most recent call last): File "/usr/bin/xattr-2.7", line 33, in import xattr ImportError: No module named xattr What's going on here? I thought xattr [was part of Darwin][1]. Is `xattr` written in Python? Does it require a Python package...
When I attempt to execute
xattr
in Terminal, I get
Traceback (most recent call last):
File "/usr/bin/xattr-2.7", line 33, in
import xattr
ImportError: No module named xattr
What's going on here? I thought xattr was part of Darwin . Is xattr
written in Python? Does it require a Python package to be installed on my system?
orome
(12163 rep)
Mar 29, 2014, 12:34 AM
• Last activity: Feb 13, 2023, 10:15 AM
0
votes
0
answers
70
views
open() fails on some files with sudo permission
Running on Darwin Kernel Version 22.1.0. I have a program which goes through the devices in `/dev/` directory to send an nvme command to them to get their ID information. On Linux the files I look for are of `/dev/nvmeX` variant, but on macOS the nvme devices look to be mapped to `/dev/diskX` or `rd...
Running on Darwin Kernel Version 22.1.0.
I have a program which goes through the devices in
/dev/
directory to send an nvme command to them to get their ID information. On Linux the files I look for are of /dev/nvmeX
variant, but on macOS the nvme devices look to be mapped to /dev/diskX
or rdiskX
.
I am using
//p_dev =/dev/rdisk0;1,2,3...
int fd = open(p_dev, O_RDWR | O_SYNC);
if (fd < 0)
{
printf("ERROR: %d %s open() failed on %s\n", errno, strerror(errno), p_dev);
}
for rdisk0..3
this returns,
ERROR: 1 Operation not permitted open() failed on /dev/rdisk0
ERROR: 16 Resource busy open() failed on /dev/rdisk1
ERROR: 1 Operation not permitted open() failed on /dev/rdisk2
ERROR: 1 Operation not permitted open() failed on /dev/rdisk3
Next, rdisk4
is the device I am looking for and it opens without any issue. I am running my program with sudo
so not permitted doesn't make sense.
I checked using diskutil
and 0..3 are Apple's SSDs and its partitions. Are they somehow special? As far as I can tell from smartctl they are all NVMe devices.
I am not familiar with Apple's implementation and proper use so hopefully someone might know what I might be missing?
For now I worked around this by using:
popen("diskutil info %s | grep 'Media Name'", "r")
and looking for the relevant information.
From command line using SPNVMeDataType
shows the device Apple SSD and the
device but it doesn't show which device one or the other is in /dev/, neither is PCI vendor ID in the output.
system_profiler SPNVMeDataType
NVMExpress:
Apple SSD Controller:
APPLE SSD AP0512Q:
Capacity: 500.28 GB (500,277,792,768 bytes)
TRIM Support: Yes
Model: APPLE SSD AP0512Q
Revision: 873.40.4
Serial Number: xxxxxxxxxxxxxx
Detachable Drive: No
BSD Name: disk0
Partition Map Type: GPT (GUID Partition Table)
Removable Media: No
S.M.A.R.T. status: Verified
Volumes:
iSCPreboot:
Capacity: 524.3 MB (524,288,000 bytes)
BSD Name: disk0s1
Content: Apple_APFS_ISC
Macintosh HD:
Capacity: 494.38 GB (494,384,795,648 bytes)
BSD Name: disk0s2
Content: Apple_APFS
Recovery:
Capacity: 5.37 GB (5,368,664,064 bytes)
BSD Name: disk0s3
Content: Apple_APFS_Recovery
Generic SSD Controller:
xyz:
Capacity: 123
TRIM Support: No
Model: xyz
Revision: ---zzz
Serial Number: xxxxxxxxxxxxxxxxxxx
Link Width: x4
Link Speed: 8.0 GT/s
Detachable Drive: No
BSD Name: disk4
Partition Map Type: Unknown
Removable Media: No
S.M.A.R.T. status: Verified
Using SPSerialATADataType
doesn't produce any output.
pointnotfoe
(1 rep)
Jan 25, 2023, 09:20 PM
• Last activity: Jan 26, 2023, 05:48 PM
2
votes
1
answers
186
views
extract by terminal the Darwin version
I want to know how extract by terminal the Darwin version. https://en.wikipedia.org/wiki/MacOS_Sierra#Releases For macOS Sierra `10.12.3` is **16.4.0** for `10.12.6` is **16.7.0**. Now, I want to create: --build=x86_64-apple-darwin$(uname -r) Is it possible obtain this complete value? x86_64-apple-d...
I want to know how extract by terminal the Darwin version.
https://en.wikipedia.org/wiki/MacOS_Sierra#Releases
For macOS Sierra
10.12.3
is **16.4.0** for 10.12.6
is **16.7.0**.
Now, I want to create:
--build=x86_64-apple-darwin$(uname -r)
Is it possible obtain this complete value?
x86_64-apple-darwin16.4.0
joseluisbz
(815 rep)
May 7, 2018, 08:02 PM
• Last activity: Dec 20, 2022, 08:08 PM
12
votes
2
answers
38976
views
How to install and use The open source Darwin OS
Is it possible to install and use the Darwin OS from Apples open source download area, and if so on what hardware would I need? I'm not even sure if the OS is complete, all I can tell is there are a load of individual installer packages for different applications and subsystems, but no overall OS in...
Is it possible to install and use the Darwin OS from Apples open source download area, and if so on what hardware would I need?
I'm not even sure if the OS is complete, all I can tell is there are a load of individual installer packages for different applications and subsystems, but no overall OS installer.
stuffe
(25766 rep)
Aug 7, 2013, 08:38 PM
• Last activity: Sep 6, 2022, 09:36 PM
1
votes
2
answers
388
views
Is there a way to export aliases in macOS in the Korn Shell (ksh)?
Earlier versions of the Korn shell (`ksh`) allowed aliases to be exported to subshells by using the `-x` option, for example: alias -x dog=cat With the current version of macOS the `ksh` man page says: "The obsolete -x option has no effect." Is there an alternate way to export aliases in macOS in `k...
Earlier versions of the Korn shell (
ksh
) allowed aliases to be exported to subshells by using the -x
option, for example:
alias -x dog=cat
With the current version of macOS the ksh
man page says:
"The obsolete -x option has no effect."
Is there an alternate way to export aliases in macOS in ksh
without putting them in .kshrc
?
KS_on_StackExchange
(131 rep)
Nov 7, 2021, 12:44 AM
• Last activity: Apr 7, 2022, 09:33 PM
2
votes
1
answers
1253
views
darwinup: command not found
I need to use `darwinup` on my macOS (11.5) and it is just not founded by system. It seems to be default binary in OS X but somehow I don't have it. Do you know how could I get it? I didn't found any information about instalation or downloading it and tried `brew install darwinup` already.
I need to use
darwinup
on my macOS (11.5) and it is just not founded by system. It seems to be default binary in OS X but somehow I don't have it. Do you know how could I get it? I didn't found any information about instalation or downloading it and tried brew install darwinup
already.
Przemekeke
(67 rep)
Aug 24, 2021, 12:13 PM
• Last activity: Aug 24, 2021, 12:23 PM
-1
votes
1
answers
343
views
What are the benefits of XNU using Mach features compared to a full FreeBSD kernel?
The Darwin kernel is a hybrid of Mach and FreeBSD. What are the benefits of using such a hybrid architecture compared to a full FreeBSD kernel? I'm not looking for subjective opinions of why this architecture was chosen, but am rather interested in technological benefits of the architecture, both fr...
The Darwin kernel is a hybrid of Mach and FreeBSD. What are the benefits of using such a hybrid architecture compared to a full FreeBSD kernel?
I'm not looking for subjective opinions of why this architecture was chosen, but am rather interested in technological benefits of the architecture, both from a perspective of today and a perspective of the end of the 1990ies.
- Which improvements do the Mach features offer over their FreeBSD counterparts?
- What features would be difficult to offer without Mach? Are there things possible with Mach with regards to performance or security that a FreeBSD-only kernel would not allow?
Wilbert
(217 rep)
Apr 15, 2021, 11:10 AM
• Last activity: Apr 15, 2021, 03:17 PM
-3
votes
2
answers
5159
views
Run the macOS desktop environment on Linux
As I know, macOS is using Darwin kernel and Darwin is a distribution of BSD. So macOS is in the UNIX family and can run most Linux / BSD / Solaris software on it. Maybe there is a way to install macOS's desktop environment in Linux. Is there a way to do it? If so, how can I do this? Moderators, my q...
As I know, macOS is using Darwin kernel and Darwin is a distribution of BSD. So macOS is in the UNIX family and can run most Linux / BSD / Solaris software on it.
Maybe there is a way to install macOS's desktop environment in Linux. Is there a way to do it?
If so, how can I do this?
Moderators, my question is not off-topic.
maDeveloper
(27 rep)
Oct 8, 2020, 09:03 PM
• Last activity: Dec 30, 2020, 02:31 PM
0
votes
1
answers
1607
views
What's the `darwin` in Mac?
In my Mac I execute the code: ``` import sys print(sys.platform) ``` then get `darwin`, why it is not OSX. I don't know where to look for documentation on python sys module. What's the `darwin` ?
In my Mac I execute the code:
import sys
print(sys.platform)
then get darwin
, why it is not OSX. I don't know where to look for documentation on python sys module.
What's the darwin
?
aircraft
(1845 rep)
Jun 8, 2020, 11:19 AM
• Last activity: Jun 8, 2020, 11:41 AM
2
votes
0
answers
120
views
Unkillable process: what does this PS command output mean?
This process couldn't be killed. I tried kill -9 and it's still hanging on by the skin of it's teeth: What does ?E mean in the status column? I think I have a systemic problem with this on my Mac but I'm struggling to diagnose it! ``` $ ps -efl | grep -i juc 501 12992 1 0 Fri01pm ?? 0:00.00 (Projuce...
This process couldn't be killed. I tried kill -9 and it's still hanging on by the skin of it's teeth:
What does ?E mean in the status column?
I think I have a systemic problem with this on my Mac but I'm struggling to diagnose it!
$ ps -efl | grep -i juc
501 12992 1 0 Fri01pm ?? 0:00.00 (Projucer) 6086 0 0 0 0 - ?E 0
I can't attach a debugger to it either:
$ sudo lldb -p 12992
Password:
(lldb) process attach --pid 12992
error: attach failed: Error 1
Also this non-exiting starts to affect all the processes:
501 1548 1 6084 0 0 0 0 0 - ?E 0 ?? 0:00.00 (Skype) Wed11am
501 3017 1 6004 0 0 0 0 0 - ?Es 0 ?? 0:00.00 (com.apple.appki Wed01pm
501 12992 1 6086 0 0 0 0 0 - ?E 0 ?? 0:00.00 (Projucer) Fri01pm
501 36351 1 6004 0 0 0 0 0 - ?E 0 ?? 0:00.00 (TMHelperAgent) 4:11pm
501 37977 37926 1006006 0 0 0 0 0 - ?E+ 0 ttys000 0:00.00 (lldb) 5:36pm
501 38053 37997 1006006 0 0 0 0 0 - ?E+ 0 ttys004 0:00.00 (lldb) 5:39pm
user10550
(121 rep)
May 3, 2020, 04:29 PM
• Last activity: May 3, 2020, 04:49 PM
1
votes
1
answers
584
views
Installing GNU compilers on PureDarwin/Darwin?
I hope this is not off-topic, because there is no better place to ask this sort of questions on SO/SE. I have Downloaded and ran PureDarwin on QEMU using instructions [here][1]: Now I want to know if there are any package managers? Can I install HomeBrew preferably here for example or even MacPorts?...
I hope this is not off-topic, because there is no better place to ask this sort of questions on SO/SE. I have Downloaded and ran PureDarwin on QEMU using instructions here :
Now I want to know if there are any package managers? Can I install HomeBrew preferably here for example or even MacPorts? If none possible how can I install GNU C/C++/Fortran compilers (GCC/g++/gfortran) here? or if it is not a possibility is there any compiler on this operating system at all? My goal is eventually to provide some Open Source developers who don't have macs with an alternative to test their software or maybe create macOS compatible binaries/packages if possible. Thanks for your support in advance.![]()
Foad
(163 rep)
Mar 10, 2020, 08:54 PM
• Last activity: Mar 13, 2020, 10:23 PM
16
votes
1
answers
4273
views
Fake ethernet interfaces (feth / if_fake)? Anyone ever seen this?
I've been digging into Darwin source to try to find some way to create virtual Ethernet interfaces on Mac/Darwin without adding a kernel extension like tuntaposx. In doing so I've found something interesting that seems to exist but have zero documentation. Here's the source file: https://opensource....
I've been digging into Darwin source to try to find some way to create virtual Ethernet interfaces on Mac/Darwin without adding a kernel extension like tuntaposx. In doing so I've found something interesting that seems to exist but have zero documentation.
Here's the source file:
https://opensource.apple.com/source/xnu/xnu-4570.41.2/bsd/net/if_fake.c.auto.html
Reading the file leads me to think this is similar to a veth pair on Linux: create two interfaces and packets going into one pop out the other.
The only problem is that I can find *nothing* on the Internet about this.
I have been able to confirm that it exists as of OSX Mojave and assume they exist on older versions too:
# ifconfig feth0 create
feth0: flags=8843 mtu 1500
ether 66:65:74:68:00:00
peer:
media: autoselect
status: inactive
After looking some more I seem to have found an undocumented option in ifconfig to link two of these:
# ifconfig feth0 peer feth1
# ifconfig feth0
feth0: flags=8843 mtu 1500
ether 66:65:74:68:00:00
inet 9.9.9.9 netmask 0xffffff00 broadcast 9.9.9.255
peer: feth1
media: autoselect
status: active
Now when I add an IP to feth0 and tcpdump feth1, I see a bunch of packets that are things like mDNS announcements that you would expect a Mac to spew into a new Ethernet link.
I'm posting this here because I'm curious about whether anyone else has any clue about this or has ever used it.
Edit: I can now confirm that if you peer them and bring them both up (ifconfig feth0 up, etc.) you can inject packets into either side and see them in the other. It looks like this indeed could work as a layer 2 Ethernet tap device or virtual machine veth pair device without requiring a kernel extension. Not only is this awesome for network virtualization but paired with Apple's virtualization extensions it would also allow a kext-free VM host with full networking capabilities.
Edit #2: We also just found this, which is also not very well documented albeit much better than feth. It may offer a more officially supported way of creating virtual Ethernet devices. We'll have to see how it works. The feth stuff is still interesting though!
https://developer.apple.com/documentation/vmnet
Adam Ierymenko
(261 rep)
Sep 26, 2018, 10:32 PM
• Last activity: Jan 28, 2020, 04:44 PM
1
votes
1
answers
446
views
Is the source code for xnu-6153.60.66~39 available? (iOS 13.3 Kernel)
I cannot find `xnu-6153.60.66~39` at https://opensource.apple.com/tarballs/xnu/ ! Does apple still open source the XNU Kernel?
I cannot find
xnu-6153.60.66~39
at https://opensource.apple.com/tarballs/xnu/ ! Does apple still open source the XNU Kernel?
Lucas
(152 rep)
Jan 6, 2020, 09:23 AM
• Last activity: Jan 8, 2020, 10:54 PM
3
votes
1
answers
8913
views
How to make a bootable partition from scratch?
What I want to achieve is to make a new bootable partition on my MacBook's SSD, so it should be possible to press `Option` key on startup and choose this partition to boot from. Why do I need that? I just successfully compiled XNU kernel from sources, found some drivers (kernel extensions), so now I...
What I want to achieve is to make a new bootable partition on my MacBook's SSD, so it should be possible to press
Option
key on startup and choose this partition to boot from.
Why do I need that? I just successfully compiled XNU kernel from sources, found some drivers (kernel extensions), so now I want to boot this kernel and to load bash
after boot process finishes. The key idea is to make a minimal Mac OS, just with command line interface.
Here is the output of diskutil list
:
Alexanders-MacBook-Pro:~ aperechnev$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 250.8 GB disk0s2
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +250.8 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD - Data 99.8 GB disk1s1
2: APFS Volume Preboot 83.8 MB disk1s2
3: APFS Volume Recovery 525.5 MB disk1s3
4: APFS Volume VM 1.1 GB disk1s4
5: APFS Volume Macintosh HD 10.9 GB disk1s5
What I want to achieve first is to see the new partition as an option to boot from by pressing Option
key and to get some error when I try to boot from that partition.
Alexander Perechnev
(131 rep)
Dec 30, 2019, 03:03 AM
• Last activity: Dec 31, 2019, 03:49 AM
Showing page 1 of 20 total questions