Kernel at the core
Scheules time, guards the gates,
Silent, firm, and fast.
- Haiku by ChatGPT 4o
Our goals for this "Platforms" section are to provide working mental models that help us understand
the OS artifacts of program execution, e.g., performance issues with threading and paging, how to support Input/Output (IO)
with devices and files, and how to create, use, and dispose of system-wide resources.
We will not get into a lot of programming details in favor of emphasizing relatively simple models for these activities.
The models help us reason about and make good design decisions for our code.
In these Basic Bites we adopt the definition:
Platform: machine and operating system on which a program runs
We access this platform through its OS Application Programming Interface (API), usually supported by language-based
standard library wrapper functions.
1.0 OS History
Figure 1. shows a selection of historically significant operating systems and their relationships. Each is annotated
with its first stable release.
more details with help from ChatGPT 4o
-
GM-NAA I/O (1956)
First OS for IBM 701 developed by General Motors and North American Aviation.
Description: Numerical Algebraic Algorithm Input/Output batch-processing system.
-
CTSS (1961)
One of the first time-sharing systems. Development was lead by MIT for the IBM 7090.
Description:
-
Supervisor managed time-sharing and I/O.
-
Monitor loaded user programs and swapped them in and out of memory, an early
version of virtual memory.
-
IBM/360 (1965)
Developed for the IBM System/360 mainframes, provided JCL job control scripting language.
Description: General-purpose OS for business, scientific and government computing.
-
MULTICS (1969)
Developed by MIT, Bell Labs, and General Electric for the GE-645 mainframe computer.
Description: time-sharing system, focused on security, modularity, and resource sharing.
Ring-based protection model, file access control with hierarchucal durectory structure and
paged segmented virtual memory.
-
UNIX (1971)
Developed by Thompson, Ritchie, et. al. at Bell Labs to be simple, portable, with small
composable utilities and a consistent user interface.
Desicription: Everything is a file (devices, inter-process comunication, ...), programs do
one thing well and are composed using pipes.
Features: Hierarchical file system, multi-user and multi-tasking, shell and utilities,
pipes and redirection, eventually written in C to be portable.
-
MS DOS (1981)
Developed by Microsoft for IBM PC and other Intel x86 personal computers.
Description: single-user, single-tasking command-line based system, widely used for personal computing.
-
Mac OS Classic (1984)
Developed by Apple for the Macintosh 128K.
Description: GUI-based system using mouse and keyboard with a flat file system and single-tasking.
Features: replaced command-line interface with windows, icons, and menus with drag-and-drop.
-
Windows 1.0 (1985)
Developed by Microsoft for IBM PC-compatible computers.
Features: GUI shell over MS-DOS with windows, menus, and mouse interaction. Used cooperative multi-tasking.
Used Graphics Device Interface (GDI) and device drivers to handle multiple device types.
-
OS/2 (1987)
Developed by IBM and Microsoft for 32-bit x86 processors.
Description: Used preemtive multitasking and modern GUI for PC computing.
Features: monolithic kernel, Presentation Manager GUI, processes run in protected memory spaces.
-
Linux (1991)
Developed by Linus Torvalds as open-source, UNIX-like kernel, packaged with GNU libraries.
Description: Monolithic kernel with loadable modules allowing drivers and subsystems to be added
at run-time.
Features: POSIX compliant, multi-tasking and multi-user, provides virtual memory and process isolation.
Uses Virtual File System interface, so devices can be accessed like files. Provides Discretionary Access
Control.
-
Windows NT (1993)
Microkernel design, security
-
macOS (2001)
UNIX-based derived from NeXTSTEP
-
iOS (2007)
iPhone OS, based on Darwin/macOS
-
Android (2008)
Linux-based OS for mobile platforms
This "Platform" section presents models for
memory,
scheduling,
Processes,
I/O events
and system-wide resources
like files and mutexes.
The most common platforms are Windows, MacOS, and Linux and they each have their own APIs and underlying processing.
Our discussion will present essentially the Windows models, but we will occasionally cite differences from the other
operating systems, shown in Figure 1., to avoid misleading readers. All the models are appropriate, independent
of the OS, subject to many differences in details below the model level.
Unix was developed by, and for many years, maintained by Bell Laboratories. It was one of the earliest of the modern
multi-user platforms. The various flavors of Unix are compliant or nearly compliant with
POSIX, an IEEE standard for a
common Unix interface and internal processing.
Linux has developed independently from Unix,
but adheres closely to the Unix processing models and API.
MacOS started life as a fork of Unix, has evolved significantly, but still maintains many
of the internal processing models and APIs provided by Unix.
Windows was initially developed from ideas implemented in the IBM/Microsoft operating system OS/2.
The Windows internal process models and APIs
are quite different from those used in Unix, but you see echos of the Unix ideas in much of the current Windows
implementation. Windows NT, derived from OS/2, was used to port facilities of the single-user DOS operating system to
a modern OS that supports Graphical User Interfaces (GUIs) and concurrent users. Windows 10 and 11 are direct
decendents of NT.
3.0 Kernel Objects
Kernel objects are used for mapping and sharing memory pages, managing threads, supporting asynchronous I/O,
etc. They provide access to system-wide resources.
Each of the common operating systems uses a form of object management based on handles that allow a program
to create, access, manipulate, and destroy an instance of some object residing in the kernel, e.g., a file, thread, mutex,
I/O completion port, memory mapped file, and
others. The platform provides, through its API, a way to name an instance, allowing sharing of instance data that
resides in the kernel, between scopes in one program and between programs running in the same machine.
4.0 References:
-
Building OS from scratch in Rust for Raspberry Pi
Stanford CS140e - Operating Systems, Sergio Benitez
-
Kernel Objects
-
Object Oriented Design Patterns in the Kernel
-
linux kernel tutorial