Rian Booyer
Instructor Jason Oesterly
Ciss 301 DEA – Operating Systems For Business Computing
21 October 2017
Mac OS X Vs Linux
I originally decided to do a comparison between Microsoft Windows operating system and Linux but unfortunately, they are very particular with what they decide to share so I have moved to a comparison of Mac OS X and Linux (general). One thing I have found is that Max OS X and Linux are very close in how they operate from memory management, file allocation, network support and other portions of the operating systems. The main difference I have found is that Macintosh decided to lock their operating system to a very limited amount of hardware (originally the power pc processor now intel processors but you still can’t install it on pc’s) while Linux can be installed on most processors and machines varying from mobile systems to complete server farms and can be customized to what you need it for. Personally, I use Linux CentOS distribution for a temporary Linux web and email server until I can get my hosting back up and going, however, I still prefer Linux hosting.
Design Goals
Design goals are a very general topic, especially when It comes to Linux. Linux design goals can vary between different builds, software and hardware you run on. Think of the difference between a pc running CentOS, a server running a paid RedHat distribution, or even a phone that uses Android that started out primarily as Linux but incorporates quite a bit of java now. The original creation of Linux is credited to Linus Torvalds who decided to create the original Linux kernel because of a widely free Unix operating system was not available for the intel 80386 processor he had in his computer and he decided after some experimentation that he wanted to provide one. Inspired by Unix, Minix, and BSD, Linux was born and parts of those operating systems were already converted for use on Linux such as BASH which is like a dos terminal just more powerful, GCC which is a C compiler but in newer versions C++ was added. All this was done before he decided to announce it and give it away on UseNet (1).
Major design principles in modern Linux include the need for a multi-user, multi-tasking system that runs Unix-Compatible tools, the filesystems Linux uses, even though the list has grown to a vast number, try to adhere to Unix semantics and it tries to adhere to the Unix networking model. Linux tries to be compliant with POSIX and its programming interface adheres to the SVR4 Unix Semantics rather than BSD behavior. Its main components are the kernel, system libraries, and the system utilities (2).
Macintosh Mac OS X’s goals were a little different. Mac OS X is a retail paid operating system that under the hood is very similar to Linux that in my opinion is more concerned on appearance while Linux (depending on who makes it) tends to be free and does many of the same things a Mac OS does just quite a bit more advanced. Macintosh OS X is based on BSD (Berkeley Software Distribution) version of the Unix Operating system (3).
Both Mac OS X and Linux distributions are trying to support open standards. One thing that people forget is that Linux is really (as mentioned above) just a kernel, some libraries and a few utilities. The main standards are brought about by developers and individual projects that are added to the Linux distributions where the projects can be paid or free but most of the time you can find a free version if needed.
Graphical Interfaces
Mac OS X and Linux both offer a graphical user interface, however Mac OS X offers a single interface, Aqua in the current versions, and Linux has an ever-increasing number of what they refer to as Desktop Windows Managers. Currently there are over forty six and counting window managers for Linux (27). What does this mean? Too many choices and quite a bit of a learning curve. The only benefit I see to this is that somewhere out there is a window manager that is customized for each user type that won’t confuse them or is tailored to their specific job. However, as a general workstation Mac OS X comes with their new Aqua windows manager that is supposed to be designed for the general user with default application links arranged out to be visually appealing and easily learned. One thing to note is that you can install additional window managers designed for Mac OS X which number almost as much as Linux but with Macintosh focusing on only a few the user experience isn’t as confusing as the one’s in Linux (28).
Memory
Both Linux and Mac OS X use similar methods for memory management, Allocation, and Paging. Most of these methods are pretty simple Mac OS X and Linux have similar names for their management routines. Macintosh goes more in depth of a few things such as their use of “Inactive” and “Wired” memory. Inactive memory is ram that isn’t actually being used but it has been recently used by a program. It allows programs to re-allocate the memory if they are used very often but it also allows after a certain amount of time for other programs to capture the memory. This way programs you use often can open faster. Wired memory is memory that can’t be paged using virtual memory such as kernel routines or services that would possibly fail or cause the system to become unstable because they need to operate in the faster main memory. I suspect that Linux uses a similar allocation method but I haven’t been able to find anything to confirm this (4).
Linux and Mac OS X use virtual memory and memory pages to swap out memory to the primary storage devices on the system. This allows programs to address more memory than is available. For example if a system only has four gigabytes of ram a program that requires 6gb ram would use most of the four gigabytes of ram and have a section of the paging file or the swap partition on Linux. Both Mac OS X and Linux by default use 4k memory pages. Mac OS X is easily changed to be able to use large memory pages while Linux takes some doing to change the default to a larger (1Mbyt on x64 bit hardware) page size (5)(6).
Processes
Process management is one area we can compare that is very interesting. Max OS X uses the Mach 3 scheduler that is somewhat similar in appearance to the windows task manager in that processes have a priority of only four types: Normal, System High Priority for threads which have been raised above normal, Kernel mode only that is reserved for threads created inside the kernel that need to run at higher priority, and real-time threads whose priority is based on a well-defined fraction of total clock cycles regardless of other activity. Now this is different than Linux because it still uses the Unix model that creates new processes using a Fork that creates a process control block that contains all the information about the process including its identity (PID), Environment (inheritable properties from parent PID), and its context that handles the scheduling, file table, signal handler, and virtual memory information. In Linux process priority can be changed programmatically or by commands from the terminal; however so far, I have found that Mac OS X process priority can only be changed programmatically according to their developer website but in the question groups online people have stated that you can change the priority similar to Linux through the activity monitor or like Linux running nice or renice. Without hands on experience with a Macintosh I can’t confirm this (7)(8).
Even though they are quite different from each other both systems use the preemptive scheduling policy to manage the processes currently being worked on this way if a process needs cpu time immediately the process manager can transfer the cpu to another job when needed (9)
Device management
Device management is a very important part of the operating system. Without it the system wouldn’t know what resources it has available and in modern systems that use hot swappable devices such as USB devices or SATA drives that can be removed without rebooting the system keeping track is much more important. The information on Mac OS X is listed that the device manager takes care of all these important steps but what happens in the background is pretty much hidden from the public. Linux on the other hand is very documented on how it takes care of this operation.
Device management in Linux is handled by three components; Udev, HAL, and Dbus. Udev supplies a dynamic device directory containing the devices connected to the system, many systems use the /dev folder for Udev “nodes” that are created and removed as the devices are plugged in or removed. The Hal service gets information from the Udev service and creates an XML representation of that device then notifies the corresponding graphical desktop applications through Dbus that the device exists. Personally, since I use the terminal more than I use a graphical interface I mount devices using the /dev listings all the time. Most servers I set up don’t even have a graphical side to them to save on resources that lay stagnant and could be used for other services and operations (10).
File management
File management can be handled in both Mac OS X and Linux through graphical means to add, delete, move, or even set securities using their OS specific utilities. Linux utilities vary based on the distribution and display manager you are using while Macintosh OS X uses similar versions of the same file manager throughout it’s different versions. This would be an advantage to Macintosh users since they wouldn’t have to re-learn the tricks of their graphical environment every time they upgrade, or in Linux’s case switch distributions. Linux currently uses quite a few file managers but the most popular one’s are Konqueror, Dolphin, Krusader, and Nautilus just to name a few (11).
Both Mac OS X and Linux support terminal commands to allow Unix like control over the file system and have a very similar command structure. Some of the commands include: ls to display a directory, del to delete a file, mkdir to create a directory and rmdir to remove it. They both also use chmod to change read/write permissions and chown to change user/group access for the files on the file system (12) (13).
One terminal utility I like to use in Linux that isn’t usually included in the different distributions is called Midnight Commander that resembles the old dos file manager but it has the ability to do everything above but also edit files, have multiple folders open at the same time and even ftp to a site and display a list of files on the site for download. Depending on the file system it also has the ability to change what users have access to files and modify the permissions of the specific files itself (chown and chmod commands) (14).
One big difference is the built-in file system support. Macintosh supports only a few such as the HFS+ which was its primary file system until 2017 when it was replaced with APFS (Apple file system). Other file systems it supports natively are Fat32, exFat and read only NTFS. This is a big limitation however a utility exists called fuse that allows modules to be loaded to support a wide range of operating systems in Mac OS X (16).
Linux supports many file systems as well with its primary file system in use today being the Extended File System which has evolved from its primary version (EXT) to the newest version of EXT4. The versions have increased file size support, journalizing, directory size extension and many other options. However, with EXT being Linux’s primary partition it still supports a vast number of partitions with either read/write capabilities or just read. If your kernel doesn’t natively support the file system you can either recompile it to support it or compile in modules to support the file system you wish to have. Some support can be added by installing packages that have precompiled modules to instantly obtain the functionality you need (16) (17).
Here is a small list of the Linux file systems:
Security
Both Linux and Mac OS X support users and groups to sort them out. Administrative users such as root can be either disabled by default (usually on Mac OS X by default or some Linux distributions it’s disabled by default). Root is an especially powerful user. With it the entire system can be changed or even corrupted, therefore in best practice it is best to either disable the root user completely or lock it out with a very complicated password.
As with most operating systems Mac OS X and Linux encourage usage of users that have a lower access level than root. In Linux, a user can install software, delete files that are not important to the system and even crash their desktop user experience. The solution is usually to back up their files and re-create their desktop environment which is easy to do. The main point here is that if there is a crash usually it’s not a system killer, you can recover from it.
Both operating systems support password restrictions based on complexity, past password similarity, and aging of the password. You can further harden this by implementing Kerberos password management which is available to both systems. One thing Linux has over Mac OS X is the option for SELinux which comes default now. SELinux is complicated to say the least, it operates by controlling how the system operates within itself by controlling “objects” and how they interact with files, devices, sockets, and ports to name a few. For example you can restrict what configuration files a web server can access as part of its configuration by setting a rule to deny access to that specific server software. In Mac OS X you have to port something similar into the system (18) (19) (20) (21).
Both Linux and Mac OS X come with built in firewalls to block unwanted ports from being accessible or programs access from the outside or from the inside to the network. The Linux firewall is commonly referred to as firewalld and uses iptables commands and the Mac OS X is just named firewall (22) (23).
Network management.
This section is going to be the hardest section of them all. First I’m going to approach Linux because of the vast configuration options available. With one Linux computer you can configure it to be for example, a bridge between networks, a router, a web server, file server, ftp server, email server, and the list goes on. It can be used in LAN’s, Peer 2 Peer configurations in a small network, a workstation and even a gaming machine. The possibilities are endless. Protocol support for different network types are vast and growing with each new release of the Linux Kernel. It supports common technologies like ethernet, Tcp/Ip, routing, and even uncommon technologies including token ring, frame relay, DECNet and many more and over a vast amount of connectivity devices such as a Network card, serial port, fiber, wireless technologies. All this but it doesn’t make Julien fries. Although you could install Linux on a raspberry pi and configure it to run a machine that makes Julien fries (24).
Mac OS X on the other hand is not as impressive. They tend to be tight lipped on what topologies, protocols aside from tcp/ip it would support or even what the server version can do (although it tightly resembles what a windows server offers) (25).
According to one Mac server site the Mac OS X can act as a server but it is limited. It can do profile management, web services, be a website server and a few other things. Personally, I’m not impressed (26).
Conclusion
With these two operating systems being similar yet different my choice would be obvious. Have you guessed it? If you chose Linux you would be right. I have used Linux since the later 1990’s for servers, workstations, network equipment (using it as a router, firewall, webserver, etc) and hands down I trust it over many other operating systems out there including windows.
Mac OS X tends to be “prettier” than Linux but I rarely use the graphical interface unless I am setting up a workstation. Mac OS X has more standardized graphical tools than Linux since the tools in Linux vary depending on the distribution, X window system and display manager used (KDE, GNOME, etc.) so it makes it somewhat confusing and once you learn the graphical interface for the distribution they change something that makes you need to switch. For example, I used to use RedHat until they decided to charge for it, then I switched to Fedora which RedHat created for its “free” offering but Fedora became so engrossed on being a workstation operating system that I switched to CentOS. These distributions are based off RedHat and I have never tried a Debian based Linux like Ubuntu.
Linux is friendlier to the system administrator while the Mac tends to be friendlier to the basic end user and limits its roles accordingly.
The final thought I would like to share is I wish I did have experience with Macintosh no matter the version of the operating system. I have seen them used for audio and video editing and they are supposed to be the best for publications, all the newspapers around here use them exclusively.
Works Cited
- “What made Linus Torvalds develop Linux?”, Quora.com https://www.quora.com/What-made-Linus-Torvalds-develop-Linux, Accessed 20 October 2017.
- “Design Principles”, eresources.gitam.edu http://eresources.gitam.edu/comp/gvr(os)/13.2.htm, Accessed 20 October 2017.
- “BSD Overview”, Developer.apple.com https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/BSD/BSD.html, Accessed 20 October 2017.
- “Use Activity Monitor to read system memory and determine how much RAM is being used (OS X Mountain Lion and earlier)”support.apple.com https://support.apple.com/en-us/HT201538, Accessed 20 October 2017.
- “Chapter 3 Memory Management” tldp.org http://www.tldp.org/LDP/tlk/mm/memory.html, Accessed 20 October 2017.
- “About the virtual memory system” developer.apple.com https://developer.apple.com/library/content/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html, Accessed 20 October 2017.
- “COP 4610: Introduction to operating systems (Spring 2015)” cs.fsu.edu http://www.cs.fsu.edu/~zwang/files/cop4610/Fall2016/chapter18.pdf, Accessed 20 October 2017.
- “Mach Overview” developer.apple.com https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html#//apple_ref/doc/uid/TP30000905-CH209-TPXREF101, Accessed 20 October 2017
- Understanding Operating Systems 7th Edition, Ann McIver McHoes et al. pg 116
- “Udev: Introduction to device management in modern Linux System” linux.com https://www.linux.com/news/udev-introduction-device-management-modern-linux-system, Accessed 20 October 2017
- “8 file managers to try” opensource.com https://opensource.com/business/15/4/eight-linux-file-managers, Accessed 20 October 2017
- “How to set file permissions in Mac OS X” macinstruct.com http://www.macinstruct.com/node/415, Accessed 20 October 2017
- “How to manage files from the linux terminal: 11 Commands you need to know” howtogeek.com https://www.howtogeek.com/107808/how-to-manage-files-from-the-linux-terminal-11-commands-you-need-to-know/, Accessed 20 October 2017
- “ An introduction to Midnight Commander” tldp.org http://www.tldp.org/LDP/LGNET/23/wkndmech_dec97/mc_article.html, Accessed 20 October 2017
- “How to mount and manage non-native file systems in OS X with FUSE” macworld.com https://www.macworld.com/article/2855038/how-to-mount-and-manage-non-native-file-systems-in-os-x-with-fuse.html, Accessed 20 October 2017
- “Filesystems(5) Linux Programmer’s Manual…” man7.org http://man7.org/linux/man-pages/man5/filesystems.5.html, Accessed 20 October 2017
- “Category: File systems supported by the Linux Kernel” Wikipedia.org https://en.wikipedia.org/wiki/Category:File_systems_supported_by_the_Linux_kernel, Accessed 20 October 2017
- “Red Hat Enterprise Linux 4: Red Hat SeLinux Guide” access.redhat.com https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/SELinux_Guide/selg-preface-0011.html, Accessed 20 October 2017
- “Chapter 3. Using Kerberos” access.redhat.com https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Smart_Cards/Using_Kerberos.html, Accessed 20 October 2017
- “Security – Enhanced Darwin: Porting SELinux To Mac OS X” researchgate.net https://www.researchgate.net/publication/249683692_Security-Enhanced_Darwin_Porting_SELinux_to_Mac_OS_X, Accessed 20 October 2017
- “40 Linux Server Hardening Security Tips [2017 edition]” cybercity.biz https://www.cyberciti.biz/tips/linux-security.html, Accessed 20 October 2017
- “OS X: About the application firewall” support.apple.com https://support.apple.com/en-us/HT201642, Accessed 20 October 2017
- “Benefits of using firewalld” firewalld.org http://www.firewalld.org/, Accessed 20 October 2017
- “Linux-Networking-HOWTO (Previously the Net-3 Howto)” tldp.org http://www.tldp.org/HOWTO/NET3-4-HOWTO.html, Accessed 20 October 2017
- “MacOS Server” apple.com https://www.apple.com/macos/server/specs/, Accessed 20 October 2017
- “Get started with OS X Server” help.apple.com https://help.apple.com/serverapp/mac/getstarted/5.1/#/, Accessed 20 October 2017
- “What are the best window managers for Linux?” slant.co https://www.slant.co/topics/390/~best-window-managers-for-linux, Accessed 20 October 2017
- “What is the best window manager for Mac?” slant.co https://www.slant.co/topics/526/~best-window-manager-for-mac, Accessed 20 October 2017