Operating Systems
Operating Systems
Chapter Overview
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 difcult 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
Page 3
Christian Jacob
3.1
First
Back
TOC
Prev Next
Last
Page 4
Christian Jacob
Operating System
Job 2 (running)
Job 3 (ready)
First
Back
TOC
Prev Next
Last
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 5 Job 4 Job 3
interactive processing: - the user does not have to wait for one process to be nished until the next process (program, action) can be started
First Back TOC Prev Next Last
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 efciency 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
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
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 server
Compute server
File server
Print server
Clients Internet
First Back TOC
NCrunch.
Files
Printers
Prev Next Last
Page 9
Christian Jacob
3.2
ROM (permanent)
Bootstrap program
Rea
d OS
Operating system
Load OS
Operating system
Sta
rt
de
RAM (volatile)
vic
ed
riv
ers
Devices
First
Back
TOC
Prev Next
Last
Page 10
Christian Jacob
Starting up an operating system Read boot strap program from ROM: enables access to oppy 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
Prev Next
Last
Page 11
Christian Jacob
3.3
User
User
Command processor
Scheduler
User
Interrupt
Dispatcher
First
Back
TOC
Prev Next
Last
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 noties 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
Prev Next
Last
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
Prev Next
Last
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, les, peripheral devices. Memory Manager The memory manager coordinates the use of the machines 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 les on a harddrive are used to extend the RAM.
First
Back
TOC
Prev Next
Last
Page 15
Christian Jacob
I/O System Manager The I/O system manager coordinates the assignment of peripheral devices to processes, through specic device drivers. File Manager The le manager keeps track of information about les on the disks: - protects against unauthorized le access - supports sharing of le resources - helps organizing les into folders
First
Back
TOC
Prev Next
Last
Page 16
Christian Jacob
Dispatcher The dispatcher monitors processes and decides when to switch execution from one process to another.
Interrupt Interrupt Interrupt
Process A Disp.
When a process completes ... the dispatcher reports back to the scheduler, the scheduler noties 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
Page 17
Christian Jacob
3.4
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