27
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 Tool to facilitate efficient oper ation of computer system Virtual machine that is easier to understand and program Layered architecture

What is an operating system?

  • Upload
    wendi

  • View
    18

  • Download
    0

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

Page 1: What is an operating system?

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

Page 2: What is an operating system?

History of the operating systems

Page 3: What is an operating system?

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

Page 4: What is an operating system?

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

Page 5: What is an operating system?

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

Page 6: What is an operating system?

Third Generation Systems

• Virtual memory • Multiprocessor configurations • MULTICS

Page 7: What is an operating system?

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

Page 8: What is an operating system?

Fourth Generation and Beyond

• Computer networks (communication aspect) -- network operating systems

• Distributed computing -- distributed operating systems

Page 9: What is an operating system?

Operating System Concepts

• Kernel• Processes • Threads • Files • System calls • Shell

Page 10: What is an operating system?

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

Page 11: What is an operating system?

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

Page 12: What is an operating system?

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.

Page 13: What is an operating system?

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

Page 14: What is an operating system?

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

Page 15: What is an operating system?

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

Page 16: What is an operating system?

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

Page 17: What is an operating system?

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

Page 18: What is an operating 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

Page 19: What is an operating system?

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

Page 20: What is an operating system?

Multiprogramming

• CPU-bound system • I/O-bound system • Maintain more than one

program in the main memory • Sharing of time and space

Page 21: What is an operating system?

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

Page 22: What is an operating system?

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

Page 23: What is an operating system?

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•

Page 24: What is an operating system?

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

Page 25: What is an operating system?

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

Page 26: What is an operating system?

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 \

Page 27: What is an operating system?

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