5 ms·
I really do wonder now that both iPhones, Macs, and iPads are all "arm64" (Apple Silicon no less) how different the bootloaders are for iOS vs MacOS. Once you a
by MuffinFlavored 2y ago
I really do wonder now that both iPhones, Macs, and iPads are all "arm64" (Apple Silicon no less) how different the bootloaders are for iOS vs MacOS. Once you are past the bootloader, why would they be maintaining two different operating systems/lots of differences if they don't have to, especially since they seem to control the hardware?
- ChrisMarshallNY 2y agoVery different user experiences, and also, the Mac development ecosystem is well-established. I suspect a lot of Mac AAA apps are done in C++. Probably a lot of iOS AAA apps are still in ObjC. It is unwise to pull the rug from established developers.
- pjmlp 2y agoMore like Objective-C++, as otherwise it is lots of fun calling macOS APIs from C++. And no, C++ isn't as prevalent on Apple platforms as on other vendors. Hence why you will find out most of the C++ related documentation is for IO and Driver Kit, the Metal Shading Language dialect (based on C++14), LLVM, and that is about it. Even Metal is actually implemented in Objective-C, with Swift and C++ bindings, and the C++ bindings are really low effort versus the Swift tooling.
- saagarjha 2y agoThey are very similar. The differences are largely in that macOS generally will permit some things that iOS will not.
- kuhsaft 2y agoThey aren’t actually too similar. They both use XNU, but the memory model is completely different. On macOS memory can be paged to/from disk. On iOS it isn’t and applications must free memory when asked or be terminated [0]. iOS applications are sandboxed by the kernel, with no opt out. macOS applications are not sandboxed by default and are opt in. Then there are the API and UI differences. EDIT: That linked blog post in the parent blog post also shows how different the userspace is: https://worthdoingbadly.com/macappsios/ https://worthdoingbadly.com/macappsios/ EDIT: iPadOS 16 enables virtual memory swap [1] [0] https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html https://developer.apple.com/library/archive/documentation/Pe... [1] https://www.apple.com/newsroom/2022/06/ipados-16-takes-the-versatility-of-ipad-even-further/ https://www.apple.com/newsroom/2022/06/ipados-16-takes-the-v...
- fathyb 2y ago> On macOS memory can be paged to/from disk. On iOS it isn’t and applications must free memory when asked or be terminated Not sure what you meant by that, you always could `mmap` files into memory on iOS. Back in the 32 bits days there was a ~700 MB limit due to the address space, but there aren't anymore nowadays with 64 bits. If `didReceiveMemoryWarning` is called on your app, then you need to free resident memory but the kernel will take care of dumping file-backed memory pages for you.
- kuhsaft 2y agoThat's memory mapping. This is memory paging [1]. I.e. Windows pagefile.sys, Linux swap, macOS swap files. iOS does not have swap files, only memory compression. If you're on a Mac, open up Activity Monitor, go to Memory, and at the bottom there is `Swap Used`. That doesn't exist on iOS. So, if more memory is used than available, applications will need to free memory or be terminated. Unlike macOS, where some used memory will be swapped to disk to allow other stuff to be loaded into memory. [1] https://en.wikipedia.org/wiki/Memory_paging https://en.wikipedia.org/wiki/Memory_paging
- kuhsaft 2y agoThe hardware was drastically different between Macs and iPhones when iOS was released. That was in 2007. Apple only unified the hardware in 2020. Over the *13* years, the operating systems have diverged so much that unifying them is a massive effort. The linked blog post by Zhuowei Zhang shows some of the differences. The user-space components are just so different that it's not as simple as running a macOS app on iOS. EDIT: You can run a iOS apps on macOS without recompilation, but it uses Mac Catalyst which is a user-space shim for iOS apps to work on macOS. Even then, not everything works.
- azinman2 2y agoYou can run iOS apps directly on M1 Macs. Some developers flip a bit to disable this, but there any many that don’t.
- kuhsaft 2y agoIn this case, the app is running in a sandbox with a user-space that simulates the iOS user-space [0]. > Your apps use the same frameworks and infrastructure that Mac Catalyst apps use to run, but without the need to recompile for the Mac platform. > Although you can run your iOS apps unmodified on a Mac with Apple silicon, Mac Catalyst lets you build your app specifically for macOS and customize your app’s behavior on that platform. Mac Catalyst was a multi-year effort by Apple. Doing the same to run macOS apps on iOS would probably be even harder due to how complicated macOS is compared to iOS. [0] https://developer.apple.com/documentation/apple-silicon/running-your-ios-apps-in-macos#overview https://developer.apple.com/documentation/apple-silicon/runn...
- azinman2 2y agoIt seems you agree, except previously you said “Likewise, you can't just run a iOS app on macOS. You need to recompile your app with Mac Catalyst for it to work. Even then, it's a bit jank.” That’s not true, you can just run an iOS app on macOS.
- 2y ago