presentation source

Download Report

Transcript presentation source

COP 4610
Introduction to Operating Systems
Chapter 1 - Introduction
• OS - Layer between the hardware and user
programs (Figure 1.1)
• OS - The ultimate API
• OS - First program that runs when the
computer boots up
• OS - Program that is always running
• OS - Typically only one instance/machine
• An OS functions as a resource manager and
an implementer of virtual computers
• As a resource manager, the OS handles
hardware, typically consisting of:
–
–
–
–
–
Processor
Memory
I/O controllers
Disk devices
Other I/O devices
• Abstract H/W diagram: Figure 1.2
• Resource management by an OS involves:
– Transforming a physical resource into an
instance of a virtual resource (e.g., a printer)
– Multiplexing between different instances of a
virtual resource when there’s only one physical
resource (e.g., use of SPOOLing disk files for
virtual printers)
– TDM (time division multiplexing) vs SDM
(space division multiplexing); some resources
make sense to TDM (printer); others SDM
(disk)
– Scheduling resources between programs
• An OS creates a virtual computer for each
program, with each it’s own:
– Process(es) (TDM)
– Address space(s) (SDM)
– Disk objects/file system (SDM)
• The illusion is complete: Figure 1.3
• Each virtual component has it’s own rules:
– Figure 1.4: Virtual Processor
• Some native real processor instructions are masked;
new “instructions” are added (aka system calls)
• Pvirtual = Pphysical - {Priv. Instr} + {Useful Instr}
• Each virtual component has it’s own rules:
– Figure 1.4: Virtual Processor (continued)
• Separation of instruction privileges decided
(hopefully!) by hardware states: system and user
• Protected instructions are those which allow
indiscriminate access to the hardware (address all of
memory, access any I/O device, etc.)
– Figure 1.5: Virtual Primary Memory
• Create illusion that each program has it’s own private
memory starting at address 0
– Figure 1.6: Virtual I/O
• Create illusion that each program has it’s own set of
hardware devices
– Figure 1.7:Virtual Secondary Memory
• Create illusion each program has it’s own private
disk drive/file system