18-01-2025
Lecture 5:OS Structures
Operating Systems
Dr. Anjali
Assistant Professor
Operating Systems: How are they organized?
• Simple
• Only one or two levels of code
• Layered
• Lower levels independent of upper levels
• Modular
• Core kernel with Dynamically loadable modules
• Microkernel
• OS built from many user-level processes
1
18-01-2025
OS Structure - Simple Approach
• MS-DOS - provides a
lot of functionality in
little space.
• Not divided into modules,
Interfaces and levels of
functionality are not well
separated
Original UNIX System Structure/ Monolithic
• Limited structuring, has 2
separable parts
• Systems programs
• Kernel
• everything below system call interface and above
physical hardware.
• Filesystem, CPU scheduling, memory
management
2
18-01-2025
Monolithic
Pros
• All kernel routines are together,
• l Shared kernel space
linked in single large executable
• l Good performance
• Each can call any other
Cons
• Services and utilities • l Instability: crash in any
• A system call interface procedure
• Examples: • brings system down
• Linux, BSD Unix, Windows, … • l Inflexible / hard to maintain,
extend
Layered OS Structure
• OS divided into number of
layers - bottom layer is
hardware, highest layer is
the user interface.
• Each layer uses functions
and services of only lower-
level layers.
• THE Operating System and
Linux Kernel has successive
layers of abstraction.
3
18-01-2025
Microkernel System Structure
Application File Device user
Program System Driver mode
messages messages
Interprocess memory CPU kernel
Communication managment scheduling mode
microkernel
hardware
Monolithic vs. Microkernel OS
• Monolithic OSes have large kernels with a lot of components
• Linux, Windows, Mac
• Microkernels moves as much from the kernel into “user” space
• Small core OS components running at kernel level
• OS Services built from many independent user-level processes
• Communication between modules with message passing
• Benefits:
• Easier to extend a microkernel
• Easier to port OS to new architectures
• More reliable and more secure (less code is running in kernel mode)
• Fault Isolation (parts of kernel protected from other par
• Detriments:
• Performance overhead severe for naïve implementation 8
4
18-01-2025
A microkernel OS
Modules
• Many modern operating systems implement
loadable kernel modules
• Uses object-oriented approach
• Each core component is separate
• Each talks to the others over known interfaces
• Each is loadable as needed within the kernel
• Overall, similar to layers but with more flexible
• Linux, Solaris, etc
10
5
18-01-2025
Solaris Modular Approach
11
Hybrid Systems
• Most modern operating systems are actually not one pure
model
• Hybrid combines multiple approaches to address performance,
security, usability needs
• Linux and Solaris kernels in kernel address space, so monolithic, plus
modular for dynamic loading of functionality
• Windows mostly monolithic, plus microkernel for different subsystem
personalities
• Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa
programming environment
• Below is kernel consisting of Mach microkernel and BSD Unix parts,
plus I/O kit and dynamically loadable modules (called kernel
extensions)
12
6
18-01-2025
Mac OS X Structure
graphical user interface
Aqua
application environments and services
Java Cocoa Quicktime BSD
kernel environment
BSD
Mach
I/O kit kernel extensions
13
iOS
• Apple mobile OS for iPhone, iPad
• Structured on Mac OS X, added functionality
• Does not run OS X applications natively
• Also runs on different CPU architecture (ARM vs.
Intel)
• Cocoa Touch Objective-C API for developing apps
• Media services layer for graphics, audio, video
• Core services provides cloud computing, databases
• Core operating system, based on Mac OS X kernel
14
7
18-01-2025
Android
• Developed by Open Handset Alliance (mostly Google)
• Open Source
• Similar stack to IOS
• Based on Linux kernel but modified
• Provides process, memory, device-driver management
• Adds power management
• Runtime environment includes core set of libraries and Dalvik
virtual machine
• Apps developed in Java plus Android API
• Java class files compiled to Java bytecode then translated to executable
than runs in Dalvik VM
• Libraries include frameworks for web browser (webkit),
database (SQLite), multimedia, smaller libc
15
Android Architecture
Application Framework
Libraries Android runtime
SQLite openGL Core Libraries
surface media
Dalvik
manager framework
virtual machine
webkit libc
16
8
18-01-2025
Virtual Machines
Physical Machine
Application
OS
Hardware
17
17
Virtual Machines
Virtual Machine 1 Virtual Machine 2 Virtual Machine 3
Application Application Application
OS OS OS
Virtual Machine Monitor (VMM) (aka Hypervisor)
Hardware
18
9
18-01-2025
Virtual Machines
• Use cases
●Resource configuration
●Running multiple OSes, either the same or different
OSes
●Run existing OS binaries on different architecture
19
20
10