News for hackers. Stuff that matters.
Re:A Linux Evening by alkonaut on Friday December 16, 2022 @08:18AM (#34014196)
What's the approach used by OSes that "just work" for things like this? Is this due to the more monolithic kernel of Linux making more things required to be known up front than e.g. in Windows?
Re:A Linux Evening by jeffbee on Friday December 16, 2022 @09:15AM (#34014658)
Is there one? I know that unplugging a Thunderbolt peer will crash my MacBook Pro (bridgeOS, not macOS, panics). Disappearing buses is an edge case that is little-tested on most operating systems.
Re:A Linux Evening by kalleboo on Friday December 16, 2022 @10:19AM (#34015504)
Hot-plugging Thunderbolt devices is hardly an edge-case on Macs, it's a heavily advertised feature.

I had about weekly kernel panics or machine freezes (would not wake from sleep) while unplugging my Thunderbolt dock (with displays and lots of devices) all throughout the USB-C Intel Mac era, but they all went away when I got an M1 Pro machine, so I wonder how much is down to OS design vs drivers vs hardware (vs how specific hardware influences driver design).

Re:A Linux Evening by jeffbee on Friday December 16, 2022 @11:08AM (#34016161)
M1 machines don’t have bridgeOS at all, right?
Re:A Linux Evening by bombcar on Friday December 16, 2022 @11:21AM (#34016371)
If it can panic apparently they do have it.

https://en.wikipedia.org/wiki/BridgeOS says it runs the Touch Bar.

Re:A Linux Evening by jeffbee on Friday December 16, 2022 @02:42PM (#34019207)
The M1 lacks the T-series coprocessor altogether and all its functions are inside the main SoC. Whether that means that bridgeOS still runs on non-architectural cores inside the SoC, or its responsibilities have been rolled into macOS, I have no idea. I do know that only my T2-having MacBook suffers from these panics.
Re:A Linux Evening by aiwv on Friday December 16, 2022 @04:19PM (#34020551)
Raises the question whether or not anyone writing this kind of software actually uses it.
Re:A Linux Evening by kalleboo on Friday December 16, 2022 @10:15AM (#34015440)
According to another comment (https://news.ycombinator.com/item?id=34013844), macOS will pause, reallocate, and un-pause the bus.
Re:A Linux Evening by alexpotato on Friday December 16, 2022 @11:31AM (#34016516)
I always like this story about MacOs.

- Most OSes do a full dhcp look up when they connect to a network even if they have connected to the network before. Wifi saved networks is a good example of a network where you have some historical information on the connection

- MacOs however keeps track of the IP addresses that it saw for each of the networks it has connected to recently. If it sees a network it's been on before, it first tries to just use the old IP address. This is under the assumption that the lease is still tied to the user's laptop.

- In the best case, the laptop gets a working IP very quickly and in the worst case, you just do dhcp again

- From a user's perspective, if they walk into a meeting with a bunch of folks with non Mac laptops, it will seem like the Mac connects much faster than everyone else's machine

When I read this story, the author pointed out that many people say "Macs just feel like they work better!" and used this as an example. Granted, this partly comes from owning the ENTIRE stack from hardware to drivers to OS etc which is something only Mac can do.

Re:A Linux Evening by riskable on Friday December 16, 2022 @02:25PM (#34018918)
...and the network intrusion detection system throws up all sorts of alarm bells about IPs being spoofed and duplicate IPs in use.

I assume MacOS actually only re-uses IPs if it sees the lease hasn't already expired but it might be dumber than that.

Re:A Linux Evening by lloeki on Friday December 16, 2022 @06:33PM (#34022134)
IIRC it does, and otherwise throws out (or used to) an ARP check (or something like that) to see if any one on the local link is using the IP. A properly behaved DHCP server would not hand the IP again to someone else if the lease hasn't expired.
Re:A Linux Evening by nielsole on Saturday December 17, 2022 @02:28AM (#34025649)
> properly behaved DHCP server

One of the common issues with this is that home routers don't usually persist leases across power cycles.

Re:A Linux Evening by Fnoord on Saturday December 17, 2022 @04:23AM (#34026246)
IIRC DHCP leases should be refreshed at their half-time. Or perhaps I am mistaken and this is how Windows works.