Files Management Inter Process Communication Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Abstract- The report is about brief overview of the design and architecture of Macintosh Operating System (Mac OS X). It also includes an insight to its process management, memory management, inter-process communication, file management, and I/O device management, which are considered to be five main aspects of every operating system's design. This case study intends to briefly cover the basic understanding of the operating systems in terms of Mac OS X.

Key words: Mac OS X, process management, files management, inter-process communication, memory management, I/O device management, Kernel Architecture


Apple Inc. is one of the famous names in computer market who has been also popular in manufacturing and developing a series/line of different graphical operating systems besides other different hardware and software products. Among these graphical operating systems, Mac OS X is the most recent and the most developed and widely accepted one. The main difference between the early developments of Macintosh operating systems and OS X is that latter is UNIX based while formers were not. [1]


If traced back, Apple Inc. brought forward to the computer market its first Macintosh personal computer 28 years ago (in 1984). Their operating systems i.e. Macintosh operating systems, were later seen including different bundles and frameworks. [7] As the Mac operating system evolves, the naming conventions also saw new directions. Earlier systems are known as 'System Software' or just the 'Systems'. [2] System Software of Apple Inc. saw seven different evolution phases or stages and the evolved systems were given the names of System 1, System 2, System 3, and so on. Analyzing these very earlier systems, first four phases (System 1, 2, 3, and 4) had the capability to operate on only one task. Such systems are generally categorized as uni-tasking systems. They are simple systems and do not involve complex process and memory management techniques or even scheduling methods. The file system these systems deployed was the Mac File System (MFS). In later developments, MFS was replaced with Hierarchical File System (HFS). [7] Apple Inc. deployed multitasking features in their developments after System 4. System Software 5, thus, was the first Mac OS that operated on more than one task, which were also cooperative and synchronized. Scheduling techniques were introduced. Memory and process management strategies became complex and enhanced. Although, this evolved version lacked certain features like stability, steadiness, and durability and reliability, System Software 6 fixed all these issues too. Next step was a system with an effective user interface (UI), support for newer applications and improvements/enhancements to system's stability. System 7 was then the last 'System Software' that handled all such improvements along with many other as well. After System 7, Apple Inc. shifted the naming convention of its operating systems from System Software to Mac OS. Mac OS 8 succeeded System Software 7. It included its different versions like 8.1, 8.2, etc. that collectively possessed different improvements like support for Power PC G4 processor, Universal Serial Bus, Hierarchical File System Plus (HFS+) that is an enhancement to the original HFS, Firewire, nanokernel and various multiprocessing services. Mac OS 8 was followed by Mac OS 9 that only tackled and incorporated 'transitional' or makeshift technologies that help integrating earlier versions with the latest versions of the Mac Operating Systems. [3]

The first version of Mac OS X (or OS 10 / OS X) was released in 1999. This release holds different advance features that are briefly discussed in the next sections. Apple Inc. again changed the naming conventions and called different issues of OS X as Cheetah, Puma, Jaguar, Panther, Tiger, Leopard, Snow Leopard, Lion and Mountain Lion.


Mac OS X is the latest development from Apple Inc. and has a number of different releases, each being an enhanced version of its predecessor. It adds value to the earliest operating systems by incorporating in it following main features:



Enhanced networking facilities

Programming edges using object oriented techniques or model

The kernel of OS X provides:


Memory protection


Inter-process communication (IPC)

Sustenance for various types of file systems

Time sharing


XNU is the name given to the kernel of OS X. It is a hybrid or cross kernel [7] that collects features and architectural facets of Mach kernel and Berkeley Software Distribution (BSD - a.k.a. Berkeley Unix). I/O kit is another feature that makes Mac OS X kernel unique and different. With this kit, the XNU kernel manages different device drivers. Like many other operating systems, Mac OS X also encompasses different OS aspects like file system and networking.

Fig. 1. OS X Kernel Architecture

As it is UNIX based, XNU is also an open source. OS X kernel and other components of Mac operating system refer to as 'Darwin'.

Talking about Mach kernel first, it mainly provides 'processor resources management' to the Mac OS X. It includes: [6]

CPU sharing

Memory allocation

Memory protection


Inter process communication

Data sharing


Remote procedural calls (RPC)

Symmetric multiprocessing (SMP)

Virtual memory (VM) management

BSD layer of the kernel area of OS X architecture is based on BSD architecture, chiefly the Free BSD. It has different components that are liable for: [6]

File system



System calls

Process management


Kernel and POSIX APIs

POSIX threads

KEXTs or kernel extensions are another feature of OS X, besides I/O Kit, which is unique and different from many other operating systems. The dynamic loading or runtime loading of the code to the kernel area without having the effort of recompiling it over and over is the responsibility of these extensions. [4]

Supported Hardware Platforms

OS X supports: [10]

x86-64: versions 10.4.7 through 10.8;

IA-32: versions 10.4.4 through 10.6.8;

PowerPC: versions 10.0 through 10.5.8.

Process Management

