Operating System Services
• Operating systems provide an environment for
execution of programs and services to programs and
users
• User interface - Almost all operating systems have a user
interface (UI).
• Program execution I/O operations
• File-system manipulation
• Communications
• Error detection
• Another set of OS functions exists for ensuring the
efficient operation of the system itself via resource
sharing
• Resource allocation
• Logging
• Protection and security
A View of Operating System Services
Operating System Structure
• General-purpose OS is very large program
• Various ways to structure ones
• Simple structure – MS-DOS
• Monolithic – UNIX
• Layered
• Microkernel
• Modular
• Hybrid
Monolithic- UNIX System Structure
Monolithic Structure – Original UNIX
UNIX – limited by hardware functionality,
the original UNIX operating system had
limited structuring. The UNIX OS consists of
two separable parts
• Systems programs
• The kernel
• Consists of everything below the system-call interface
and above the physical hardware
• Provides the file system, CPU scheduling, memory
management, and other operating-system functions;
a large number of functions for one level
Microkernels
• Moves as much from the kernel into user space
• Mach example of microkernel
• Mac OS X kernel (Darwin) partly based on Mach
• Communication takes place between user
modules using message passing
• Benefits:
• Easier to extend a microkernel
• Easier to port the operating system to new
architectures
• More reliable (less code is running in kernel mode)
• More secure
• Detriments:
• Performance overhead of user space to kernel space
communication
Microkernal
Layered Approach
• The operating system is
divided into a number of
layers (levels), each built
on top of lower layers.
The bottom layer (layer
0), is the hardware; the
highest (layer N) is the
user interface.
• Each layer uses
functions (operations)
and services of only
lower-level layers
Modular
Modules
• Many modern operating systems implement
loadable kernel modules (LKMs)
• 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
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)
Linux System Structure
Monolithic plus modular design
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
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
Example: Arduino
• Single-tasking
• No operating system
• Programs (sketch)
loaded via USB into
flash memory
• Single memory space
• Boot loader loads
program
• Program exit -> shell
reloaded At system startup running a program