39 ms·
Darwin-xnu: The Darwin Kernel
- arca_vorago 9y agoLicense for those interested: https://github.com/apple/darwin-xnu/blob/master/LICENSE https://github.com/apple/darwin-xnu/blob/master/LICENSE
- smitherfield 9y agoTL;DR - GPL-ish with a Facebook-style patent clause.
- deleted 9y ago[deleted]
- 0x0 9y agoThe big news here is the inclusion of arm and arm64 specific files, which used to be excluded in source drops previously.
- diminish 9y agoSo is it a totally new story that iOS kernel is open sourced?
- deleted 9y ago[deleted]
- cucumberferity 9y agoIt's a story that (a) the iOS bits are included and (b) it's posted to GitHub instead of dumped at opensource.apple.com. We'll see if Apple accepts pull requests.
- earenndil 9y agoI doubt they will. Actual commits aren't going to github, just version snapshots.
- cucumberferity 9y agoThat's frustrating.
- crawshaw 9y agoGithub is nice, but there is (and should be) far more to the open source world than just Github. I am happy they are making sources available. It would be wonderful if Apple started developing their kernel in public (I would like to read those code reviews). What tools they use should be up to the developers.
- josteink 9y agoI think he refers to the fact that we don't get the real version history, with informative commits which may provide context for the code in question, but instead just get snapshots for particular versions. I'm not saying it's useless, but it's certainly much less useful than a proper version-history, and very much a declaration that it is in no way intended to be a collaborative project. But I guess that shouldn't surprise anyone either. It's Apple, after all.
- smitherfield 9y agoApple's made some pretty big genuine contributions to open-source: WebKit, LLVM[1]/clang, Swift, OpenCL.[2] [1] Yes, technically "not Apple" in the sense that Node.js isn't Joyent. [2] Admittedly partial credit at best since they've orphaned it in favor of their proprietary Metal API. I'd guess however that Metal will get open-sourced pretty soon.
- bemused 9y ago
- mindcrash 9y agoNo, because this thing, darwin-xnu AKA the OSX/iOS microkernel, was already opensourced through https://opensource.apple.com/ https://opensource.apple.com/ for both iOS and OSX (to be precise, the source tarballs can be found here: https://opensource.apple.com/tarballs/xnu/ https://opensource.apple.com/tarballs/xnu/) What is new however is that Apple is now seemingly actively using GitHub to publish their opensource contributions.
- JimDabell 9y agoApple using GitHub isn't new, they've been doing it for at least a couple of years. ResearchKit was their first GitHub repository I think.
- AlphaSite 9y agoIsn’t it Swift?
- lobster_johnson 9y agoMinor correction: XNU is not a microkernel.
- fnj 9y agoXNU is a hybrid kernel incorporating large elements of Mach (microkernel) as well as BSD (monolithic kernel).
- atombender 9y agoThe term "hybrid" is not a particularly useful concept, since the whole idea of a microkernel is to achieve stability and extensibility by placing only a minimal kernel in kernel space, and have everything else (drivers, file system, etc.) live in userland. XNU is built on Mach (initially 2.x back when it was NeXTStep/OpenStep, later 3.0 for OS X), but everything runs in a single address space. Mach ports are retained throughout the OS as a communication mechanism, including userland, but all the core stuff is in the kernel, and Apple has transitioned many Mach port IPC responsibilites to more traditional syscalls to work around the fact that ports are comparatively slow. For example, all POSIX operations such as read and write are BSD syscalls that correspond to entrypoints in the kernel; they're not IPC messages.
- beefhash 9y agoSee also: https://news.ycombinator.com/item?id=15371102 https://news.ycombinator.com/item?id=15371102 and https://news.ycombinator.com/item?id=15371111 https://news.ycombinator.com/item?id=15371111 There seems to be some confusion on whether the iOS kernel was or was not newly open sourced and whether it's the complete iOS kernel or not.
- monocasa 9y agoI don't see why there's confusion. AArch64 support in platform export (like hal.dll for XNU) seems to be stubbed out and unimplemented meaning that the ARM support is at least from an ancient iOS kernel. https://github.com/apple/darwin-xnu/blob/master/pexpert/arm/pe_serial.c#L168 https://github.com/apple/darwin-xnu/blob/master/pexpert/arm/...
- payne92 9y agodupe: https://news.ycombinator.com/item?id=15371102 https://news.ycombinator.com/item?id=15371102 and https://news.ycombinator.com/item?id=15371111 https://news.ycombinator.com/item?id=15371111
- nextos 9y agoTo someone not familiar with Darwin internals, are drivers bundled or is it possible to get binary blobs? Does this mean we can build an open source stack that could run on iPhone or iWatch?
- new299 9y agoWithout the ability to sign the kernel, even if you could build one you wouldn't be able to run it.
- thinkloop 9y agoThat's big, what's their purpose for open sourcing if not to allow developers to build on it?
- comstock 9y agoIt’s possible that this might help security researchers find/fix bugs. It may help other developers understand how iOS works. Overall, I think it’s unlikely to be hugely useful, in terms of actuallly using it for anything.
- newhouseb 9y agoA significant fraction of iOS/macOS/tvOS is now relegated to kernel extensions and this trend has only been increasing -- HFS+ IIRC is now in a (closed source) kext and APFS has been from the start. So while it's admirable that Apple is more actively using Github, this is by no means demonstrative of Apple open sourcing their crown jewels. Running a custom kernel on anything but macOS would still be a herculean amount of work.
- mrpippy 9y agoHFS is open-source, both the kext and utilities (fun to see that fsck is using code from the early 90s Disk First Aid). I built the kext for Sierra and it wasn’t too hard. https://opensource.apple.com/source/hfs/hfs-407.1.3/ https://opensource.apple.com/source/hfs/hfs-407.1.3/
- amrrs 9y agoWith a blog for Machine Learning where Apple shares some of its practices and now open-sourcing its iOS kernel for the first time, Apple is entering a new era of Post-Jobs where every company has started to believe the only way to attract quality resources is to contribute back to the society - Remember how this community scared FB to rewrite React License. It's a great way forward for FOSS and hopefully one that can set up the right way for Post-Cook Apple.
- new299 9y agoIt's a start. It would be nice to see more of iOS open sourced. Not everything, but enough to run the GUI and maybe Safari. I think that could be a huge win for Apple. Lower end, open source iOS compatible phone could attack Android offering, particularly at the lower end. They'd gain control over the market (as it would be derived from their source, and compatible with their ecosystem) without having to do much work. Honestly, if Apple don't do it, someone should come up with an open source iOS compatible offering, which developers could easily re-target their apps to. VCs reading this, I'm offering 15% for 3MUSD for the above idea. ;)
- flachsechs 9y ago> They'd gain control over the market what you described is a loss of control. business is hard.
- madeofpalk 9y agoI think Apple (and everyone else) is doing pretty well with their closed source software. Apple doesn't need others to make lower and cheaper devices. They're more than capable of doing it themselves, they just don't want to.
- comstock 9y agoNo, they don’t want to. But I think it would be advantageous to them to not have Android around. Potentially they could convert many Android users to open source iOS. It wouldn’t come with the branding, I think it could be to their advantage. It’s not likely to happen, but I think an open source iOS clone/fork would be nice and could also have potential benefits for Apple.
- amelius 9y agoNice, but I don't want open software as much as open hardware. (For software, there are plenty of alternatives).
- dest 9y agoPeople are never happy.
- asveikau 9y agoIt strikes me that the unhappy people are not always the same ones and don't always have the same reasons. For example I imagine there are a few people long unhappy with Darwin's open/closed hybrid state that are perfectly happy with Linux or *BSD ... And a bunch of those won't necessarily increase their happiness with Apple even if they open up a bit more. So it's correct to say Apple can't or won't please that type.
- kzisme 9y agoWhat makes you say that?
- amelius 9y agoLack of good options to put a libre OS on phone hardware and build a libre phone. Why can my top-of-the-line desktop be libre but must my phone be locked down?
- rhodysurf 9y agoWithout hardware and userspace this is pretty useless to anyone but security researchers right? That is why he said that I would imagine.
- sigmar 9y agoOdd that there wouldn't be a public explanation for this. Poking through board_config I found support for the A10X (T8011), and for the three Apple Watch chips, but not for the new A11 SoC (T8015).
- navalsaini 9y agoThis means that we should have cheap non-apple phones capable of running iOS applications. Why would apple allow that?
- sosborn 9y agoKernel != userspace macOS kernel has been open source since OSX came out.
- AsyncAwait 9y agoIt does not mean that at all. This is not iOS itself being open-sourced, only the Darwin kernel is open-source, which is pretty much useless in isolation, certainly for trying to develop a cheap phone to run iOS apps.
- navalsaini 9y agoOic ... the framework/middleware is not. I took parallels to Android. Thanks for correcting me.
- walterbell 9y agoAt the Tencent security conference in August, there was a demo of ARM iOS booting on virtualized iPhone6 hardware on x86 Macbook. Video clip was on Twitter but since removed.
- waynecochran 9y agoInteresting side note, source contains 8701 goto statements -- I like it. $ find . -name "*.c" -exec grep goto {} \; -print | wc -l 8701 Most of it to unify releasing resources on function returns to one place at the end of the function body. This is what makes RAII in C++ so important/convenient.
- efiop 9y agoYou are saying it like if 'goto' was a bad thing. This is pretty normal for any kernel/system projects.
- winkywooster 9y agoAnd the same command on the Linux source returns 160,818. It's interesting how Dijkstra's take on the use of goto has blinded a large number of developers on the practicalities of its use.
- 0xcde4c3db 9y ago> This is what makes RAII in C++ so important/convenient. This reminds me of the C++ developer who, when asked what his favorite snippet of C++ source code was, replied with: }
- thought_alarm 9y agoTabs instead of spaces. Tsk, tsk. https://i.imgur.com/VE7kEeC.png https://i.imgur.com/VE7kEeC.png "debo" must have been an intern.
- kev009 9y agoDang, no APFS. Was hoping to gauge how portable it'd be to *BSD.
- adamnemecek 9y agoYou have zfs.
- yjftsjthsd-h 9y agoIt's still nice to have options.
- kev009 9y agoI love ZFS and use it as much as possible. But we make heavy use of UFS at $work because sendfile and fail in place. I'm in the market for a flash filesystem for this use case. I doubt APFS has that all figured out, but it might be technically interesting enough to do so, and it might integrate move coherently with the pager than ZFS (the ARC makes this quite difficult but not impossible to do sendfile/mmap w/o extra copying)
- GalacticDomin8r 9y agoHave you tried nandfs? I have not, so I don't know if it meets your needs.
- gok 9y agoThe new GitHub home aside, there's some cool stuff in XNU. The memory compressor, process hibernation, activity tracing, DTrace...worth poking through!
- buildbot 9y agoLooks like they are working on NVRAM support : https://github.com/apple/darwin-xnu/blob/master/iokit/Kernel/IONVRAM.cpp https://github.com/apple/darwin-xnu/blob/master/iokit/Kernel...
- abrowne 9y agoAll Macs have NVRAM for settings like default boot disk, volume and display brightness.