Torvalds made the kernel for sysadmins indirectly

You know how sysadmins are like, right? The coke drinking middle-fingerers going through bunch of terminal commands? Torvalds was also a middle-fingerer, fingering it at C++ instead of clients. He also used terminal commands and drunk tons of coke. So Torvalds was a sysadmin, and made Linux kernel terminal for other sysadmins. And this terminal can be accessed via WSL for windows, LDE Crostini for chromeos, and terminal for macos.

Eh?

There isnā€™t a trace or even tiny ā€œblobletā€ of Linusā€™s Linux kernel in any of Appleā€™s operating systems!

They use their own XNU (like GNU, XNU stands for X is Not UNIX) , which is a heavily modified kernel based on the ā€œMachā€ kernelā€¦ Apple have open sourced XNU for decades now. What Apple wonā€™t open source is the GUI part of MacOS or iOS / iPadOSā€¦

On top of XNU, Apple run some BSD based layer called ā€œDarwinā€.

So can I run XNU in place of Linux kernel?
I imagine one might need some sort of compatability package?

Yes you can - you can get Darwin - which is Appleā€™s take on BSD on the XNU kernel, for x86 and suchlike, but thatā€™s all you get, you donā€™t get any of Appleā€™s GUI doohickeys for Mac, iPhone, iPad, iWatch or Apple TVā€¦

Why you would want to, is beyond me :smiley: and probably a subject for someone other than meā€¦


Kernel[edit]

Main article: XNU

The kernel of Darwin is XNU, a hybrid kernel which uses OSFMK 7.3[11] (Open Software Foundation Mach Kernel) from the OSF, various elements of FreeBSD (including the process model, network stack, and virtual file system),[12] and an object-oriented device driver API called I/O Kit.[13] The hybrid kernel design provides the flexibility of a microkernel[14][failed verification ā€“ see discussion] and the performance of a monolithic kernel.[15]

Hardware and software support[edit]

Darwin currently includes support for the 64-bit x86-64 variant of the Intel x86 processors used in Intel-based Macs and the 64-bit ARM processors used in the iPhone 5S and later, the 6th generation iPod Touch, the 5th generation iPad and later, the iPad Air family, the iPad Mini 2 and later, the iPad Pro family, the fourth generation and later Apple TVs, the HomePod family, and Macs with Apple silicon such as the 2020 Apple M1 Macs, as well as the Raspberry Pi 3B.[16][17] An open-source port of the XNU kernel exists that supports Darwin on Intel and AMD x86 platforms not officially supported by Apple, though it does not appear to have been updated since 2009.[18] An open-source port of the XNU kernel also exists for ARM platforms.[19] Older versions supported some or all of 32-bit PowerPC, 64-bit PowerPC, 32-bit x86, and 32-bit ARM.

It supports the POSIX API by way of its BSD lineage (largely FreeBSD userland) and a large number of programs written for various other UNIX-like systems can be compiled on Darwin with no changes to the source code.

Darwin does not include many of the defining elements of macOS, such as the Carbon and Cocoa APIs or the Quartz Compositor and Aqua user interface, and thus cannot run Mac applications. It does, however, support a number of lesser-known features of macOS, such as mDNSResponder, which is the multicast DNS responder and a core component of the Bonjour networking technology, and launchd, an advanced service management framework.


Note - many years ago, Apple ā€œsupportedā€ Linux on some of their PowerPC Macintoshes, MkLinuxā€¦ I had one (still got it somewhere) - PowerMac 601 AV, 66 Mhz PowerPC cpu (same as in IBMā€™s pSeries for running AIX on - and I think the later AS400ā€™s too)ā€¦ Those were considered ā€œold worldā€ PowerPC macs, i.e. they had proprietary ā€œNuBusā€ instead of PCI - and MkLinux was the only Linux available for these ā€œOld Worldā€ PowerPC Macsā€¦ I donā€™t know why they bothered really, it was still an Apple MICROKERNEL (hence ā€œmkā€), running GNU binaries (but taken from the Linux world, not the BSD world), so it wasnā€™t really Linux, it was just GNU on an Apple developed micro kernelā€¦ Linux IS the kernelā€¦

1 Like

Hey, that is interesting. Thanks Daniel for the detail .
I agree, cant find a reason to use it. Maybe if one wanted to do something with a hybrid kernelā€¦

Darwin is just another BSDā€¦ one might as well use a ā€˜realā€™ BSD .
The only thing that would interest me with Darwin would be it might offer a BSD without ZFS. . I might buy that, but it would probably tie me to some weird Apple filesystem, and I would not buy that either.

The biggest turnoff in the BSD world, for home PC users is ZFS. It is just a monstrous overkill for no gain with desktops.

Apple have had a few friendly flirts with Unix and close relatives. It is a real plus for open software.

1 Like

Conversely - I passionately LOVE ZFS functionality on FreeBSD (Iā€™m also a HUGE fan of it on Solaris, and I used to manage a pair of corporate NAS devices that were Oracle ZFS Appliances [ZFS Filer] - rock solid, and surprisingly good performance on mechanical SATA drives!)ā€¦ I think itā€™s (BSD) still some years ahead of Linux in that departmentā€¦ I love ZFS so much, itā€™s my favourite filesystemā€¦ but I wasnā€™t happy with performance on Linux (using ZFS encryption). But - Iā€™m being unfair, I should give ZFS unencrypted, a decent test on Linux, but it was slower (considerably) than ext4 on LVM on LUKS (2.x) on Linux.

I run FreeNAS as my home NAS solution, on a 10+ year old HP NL40 micro-server - using ZFS.

