Operating System: Operating Systems: Internals and Design Principles
Operating System: Operating Systems: Internals and Design Principles
Systems:
Internals Chapter 2
and Design
Principles Operating System
Overview
Seventh Edition
By William Stallings
Operating Systems:
Internals and Design Principles
Operating systems are those programs that interface the machine with
the applications programs. The main function of these systems is to
dynamically allocate the shared system resources to the executing
programs. As such, research in this area is clearly concerned with
the management and scheduling of memory, processes, and other
devices. But the interface with adjacent levels continues to shift with
time. Functions that were originally part of the operating system have
migrated to the hardware. On the other side, programmed functions
extraneous to the problems being solved by the application programs
are included in the operating system.
• Convenience
• Efficiency
• Ability to evolve
Convenience:The OS as a
User/Computer Interface
The OS provides abstractions of the computer
hardware, making it more convenient for
applications to use the computer’s capabilities
It does this through a set of interfaces and
services.
Key Interfaces
New services
Fixes
Evolution of
Operating Systems
Stages include:
Time
Sharing
Multiprogrammed Systems
Batch Systems
Simple Batch
Systems
Serial
Processing
Serial Processing
Earliest Computers: Problems:
Scheduling:
No operating system
most installations used a
programmers interacted
hardcopy sign-up sheet to
directly with the computer
reserve computer time
hardware
time allocations could
Computers ran from a console run short or long,
with display lights, toggle resulting in wasted
switches, some form of input computer time
device, and a printer
Setup time
Users had access to the
computer in “series” a considerable amount of
time was spent just on setting
up the program to run
Simple Batch Systems
• while the user program is executing, it must not alter the memory area
containing the monitor
Timer
Privileged instructions
Interrupts
a program in execution
an instance of a running program
the entity that can be assigned to, and executed on, a processor
time sharing
• be responsive to the individual user but be able to support many users
simultaneously
automatic
support of protection
process allocation long-term
modular and access
isolation and storage
programming control
management
A facility that allows programs to address
memory from a logical point of view, without
regard to the amount of main memory
physically available
Conceived to meet the requirement of having
multiple user jobs reside in main memory
concurrently
Allows processes to be comprised of a number of fixed-
size blocks, called pages
Program references a word by means of a virtual address
consists of a page number and an offset within the page
each page may be located anywhere in main memory
fairness
efficiency
differential
responsiveness
Key Elements of an
Operating System
Different Architectural
Approaches
Demands on operating systems require new
ways of organizing the OS
• Microkernel architecture
• Multithreading
• Symmetric multiprocessing
• Distributed operating systems
• Object-oriented design
Microkernel Architecture
Assigns only a few essential functions to the
kernel:
interprocess
address basic
communication
spaces scheduling
(IPC)
The approach:
is well suited to a
simplifies provides
distributed
implementation flexibility
environment
Technique in which a process, executing an application, is
divided into threads that can run concurrently
Thread
• dispatchable unit of work
• includes a processor context and its own data area to enable subroutine
branching
• executes sequentially and is interruptible
Process
• a collection of one or more threads and associated system resources
• programmer has greater control over the modularity of the application and the
timing of application related events
Symmetric
Multiprocessing (SMP)
Term that refers to a computer hardware architecture and also to the
OS behavior that exploits that architecture
Application perspective:
• machine characteristics are specified by high-level language capabilities and OS
system library calls
• API defines the machine for an application
OS perspective:
• OS sees the system at the hardware level
• It (the OS) allocates real memory and I/O resources to the processes
• ISA provides the interface between the system and machine
Process v System Virtual
Machine
Process Virtual Machine System Virtual Machine
Is a virtual platform for Each virtual machine is an
executing a single process isolated environment that
Does not look like any real shares system resources with
hardware platform other VMs
The process VM interprets appears to the guest OS and
code that has been compiled the apps it runs as an exact
to run on the virtual machine copy of the real hardware
Examples: JVM, Microsoft’s The guest OS manages the
CLI (.NET) resources allocated to it by
the VMM
Process and System Virtual Machines
Process and System Virtual Machines
Advantages
Process Virtual Machine
One compiler for multiple machines – generates byte code for JVM
“Write once, run anywhere”
.NET: Different modules of a program can be written in different
languages, all compile to the same format, can be compiled & run as a
unit
Kernel
controls execution of the processors
Device Drivers
dynamic libraries that extend the functionality of the Executive
Server processes may use multiple threads to process requests from more
than one client simultaneously
PDP-11was a milestone because it first showed that UNIX could be an OS for all
computers
First widely available version outside Bell Labs was Version 6 in 1976
Most important of the non-AT&T systems was UNIX BSD (Berkeley Software
Distribution)
Description
of
UNIX
Traditional
UNIX
Kernel
Modern
UNIX
Kernel
UNIX Versions
System V, Release 4: (SVR4)
A descendant of the original Bell Labs version
Produced jointly by AT&T + Sun Microsystems
One of the two main branches of UNIX
BSD4.x (Berkeley Software Distribution 4.x)
Many of the key developments in UNIX were
made at Berkeley sponsored by DOD
BSD4.4 and FreeBSD are commonly used today
Started out as a UNIX variant for the IBM PC
Multithreading
Evolution:
Symmetric multiprocessing (SMP)
serial processing, simple batch distributed OS
systems, multiprogrammed batch
object oriented design
systems, time sharing systems
Virtual machines
Microsoft Windows/Windows 7
virtualization
UNIX/Linux systems