Programs become processes when they are brought into memory for execution. OS X has different types of processes that cooperate with each other and conjoin. Macintosh OS says that "Everything is a process". The main types of processes in Mac OS X are background processes, foreground processes and suspended processes. Moreover, there are processes with the support of UI and initiated at a specific time slot; while others run only in the background and has no UI (non-interactive processes). [5], [8]

Some commands that are used commonly are 'bg' (background a process), 'fg' (foreground a process), 'kill' (kills a process) and 'top' (statistics of system resources).

Jobs and Processes

Like every Unix system, OS X has also processes that are related to each other. Every process is a child of every other process, called the parent process. This parent-child relationship among different processes can be traced back to the ancestor processes; the init process being the ancestor of all other processes and having no parent of its own.

There are two main types of jobs - shell jobs and user jobs. A job is essentially a collection of different cooperating processes that execute in parallel for a particular task. User jobs belong to different users and are initiated by them. However, shell jobs are group of processes that are invoked by an instant of a shell or another. There is another category of jobs called suspended jobs. These are groups of inactive or non-executing processes.

Process States

Processes can be found in different states during their entire life. These states are:

0 - Running. The CPU is currently executing this process.

1 -Runnable from main memory

2 -Runnable from swap

3 - Sleeping (waiting for I/O) in primary storage

4 - Sleeping (waiting for I/O) in swap space [9]

Fig. 2. Five Process States

Threads and Tasks

As in every other system that supports threads (running in parallel), a thread in Mac OS X is a light weight process (LWP). Like, a job contains different processes; a process may contain one or more different threads. A 'task' and a 'process' is same in OS X. The definition of a task, however, is slightly different from that of a process'. A task is an assemblage of different resources of a machine. However, a task's existence is dependent on its constituent threads; while the latter controls the task and can access all of its elements. [9]

Fig. 3. Threads


In a multitasking, time shared environment, scheduler play a vital role in allocating system's resources to different tasks one after the other. OS X takes in hand different techniques and methods of scheduling different tasks. These techniques, sometimes, takes into account the priorities of tasks (in a priority driven environ), preemption, time shared allocation of processor using round robin, and First In First Out techniques (in fixed priority environ). Scheduling in OS X helps in parallel running of tasks that support preemption as well as SMP. Threads, which have the highest criticality, usually possess the 'static' priority and are always given the preference. It may also involve preempting and suspending the currently executing job. Non-critical or delay-able tasks can have dynamic priorities.

Memory Management

Mach kernel is responsible for managing memory in OS X. Memory is one of the important resources processes need. In a multitasking system, memory allocation, memory protection, and other memory managing operations are required. If the system is short of main memory that it does not embrace all of the parallel running processes, techniques like paging or swapping are then called for. Macintosh OS X does the same. Some of the addresses are paged or swapped to the address space of secondary memory.

The individual pages of a process or processes are moved to secondary memory and the processor keeps running those processes (even when they are in the secondary memory). When a page is not found in the main memory, the running process is pushed to the 'sleep' state until the desired I/O (data transfer) from secondary memory to main memory is not finished. For extremely severe shortage problems of main memory, all pages of a single process can be moved to secondary storage memory. They are only brought back into the main memory for execution when scheduler schedules the processor for them. Real time processes cannot tolerate delays such as an I/O delay and they are not swapped to secondary memory. If a real time process arrives, scheduler preempts the running process and allocates memory to it. However, if paging also becomes unavoidable for such a process, a portion of it can be paged or swapped. [4], [5]

The different structures that are used by Mac OS X for memory management are resident page table, address map, memory object, and process map. [9]

Inter-Process Communication

In multitasking and cooperative tasking environs, processes communicate with each other for the purpose of sharing data and synchronization. For this purpose, operating systems keep some mechanism for inter-process communication (IPC). In Mac OS X, ports are used for achieving IPC. They are used for one way communication between a client and a server. Client will use one port to send a request to the server and the server uses second port to deliver back the response to the client. [5], [9]

There are different ports belonging to different objects e.g. name ports and control ports. Name port is used to assign a name to a particular object while a control port controls privilege levels.

'Message queues' is another concept in OS X under this heading. Before understanding what these queues are, a 'message' in XNU is needed to be comprehended. A message is composed of original data, copy of that original data, copy of memory addresses, information about ports, access and control information, and kernel information. Different processes can have different privileges for a port. These processes may allow these ports for which they have certain privilege to input messages to the queue. Processes then talk to each other by accessing those message queues. The process that has a 'write' privilege can write messages to the queue; and the process with 'receive' privilege can read the same message queue.

Semaphores are also used in IPC for achieving synchronization. Unlike messages, semaphores do not contain data but only facilitate with wait, post, and post all functions.

Notifications and locksets are other names of concepts used in obtaining IPC in OS X.

When inter-process communication is desired where processes are remotely located, remote procedural calls (RPCs) are used. Their principal lines are transaction focused; and while one is generated, a set of arguments chunk formats is demarcated. A client starts an RPC. The call creates a message which is then queued. That message is then delivered to the server. 'Thread migration' performs the server using clients' resources and enhances transaction is Mach. [9]

