Download Chapter 3 Operating Systems

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Berkeley Software Distribution wikipedia , lookup

Library (computing) wikipedia , lookup

Acorn MOS wikipedia , lookup

DNIX wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Mobile operating system wikipedia , lookup

RSTS/E wikipedia , lookup

Security-focused operating system wikipedia , lookup

Copland (operating system) wikipedia , lookup

Spring (operating system) wikipedia , lookup

Burroughs MCP wikipedia , lookup

Distributed operating system wikipedia , lookup

Unix security wikipedia , lookup

Process management (computing) wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Paging wikipedia , lookup

Transcript
© Christian Jacob
Chapter 3
Operating Systems
3.1
Evolution of Operating Systems
3.2
Booting an Operating System
3.3
Operating System Architecture
3.4
References
Chapter Overview
Chapter 3: Operating Systems
Page 2
© Christian Jacob
Operating system (OS):
• A collection of programs that manages resources of a computer,
such as
- processors
- memory
- input/output devices
• ... like the conductor of an orchestra.
• A virtual machine that lets a user accomplish tasks that would be
difficult to perform directly with the underlying actual machine.
- graphical user interface
- virtual memory: provide more memory than in RAM
- multiprogramming: seemingly run more than one program at a
time
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 3
3.1
© Christian Jacob
Evolution of Operating Systems
First Generation OS (1945-1955)
The only “operating system” was a person. All machine operation
was “hands on”.
Second Generation OS (1955-1965)
Batch operating systems:
- A computer operator takes care of the system administration.
- The operator collects a “batch” of programs from several
programmers, feeds the programs into the computer, and hands
out the printed results back to the programmers.
- Today, batch operations are performed automatically.
- Compute jobs line up in a FIFO job queue (first in, first out).
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 4
© Christian Jacob
Multiprogramming OS
Switching between many different programs in memory (RAM)
Operating System
Job 1
(waiting for input)
Job 2
(running)
Job 3
(ready)
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 5
© Christian Jacob
Multiprogramming enables
• time sharing:
- divides processor time up into slices
- the slices are divided “fairly” among competing jobs
Job 1
Job 6
Job 2
Job 3
Job 5
Job 4
• interactive processing:
- the user does not have to wait for one process to be finished
until the next process (program, action) can be started
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 6
© Christian Jacob
Multiuser Operating Systems
Many different users can share the same machine through time
sharing and multiprogramming (e.g., UNIX, MacOS X, Windows NT).
The OS divides its system time into time slices (milliseconds).
This gives each user the illusion to have his/her own machine.
The efficiency of a time-sharing system depends on
- the speed of the processor
- the length of the time slices
- how many users perform operations that require a full time slice.
Multiuser OSs are mainly used in distributed, rather than centralized,
environments, where several machines share resources over a
network.
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 7
© Christian Jacob
Single-User OS and Multiprogramming
• Cooperative multitasking:
Switching between programs only if those programs explicitly
cooperate.
• Preemptive multitasking:
Lets the OS switch between the tasks at its own discretion.
⇒ Perform different tasks at the “same time” (printing, compiling,
searching on the web, ...)
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 8
© Christian Jacob
Network Operating Systems
Sharing of more expensive peripheral devices (in a LAN or WAN):
- laser printers
- 3D plotters
- tape backup units
- fast number-crunching machines
- special-purpose software packages
High-speed bus
PC or
workstation
...
PC or
workstation
Mail
Compute
File
Print
server
server
server
server
Internet
NCrunch.
Files
Printers
Clients
First
Back
TOC
Prev Next
Last
Chapter 3: Operating Systems
Page 9
3.2
© Christian Jacob
Booting an Operating System
Main memory
Disk storage
ROM
(permanent)
Bootstrap program
Operating
Rea
d OS
Load OS
Operating
system
system
Sta
rt
RAM
(volatile)
de
vic
ed
riv
ers
Devices
First
Back
TOC
Booting an Operating System
Prev Next
Last
Chapter 3: Operating Systems
Page 10
© Christian Jacob
Starting up an operating system
• Read boot strap program from ROM:
⇒ enables access to floppy and hard drives
⇒ look for the core OS (DOS: COMMAND.COM)
• Load the core OS into RAM.
• Run a sequence of jobs in batch mode.
- DOS: CONFIG.SYS and AUTOEXEC.BAT
- Windows: WIN.INI
- MacOS: selected extensions
- UNIX: .login, .profile, .cshrc
• Start a graphical user interface (GUI)
• Loop forever waiting for input / interaction with the GUI.
First
Back
TOC
Booting an Operating System
Prev Next
Last
Chapter 3: Operating Systems
Page 11
3.3
© Christian Jacob
Operating System Architecture
Memory
manager
User
I/O system
manager
Command
processor
User
Scheduler
Resource
allocator
File
manager
User
Interrupt
Dispatcher
First
Back
TOC
Operating System Architecture
Hardware
execution
execution
Prev Next
Last
Chapter 3: Operating Systems
Page 12
© Christian Jacob
Command processor:
The interface that interacts with one or more users, watching the
keyboard, mouse, and any other input devices attached to the
machine.
Receives commands whenever an input device notifies it about an
event, for example, when a user enters a new line in a shell or clicks
on a mouse button.
First
Back
TOC
Operating System Architecture
Prev Next
Last
Chapter 3: Operating Systems
Page 13
© Christian Jacob
Scheduler:
If the event turns out to be a request to run a program, the
command processor asks the scheduler to arrange for the execution
of programs.
- Place the program in a job queue.
- Create a process to execute the program.
A process is an active copy of a program
- that has been loaded into memory (RAM)
- with its own program counter indicating the next instruction to
execute.
Each process creates its own context (= process state).
There may be more than one process for the same program (e.g.,
start two different editor programs).
First
Back
TOC
Operating System Architecture
Prev Next
Last
Chapter 3: Operating Systems
Page 14
© Christian Jacob
Resource Allocator
The scheduler invokes a resource allocator, which makes sure that
each process has secondary resources that it may need — memory,
files, peripheral devices.
Memory Manager
The memory manager coordinates the use of the machine’s memory.
• It keeps track of which areas of memory are being used by which
processes.
• It may anticipate how much memory each process will need.
• It may provide virtual memory, where “swap files” on a harddrive
are used to extend the RAM.
First
Back
TOC
Operating System Architecture
Prev Next
Last
Chapter 3: Operating Systems
Page 15
© Christian Jacob
I/O System Manager
The I/O system manager coordinates the assignment of peripheral
devices to processes, through specific device drivers.
File Manager
The file manager keeps track of information about files on the disks:
- protects against unauthorized file access
- supports sharing of file resources
- helps organizing files into folders
First
Back
TOC
Operating System Architecture
Prev Next
Last
Chapter 3: Operating Systems
Page 16
© Christian Jacob
Dispatcher
The dispatcher monitors processes and decides when to switch
execution from one process to another.
Interrupt
Interrupt
Process A
Dispatcher
Process B
Dispatcher
Interrupt
Process A
Dispatcher
Disp.
Time
When a process completes ...
⇒ the dispatcher reports back to the scheduler,
⇒ the scheduler notifies the resource allocator,
⇒ the resource allocator releases any resources held by that process,
⇒ the scheduler then reports completion of the process to the
command processor,
⇒ the command processor informs the user.
First
Back
TOC
Operating System Architecture
Prev Next
Last
Chapter 3: Operating Systems
Page 17
3.4
© Christian Jacob
References
• G. Blank and R. Barnes, The Universal Machine, Boston, MA: WCB/
McGraw-Hill, 1998. Chapters 10.1 through 10.3.
First
Back
TOC
References
Prev Next
Last