Unit OS1:
Unit OS1:
Overview of Operating Systems Overview of Operating Systems
1.2. The Evolution of Operating Systems
1.2. The Evolution of Operating Systems
Copyright Notice Copyright Notice
© 2000-2005 David A. Solomon and Mark Russinovich
© 2000-2005 David A. Solomon and Mark Russinovich
These materials are part of the
These materials are part of the Windows Operating Windows Operating System Internals Curriculum Development Kit,
System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E.
developed by David A. Solomon and Mark E.
Russinovich with Andreas Polze Russinovich with Andreas Polze
Microsoft has licensed these materials from David Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic academic organizations solely for use in academic environments (and not for commercial use)
environments (and not for commercial use)
Roadmap for Section 1.2.
Roadmap for Section 1.2.
History of Operating Systems History of Operating Systems
Tasks of an Operating System Tasks of an Operating System
OS as extension of the hardware OS as extension of the hardware
Main concepts: processes, files, system calls Main concepts: processes, files, system calls
Operating system structuring
Operating system structuring
Operating Systems Concepts Operating Systems Concepts
System software manages resources System software manages resources
OS hides complexity of underlying hardware OS hides complexity of underlying hardware
Layered architectures Layered architectures
Physical devices Microprogramming
Machine language Operating system
Compilers Editors Command interpreter Banking
system
Airline
reservation Web browser Application programs
Hardware
System programs
History of operating systems History of operating systems
Batch processing Batch processing
Punching cards
Punching cards Multiprocessing Multiprocessing programming
programming
The elements of the basic The elements of the basic IBM 1401 system are the IBM 1401 system are the 1401 Processing Unit, 1401 Processing Unit,
1402 Card Read-Punch, and 1402 Card Read-Punch, and 1403 Printer.
1403 Printer.
Job 3 Job 2 Job 1
OS
Memory
partitions
The Evolution of Operating The Evolution of Operating
System Functionality System Functionality
Batch
Batch Job Job ProcessingProcessing
Linkage of library routines to programs Linkage of library routines to programs
Management of files, I/O devices, secondary storage Management of files, I/O devices, secondary storage Multiprogramming
Multiprogramming
Resource managment and sharing for multiple programs Resource managment and sharing for multiple programs Quasi-
Quasi-simultaneous program executionsimultaneous program execution Single user
Single user
Multiuser/Timesharing System Multiuser/Timesharing Systemss
Management of multiple simultaneous users interconnected via terminals Management of multiple simultaneous users interconnected via terminals Fair resource management
Fair resource management: CPU : CPU scheduling, spooling, mutual exclusionscheduling, spooling, mutual exclusion Real-Time System
Real-Time Systemss (process control systems (process control systems)) Management of time-critical processes Management of time-critical processes
High requirements with respect to reliability and availability High requirements with respect to reliability and availability
Tasks of an Operating System Tasks of an Operating System
Processor management
Processor management - Scheduling - Scheduling Fairness
Fairness
Non-blocking behavior Non-blocking behavior Priorities
Priorities
Memory management Memory management
VirtuVirtualal versus physi versus physicalcal memory, memory hierarchymemory, memory hierarchy Protection of competing/conurrent programs
Protection of competing/conurrent programs Storage management
Storage management – File – File system system Access to external storage media Access to external storage media Device management
Device management
Hiding of hardware dependencies Hiding of hardware dependencies Management of concurrent accesses Management of concurrent accesses Batch
Batch pprocessingrocessing
Definition of an execution order; throughput maximization Definition of an execution order; throughput maximization
Kernel-
Kernel- and and User Mode User Mode Programs Programs
Typical functionality implemented in either mode:
Typical functionality implemented in either mode:
Kernel:
Kernel:
Privileg
Privileged modeed mode
Strict assumptions about reliability/security of code Strict assumptions about reliability/security of code Memory resident
Memory resident
CPU-, memory-, Input/Output managment CPU-, memory-, Input/Output managment Multiprocessor management, diagnosis, test Multiprocessor management, diagnosis, test
Parts of file system and of the networking interface Parts of file system and of the networking interface User Space:
User Space:
More flexible More flexible
Simpler maintenance and debugging Simpler maintenance and debugging
Compiler
Compiler, a, assembler, ssembler, iinterpreternterpreter, linker/loader, linker/loader File system management
File system management, , teleteleccommunicommunication, ation, network managementnetwork management Editor
Editorss, , spreadsheetsspreadsheets, , user applicationsuser applications
Layered Model of Layered Model of
Operating System Concepts Operating System Concepts
nr nr name name typicaltypical objeobjectctss typicaltypical ooperationperationss
1 1 Integrated circuitsIntegrated circuits register, register, gategate, , bbus us Nand, Nor, Exor Nand, Nor, Exor
22 Machine languageMachine language instinstruction counterruction counter, ALU , ALU Add, Move, Load, Store Add, Move, Load, Store 3 3 Subroutine linkageSubroutine linkage procedure blockprocedure block Stack Call, JSR, RTS Stack Call, JSR, RTS
4 4 InterruptsInterrupts interrupt handlersinterrupt handlers Bus errorBus error, Reset , Reset
55 Simple proSimple proccessesesses processprocess, s, semaphoreemaphore wait, ready, execute wait, ready, execute 6 6 Local memory Local memory data block, data block, I/O channelI/O channel read, write, open, close read, write, open, close
7 7 VirtuVirtuaal l model model page, frame page, frame read, write, swap read, write, swap
8 8 Process communication Process communication channelchannel (pipe), message (pipe), message read, write, open read, write, open 9 9 File management File management filesfiles read, write, open, copy read, write, open, copy
10 10 Device managementDevice management ext.ext.memory, memory, tterminals erminals read, write read, write 11 11 I/O data streamsI/O data streams data streamsdata streams open, close, read, write open, close, read, write 12 12 User processesUser processes user processesuser processes login, logout, fork login, logout, fork
13 13 Directory managementDirectory management internal tablesinternal tables create, delete, modify create, delete, modify 14 14 Graphical user interfaceGraphical user interface window, menu, iconwindow, menu, icon OS system callsOS system calls
OS OS acts as Extension of Hardware acts as Extension of Hardware
System view
System view: : layered mode layered model l of OS of OS Implementation
Implementation details on one layer are hidden from higher layers details on one layer are hidden from higher layers Same machine, different operating systems:
Same machine, different operating systems:
IBM PC: DOS, Linux, NeXTSTEP, Windows, SCO Unix IBM PC: DOS, Linux, NeXTSTEP, Windows, SCO Unix DEC VAX: VMS, Ultrix-32, 4.3 BSD UNIX
DEC VAX: VMS, Ultrix-32, 4.3 BSD UNIX Same OS, different machines
Same OS, different machines: UNIX : UNIX PC (XENIX 286, APPLE A/UX) PC (XENIX 286, APPLE A/UX)
CRAY-Y/MP (UNICOS - AT&T Sys V) CRAY-Y/MP (UNICOS - AT&T Sys V)
IBM 360/370 (Amdahl UNIX UTS/580, IBM UNIX AIX/ESA) IBM 360/370 (Amdahl UNIX UTS/580, IBM UNIX AIX/ESA) Windows NT,
Windows NT, XP, 2000, 2003 XP, 2000, 2003
Intel i386 (i486 an NT 4.0), Alpha, PowerPC, MIPS
Intel i386 (i486 an NT 4.0), Alpha, PowerPC, MIPS , Itanium , Itanium
Operating Systems
Operating Systems Evolution Evolution
55 60 65 70 75 80 85 90 95 00 03
IOCS
DOS/360
DOS/VDSE
VS
VS/ESA
OS/360
MVS/370
MVS/XA
MVS/ES TSO IBSYS
CTSS
CP/CM5
VM/370
VM/XA
VM/ESA
SYSTEM III SYSTEM V SYSTEM V.4
MULTICS UNIX UNIXV.7
AIX/370 AIX
SUN OS POSIX
SOLARIS 2
4.1BSD 4.2BSD 4.3BSD
4.4BSD MACH
OSF/1 AIX/ESA
XENIX MS-DOS 1.0
CP/M
DR/DOS WIN 3.0 OS/2
WIN NT WIN 2000
WIN 9X
WIN XP LINUX
RSX-11M
VMS 1.0
VMS 5.4
VMS 7.3
WIN 3.1
SOLARIS 10
RT-11
LINUX 2.6
WIN Server 2003
Main Concepts:
Main Concepts: p p ro ro ce ce sse sse s s
Pro Pro c c esse esse s s , process table, core image , process table, core image Command interpreter, shell
Command interpreter, shell Child processes
Child processes
Scheduling, signals Scheduling, signals
User identification, group identification User identification, group identification
ready running
blocked
finished new
A
B C
F E
D
Process tree
Main Concepts:
Main Concepts: Files Files
Files, directories, root Files, directories, root Path, working directory Path, working directory Protection, rwx bits
Protection, rwx bits
File descriptor, handle File descriptor, handle Special files, I/O devices Special files, I/O devices Block I/O, character I/O Block I/O, character I/O
Standard input/output/error Standard input/output/error pipes
pipes
Root directory
tmp etc usr
pit mia
Main concepts:
Main concepts: system calls system calls
User programs access operating system services User programs access operating system services via via system calls system calls
Parameter transmission
Parameter transmission via trap, register, stack via trap, register, stack count=read(file, buffer, nbytes); count=read(file, buffer, nbytes);
5 general classes of system calls 5 general classes of system calls : :
Process control Process control
File manipulation File manipulation
Device manipulation Device manipulation
Information maintenance Information maintenance
communications
communications
Main concepts:
Main concepts: shell shell
Command interpreter Command interpreter Displays p
Displays p rompt, rompt, implements input/output redirection implements input/output redirection Background processes
Background processes , , j j ob ob c c ontrol, ontrol, p p seudo seudo terminals terminals
$ date
$ date
$ date >file
$ date >file
$ sort <file1 >file2
$ sort <file1 >file2
$ cat file1 file2 file3 > /dev/lp1
$ cat file1 file2 file3 > /dev/lp1
$ make all >log 2>&1 &
$ make all >log 2>&1 &
Structuring of Operating Systems Structuring of Operating Systems
Monolithical systems Monolithical systems
Unstructured Unstructured
Supervisor call
Supervisor call changes changes from from user mode in user mode in to to
kernel mode kernel mode
App App
System services
Hardware
OS procedures
User Mode Kernel Mode
Layered OS Layered OS
Each layer is given access only to lower-level Each layer is given access only to lower-level
interfaces interfaces
Application Program
Application Program
Application Program
System Services File System
Memory and I/O Device Management Processor Scheduling
Hardware
User Mode Kernel Mode
Microkernel OS Microkernel OS
(Client/server OS) (Client/server OS)
Kernel implements:
Kernel implements:
Scheduling Scheduling Memory Memory
Management Management Interprocess Interprocess communication communication (IPC)
(IPC)
User-mode servers User-mode servers
Memory Server Client
App
Network Server
Process Server
File Server
Display Server
Microkernel
Hardware
request reply
User Mode Kernel Mode
Mach Microkernel OS Mach Microkernel OS
Extended Memory Managment Extended Memory Managment
Paging Paging
handled by handled by user-space user-space
server server
Port: comm.
Port: comm.
endpoint, endpoint,
network-wide network-wide
client
netmsgsrv
kernel
pager
upcalls handle faults and
consistency
Advertise service page faults
get
memory object
Map memory object (vm_map())
Lookup Service
Mach Microkernel OS Mach Microkernel OS
Distributed Shared Memory System Distributed Shared Memory System
Access remote memories, Access remote memories,
port access rights - ACL port access rights - ACL
Kernel A
Kernel C
Kernel B
pager
memory_object_lock_completed
memory_object_lock_completed
memory_object_lock_request should_flush=TRUE
memory_object_lock_request should_flush=TRUE memory_object_data_request
access=VM_PROT_WRITE memory_object_data_provided
lock_value=VM_PROT_NONE 1
2
2 3
3
4
Windows NT Origins Windows NT Origins
Design began in late 1988/early 1989 after Dave Cutler and a handful of Design began in late 1988/early 1989 after Dave Cutler and a handful of Digital employees started at Microsoft
Digital employees started at Microsoft
Dave Cutler—legend in the operating system world Dave Cutler—legend in the operating system world
Project leader for Digital’s VMS (Virtual Memory System) Project leader for Digital’s VMS (Virtual Memory System)
Internally, Windows NT has many similarities to Digital’s VMS Internally, Windows NT has many similarities to Digital’s VMS (scheduling, memory management, I/O and driver model) (scheduling, memory management, I/O and driver model) VMS+1=WNT just a coincidence
VMS+1=WNT just a coincidence
Original goal was replacement for OS/2 Original goal was replacement for OS/2
Later goal changed to be the replacement for Windows 3.0 Later goal changed to be the replacement for Windows 3.0 The name “Windows NT” was chosen because
The name “Windows NT” was chosen because NT stands for New Technology
NT stands for New Technology
But at a high level, the architecture and user interface are not really that “new”
But at a high level, the architecture and user interface are not really that “new”
(as compared to most 32-bit OS’s) (as compared to most 32-bit OS’s)
Also, the i860 Risc CPU NT was originally targeted at was code named N-Ten Also, the i860 Risc CPU NT was originally targeted at was code named N-Ten
Interesting book on the early years of NT:
Interesting book on the early years of NT:
Show-stopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft Show-stopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft By G. Pascal Zachary, ISBN: 0029356717
By G. Pascal Zachary, ISBN: 0029356717
NOTE: In the CRK, “Windows” refers to Windows 2000, Windows XP, and Windows NOTE: In the CRK, “Windows” refers to Windows 2000, Windows XP, and Windows
Server 2003 Server 2003
VMS and Windows VMS and Windows
- a bird’s-eye view on architectures - a bird’s-eye view on architectures
System-wide data structures Memory
Management I/O Subsystem Process and
time management System services
Kernel
Record Management Service (RMS) Executive
Command Language Interpreter (CLI) Supervisor
Platform-Adaptation Layer (PAL) - Alpha Support Libraries Utilities
Program Development Tools Layered Products
(Apps)
User
Layered design for VAX/VMS operating system
Windows
high-level architecture
OS/2 Windows POSIX
Environment Subsystems
User Application Subsystem DLL
Windows User/GDI Device
Driver Executive
Device Drivers Kernel
Hardware Abstraction Layer (HAL) User
Mode Kernel Mode
System
& Service Processes
Windows
Release History Release History
Although product name has varied, internally, each version Although product name has varied, internally, each version
identified by a “build number”
identified by a “build number”
Internal identification - increments each time NT is built from Internal identification - increments each time NT is built from source (5-6 times a week)
source (5-6 times a week) Interesting timeline:
Interesting timeline:
http://windows2000.about.com/library/weekly/aa010218a.htm http://windows2000.about.com/library/weekly/aa010218a.htm Build#
Build# Version Version Date Date
297 297 PDC developer release PDC developer release Jul 1992 Jul 1992 511 511 NT 3.1 NT 3.1 Jul 1993 Jul 1993
807 807 NT 3.5 NT 3.5 Sep 1994 Sep 1994 1057 1057 NT 3.51 NT 3.51 May 1995 May 1995 1381 1381 NT 4.0 NT 4.0 Jul 1996 Jul 1996
2195 2195 Windows 2000 (NT 5.0) Windows 2000 (NT 5.0) Dec 1999 Dec 1999 2600 2600 Windows XP (NT 5.1) Windows XP (NT 5.1) Aug 2001 Aug 2001
3790 3790 Windows Server 2003 (NT 5.2) Windows Server 2003 (NT 5.2) Mar 2003 Mar 2003
4051 4051 Longhorn PDC Developer Preview Longhorn PDC Developer Preview Oct 2003 Oct 2003
Windows And Linux Evolution Windows And Linux Evolution
Windows and Linux kernels are based on foundations developed in Windows and Linux kernels are based on foundations developed in the mid-1970s
the mid-1970s
1970 1980 1990 2000
VM
S v1.0
Windows NT 3.1
NT 4.0
Windows 2000 Windows XP
Server 2003
1970 1980 1990 2000
UN
IX born
UNIX public
UNIX V6
Linux v1.0 v2.0
v2.2 v2.3
v2.4 v2.6