File Management

The Darwin kernel outfits a Virtual File System (VFS) that deciphers a file-related system call into the identical call for the suitable file system.

Fig. 4. File management in Mac OS X

File System

Partitions are normally laid out via specific variation of the HFS + file system, which delivers debauched Btree-based searches, stout pseudonyms, and opulent metadata. Partitions can be arranged with HFSX, a case-sensitive different of HFS + projected for compatibility with UNIX software. For interoperability with Windows, systems disks may be formatted with FAT32 or exFAT.

Hierarchical File System Plus

HFS+ is selfsame similar to its ancestor, HFS, in footings of its core style. A volume is an occurrence of a file system. An HFS+ volume can engage in an intact disk, or it may be billed only a room of a disk. The defaulting and ideal sector magnitude for the Mac OS X employment of HFS+ is 4KB. Allocation blocks are numbered successively, and can be stated to by an unsigned 32-bit integer block figure. This was one enhancement above the novel HFS, which was restricted to 16-bit block digits.

HFS+ hold onto the ranges of connecting allocation blocks called extents. An extent is symbolized in HFS+ by a data structure entitled an extent descriptor.

In HFS+, files are resided of two creeks of bytes: resource fork and data fork.

The first two logical sectors and the final logical sector of an HFS+ volume are kept back, granting this held in reserve space is not castoff by Mac OS X. The third logical sector is the volume header, which covers imperative data about the volume for example the localities of the volume's added data structures. Placed nearby the end of the volume is an unconventional volume header, which is a replica of the volume header.

There are numerous vital B-Tree structures in an HFS+ employment. The Catalog B-Tree stores the elementary metadata for the volume's files and directories. The Extents Overflow B-Tree stocks the supplementary extent records of files that are excessively huge to be confined wholly inside the Catalog B-Tree. The Attributes B-Tree holds extended attributes for the volume's files and directories. There survives a Hot Files B-Tree which is used to record info about recurrently retrieved files.

I/O Device Management

Apple has entirely reshaped the Macintosh I/O design, providing a structure for abridged driver development that cares countless types of devices. This framework is called the I/O Kit. All hardware support is provided straight by I/O Kit objects. One exclusion to this decree is imaging devices such as printers, scanners, and digital cameras. [4]

I/O Kit Arcitecture

The I/O Kit affords a ideal of system hardware in an object-oriented framework. Every one category of facility or device is epitomized by a C++ class; each discrete service or device is denoted by an occurrence (object) of that class. [4]

There are three foremost conceptual features of the I/O Kit design: families, drivers, and nubs.

A family terms a pool of high-level constructs collective to all devices of a certain type that grosses the method of C code and C++ classes. Families may take account of headers, libraries, sample code, test hitches, and documentation.

A driver is an I/O Kit object that accomplishes a particular device or bus, bestowing an added theoretical vision of that device to other parts of the system. When a driver is encumbered, its compulsory families are likewise encumbered to deliver obligatory, shared functionality. The wish to load a driver bases all of its reliant on requirements (and their requirements) to be laden first. After all necessities are seen, the demanded driver is laden as well.

A nub is an I/O Kit object that characterizes a plug of link for a driver. It embodies a manageable unit such as a disk or a bus. A nub is loaded as slice of the family that instantiates it. Each nub runs access to the device or service that it represents and provides services such as matching, arbitration, and power management.

Fig. 5. I/O Kit Architecture

Fig.5. illustrates the I/O Kit architecture. In this case, a SCSI stack is shown, with a PCI controller, a disk, and a SCSI scanner. The SCSI disk is controlled by a kernel-resident driver. The SCSI scanner is controlled by a driver that is part of a user application. This example illustrates how a SCSI disk driver (Storage family) is connected to the PCI bus. [4]

The PCI bus driver discovers a PCI device and announces its presence by creating a nub (IOPCIDevice). The nub's class is defined by the PCI family. The bus driver identifies (matches) the correct device driver and requests that the driver be loaded. The SCSI controller driver scans the SCSI bus for devices. The controller driver identifies (matches) the correct device driver and requests that the driver be loaded. Loading the disk driver causes all required families to be loaded as well. In this case, the Storage family is loaded; the SCSI family (also required) is already present. The disk driver is given a reference to the IOSCSIDevice nub. [4]


Mac OS X has managed to become rather Utopian with time. It doesn't alienate one from UNIX. In fact, it gives a very colorful environment to play with: it has Mach, FreeBSD, a nice driver development environment, and a lot of the system's source code to go with it. There is a lot of professional quality (mostly commercial) software available for the Mac. In its current form, Mac OS X is uniquely positioned, unlike any other system, to offer the benefits of the UNIX Universe as well as counterparts (either the same or with similar functionality) of important software from the Windows Universe. Apple has been busy adding to Mac OS X a lot of valuable software they created in-house.

Mac OS X is representative of a "best-effort" approach - Apple took technology they had collected over the years, along with technology that had flourished in the open source world, and put together a reasonable system.