Upload
wendi
View
18
Download
0
Tags:
Embed Size (px)
DESCRIPTION
What is an operating system?. Tool to make programmer's job easy Resource allocator Must be fair; not partial to any process Must discriminate between different class of jobswith different service requirements Do the above efficiently Control program - PowerPoint PPT Presentation
Citation preview
What is an operating system?
• Tool to make programmer's job easy• Resource allocator
– Must be fair; not partial to any process– Must discriminate between different class of job
swith different service requirements– Do the above efficiently
• Control program• Tool to facilitate efficient operation of co
mputer system• Virtual machine that is easier to understa
nd and program• Layered architecture
History of the operating systems
Early/First Generation Systems• -- 1945 1955
• -- Bare machines vaccum tubes and plu gboards
– Exemplified by ENIAC– Electronic Numerical Integrator And Computer– Designed by J.W.Mauchly and J.P.Eckertof the
University of Pennsylvania in 1945– Commissioned by the Ballistics Research Lab (
BRL) at the Aberdeen Proving Ground in Maryl and
– Made up of 1 8 ,0 0 0 vaccum tubes and 1,500 relays
• No operating system• -- Black box concept human operators• No protection
Second Generation Systems
• 1956 -- 1965 • Transistors and batch systems • Clear distinction between designers,
builders, operators, programmers, and maintenance personnel
• I/O channel • Read ahead / spooling • Interrupts / exceptions • Minimal protection • Libraries / JCL
Third Generation Systems• 1965 -- 1980 • ICs and Multiprogramming • System 360 and S/370 family of
computers • Spooling (simultaneous peripheral
operation on-line) • Time sharing • On-line storage for
– System programs – User programs and data – Program libraries
Third Generation Systems
• Virtual memory • Multiprocessor configurations • MULTICS
Fourth Generation and Beyond
• Personal computers and workstations• - MS DOS and Unix• Massively parallel systems
– Pipelining– Array processing / SIMD– General multiprocessing / MIMD– Symmetric multiprocessing / SMD
Any process and any thread can run on any available processor
Fourth Generation and Beyond
• Computer networks (communication aspect) -- network operating systems
• Distributed computing -- distributed operating systems
Operating System Concepts
• Kernel• Processes • Threads • Files • System calls • Shell
Processes in Operating Systems
• A program in execution • May be stopped and later restarted by the OS • Process table
– Records information about each process – Program code – Data – Stack – Program counter (PC), Stack pointer (SP), and
other registers
• Core image
Processes in Operating Systems
• Process has a parent [process] and may cre ate child processes
• Communication through messages• Process ownership determined by the UI
D and GID• Process id identifies the process• Special process id's in Unix
– 0Swapper– 1/sbin/init– PPPPPPPP PP 2
Process execution modes in Unix
• Two modes of process execution: user mode and kernel mode
• Normally, a process executes in the user mode. When a process executes a system call, the mode of execution changes from user mode to kernel mode. The bookkeeping operations related to the user process (interrupt handling, process scheduling, memory management) are performed in kernel mode.
Process execution modes in Unix
• User mode Processes can access their own instructions
and data but not kernel instructions and data Cannot execute certain privileged machine
instructions • Kernel mode Processes can access both kernel as well as
user instructions and data No limit to which instructions can be executed Runs on behalf of a user process and is a part
of the user process
Process execution modes in Unix
• Threads A dispatchable unit of work to provi
de intraprocess concurrency in new er operating systems
A process may have multiple threa ds of execution in parallel, each thre ad executing sequentially
Files and File Management• File management system provides services
to hide the specifics of tape and disk • Invoked by system calls • Files are grouped together by a directory Organized as a hierarchical tree Root directory Files specified by path name Path name separator (/ in Unix, \ in DOS) Working directory
Files and File Management• Protection of files - -- Based on a 9 bit code in Unix rwx bits• File descriptor or handle A small integer to identify a file in subsequ
ent operations A denial of access indicated by an error co
de 0 Standard input 1 Standard output 2 Standard error
Files and File Management
• I/O devices treated as special files b Block special files c Character special files • Pipes A pseudo file to connect two
processes • Unix file system
Unix File System
Characterized by • Hierarchical structure • Consistent treatment of file data • Ability to create and delete files • Dynamic growth of files • Protection of file data • Treatment of peripheral devices
as files
Unix File SystemOrganized as a tree • Single root node • Non-leaf nodes
Directories
• Leaf nodes – Regular files – Special device files \
• Path name • Specifies how to locate the file in the
system hierarchy
Multiprogramming
• CPU-bound system • I/O-bound system • Maintain more than one
program in the main memory • Sharing of time and space
Multiprogramming OS• Requires addition of new hardware components
– DMA Hardware – Priority Interrupt Mechanism – Timer – Storage and Instruction Protection – Dynamic Address Relocation
• Is more complex compared to a simple OS • Must hide the sharing of resources between
different users • Must hide details of storage and I/O devices • Requires a complex file system for
secondary storage
Tasks of a multiprogramming OS
• Bridge the gap between the machine and the user level
• Manage the available resources needed by different users
• Enforce protection policies • Provide facilities for synchronization
and communication
Shell• Command interpreter in Unix• Interprets the first word of a command lin
e as a command name• Is a user program and not a part of the kern
el• Provides a prompt• Allows for redirection of input and output• Provides capability to run jobs in the backgr
ound•
Shell• For most commands, the shell forks and t
he child execs the command associated with the name, treating the
• remaining words on the command line as parameters to the command
• Allows for three type of commands• 1.Executable files• 2.Shellscripts• - 3.Built in shell commands
System Calls• Set of extended instructions provided by
the operating system • System calls provide an interface
between user program and operating system
• Applied to various software objects like processes and files
• Invoked by user programs to communicate with the kernel and request services
• Return from trap instruction
System Calls• Li br ar y pr ocedur e cor r espondi ng t o each syst
emcal l– Machine registers to hold parameters of system call– Trap instruction (protected procedure call) to start OS– Hide details of trap and make system call look like ordi
nary procedure call
• Example count= read( file, buff er , nbyt es );• Actual system call read invoked by read• Number of bytes actually read is returned in
count• - In case of error, count is set to 1 \
Multics• Multiplexed Information and Computing
Service • Design started in 1965 and completed in 1972 • Collaborative effort between General Electric,
Bell Telephone Labs, and Project MAC of MIT • Aimed at providing
– Simultaneous computer access to large community of users
– Ample computation power and data storage – Easy data sharing between users, if desired