Operating Systems of Mobile Devices (OSMZ)

Week X. (12.4.-16.4.2021)

Another of the operating systems we will mention in this course will be Apple systems (see presentation). Like Microsoft, the company has a rich history, and the beginnings of operating systems for these computers date back to 1984, when the first classic MacOS was introduced (be sure to try the emulator, including applications for MacOS and Microsoft! Word 4.0). The transitions of Steven Jobs between companies influenced the architecture of the systems, so OS X and iOS have parts of various projects in which he participated. The basis is based on parts developed in Apple together with code derived from operating systems NeXTSTEP, FreeBSD and other open source projects.

The current Darwin kernel is a UNIX open source operating system. But that doesn't mean iOS / MacOS is all under this license. The key libraries of Carbon, Cocoa, CoreServices and many others are closed. The source code for ARM processors, ie for the branch used on mobile devices, is also not open. Much published information about the mobile branch was thus obtained by reverse engineering. Apple is very picky about internal information and focuses in its documentation exclusively on application APIs made up of libraries and frameworks. In principle, it does not assume that the application programmer could interact with the operating system directly.

IOS devices use a number of protection mechanisms, such as code signing, bootloader protection, and other mechanisms that prevent unsigned or otherwise modified code from running on the machine. So if you want to get a "root" on your iOS device, you have to perform a Jailbreak, which is a process that bypasses system security and allows you to gain control of the system. The implementation of system calls, which can take negative values, is also interesting. Positive numbers belong to classic POSIX calls, which we know from the Linux kernel, negative numbers belong to MACH kernel system calls. It has also little but unconventional way how to build binary files, which represent a kind of archive of executable codes (fat binaries) for various CPU architectures. Looking at the file system, you will find classic directory structure given by the POSIX standard, as well as a specific Mac system. The way of application distribution is also different; they took the idea of a packages, called bundles from NeXTSTEP. Apple also includes its proprietary HFS / HFS + file system and the newer APFS.

The most detailed description of the internal architecture can be found in Jonathan Levin's book Mac OS X and iOS Internals. Unfortunately, it is an older edition, but nothing newer and just as complex has yet appeared. Because current Macs have switched to the x86 architecture, it is possible to run this system on an unlicensed machine in an unofficial way. Instructions on how to run it in VirtualBox.



Jonathan Lewin Mac OS X and iOS Internals

  • Architecture of OS X and iOS (pp. 17 – 53)
  • File systems and the VFS (pp. 577 – 587)
  • HFS+ File System Concepts (pp. 607 - 630)


After reading the above texts, you should be able to answer following questions from the topics for the exam, specifically:

  • Briefly describe the iOS platform, basic structure, development tools.
  • Describe the basic security mechanisms of iOS applications.
  • Describe the concept of the iOS kernel, what types of system calls it implements.
  • Explain the concept of jailbreak.
  • Describe the distribution of apps in the form of a bundle.
  • Very briefly describe the features of the HFS/HFS+ (or APFS) file system