Started out with ZFS on this machine, using FreeNAS 9 in late 2011, with 8 GB RAM (non ECC) and 4 x 1TB drives in RAIDZ1+ (= RAID 5), giving me about 3 TB store, and booting off a USB thumb drive (motherboard conveniently has a USB connector for a thumb drive! These things have a built in SAS controller, that multiplexes up to 4 SATA drives in a ā€œcageā€.

Iā€™ve slowly incrementally upgraded it - itā€™s now got 16 GB of ECC RAM, boots off 256 GB internal SATA SSD, 4 x 4 TB HDDā€™s, giving me ~11 TB (in theory it should be 12, but thereā€™s overhead) ā€¦ Plan is to incrementally double that - with 4 x 8 TB, Iā€™m in no hurry (still got 2 TB free), so I might wait till 10 or 12 or even 16 TB become options (Iā€™ll probably buy a spare power supply for it too) - unless - one of those drives fails before, then Iā€™ll probably go for 8 TBā€¦

i.e. because its RAIDZ+1 - I can set a drive to ā€œfailedā€ in FreeNAS, power it off (HP NL40 doesā€™t support hotswap) pull the drive out, and insert a new one, and mark it replaced, and it will resilver all my data overnight (ECC RAM makes a huge difference!). Thatā€™s how I upgrade my storage, over a series of days, I manually ā€œfailā€ each drive, replace it with a new one with more storage, and let it re-silverā€¦ My current iteration, was updated from 4 x 3 TB drivers (shitty Seagate drives - 2 of whiched failed) to 4 x 4 TB using this methodā€¦

ZFS is one of my favourite things that Sun Microsystems did (and open sourced) before Oracle bought them - I suspect Larry Ellison only bought Sun so he could sue Google over Java patentsā€¦

So much goodness Sun gave usā€¦ ZFSā€¦ NFS (note ZFS even has BUILT in support for sharing data via NFS and SMB). Even NIS and NIS+ were okay (better than Microsoft Windows domains!)ā€¦

1 Like

I dont dislike ZFS. It is for servers and NAS systems and the like.
No use for it in a single desktop.
I just wish the BSDā€™s were not so singleminded about it
It is stopping me going back to BSDā€¦ Void is a close as I can get and still have ext4.

Yes Sun did a lot of good things. NFS is a real survivorā€¦ that means nothing better ever came along. They made rather good hardware too.
The workstation concept seems to have died.

1 Like

Isnā€™t UFS still available as a file system on FreeBSD?

I should give it a whirl again, one of these daysā€¦

Iā€™m sure theyā€™re not forcing users to go ZFS - are they? According to this the default is still UFS :

I should fire it up on my Thinkpad W500, itā€™s a beast of a system, seems great at the time (also about 10 years ago) dual core, I had 8 GB of RAM and a 64 GB SSD in it, and it came with ā€œswitchableā€ graphics, onboard Radeon PCIe, or Intel APU - never got GPU selection to work in any NIX, so most of the time I nust

Yes, that is what I used. Had Freebsd on an ancient 486 for about 20 years. It was very stable, but would only run a primitive window system. UFS was fine

My issue today is, having converted to Linux, everything is ext4. So I cant easily share data files with a BSD OS running alongside Linux.
That is a big disincentive from using bsd to do any serious work.

I guess you have to cope with incompatable filesystems all the time. I choose to avoid it. Dont want NTFS either.

1 Like

Itā€™s possible, but itā€™s definitely not straight forward. As already mentioned, ZFS also exists for Linux.

However, itā€™s probably not seamless to let the two work together, thatā€™s true.

1 Like

That FreeBSD link I sent :


21.2. LinuxĀ® File Systems

FreeBSD provides built-in support for several LinuxĀ® file systems. This section demonstrates how to load support for and how to mount the supported LinuxĀ® file systems.

21.2.1. ext2 / ext3 / ext4

Kernel support for ext2 file systems has been available since FreeBSD 2.2. The ext2fs(5) driver allows the FreeBSD kernel to both read and write to ext2, ext3, and ext4 file systems.

Journalling and encryption are not supported yet.

To access an ext file system, mount the ext volume by specifying its FreeBSD partition name and an existing mount point. This example mounts /dev/ad1s1 on /mnt:

# mount -t ext2fs /dev/ad1s1 /mnt

Says ext4 is supportedā€¦

Yepā€¦ Bane of my lifeā€¦ APFS on Apple (and HFS+), ext4 and/or XFS (thatā€™s one that Silicon Graphics open sourced from IRIX, along with OpenGL [???]), and sometimes ZFS (all the time on my NAS)ā€¦ I donā€™t bother with NTFS, donā€™t have ANY Windows in my house whatsoever, only use Fat32 for /boot/efi, or ā€œ/bootā€ on single board computersā€¦

Went through some pain recently - tried exfat on some big (6 TB) external drivesā€¦ I CANNOT believe that something as BASIC as symlinks (soft) is STILL not supported on EXFAT!
If a filesystem wonā€™t support symbolic links (soft) I WILL not countenance its use!

1 Like

Thanks Daniel,
ext3 and ext4 without journalling sounds limitedā€¦ probably means you can read them but cant write on themā€¦ I will check

What filesystems can you have on the FreeBSD root partition? That might be more restricted. Not as big a problem to me as the data partitions.

Thanks Akito,
Yes there might be a big gap between ā€˜possibleā€™ and full support
Filesystem is one thing you need to work perfectly. Same category as backups.

1 Like

I found this

GNU/Linux can be installed on any filesystem that supports some special constructs (file permissions, symbolic links and device files).

but I can not find an equivalent statement for BSD
I think BSD might be more restrictiveā€¦ UFS , U2FS, and zilch