chapter 4: operating systems. what is an operating system? a program or collection of programs that...

26
Chapter Chapter 4 4 : : operating operating systems systems

Upload: maximillian-russell

Post on 28-Dec-2015

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Chapter Chapter 44: : operating operating systemssystems

Page 2: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

What is an operating What is an operating system?system?

A program or collection of A program or collection of programs that coordinate programs that coordinate computer usage among users and computer usage among users and handle common tasks.handle common tasks.

Page 3: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

OS - functionsOS - functions

1.1. Hide details of input and outputHide details of input and output2.2. Provide an environment for multiple Provide an environment for multiple

users/programs to work concurrently users/programs to work concurrently – multitasking and multi-slacking– multitasking and multi-slacking

3.3. Allocate memory to different Allocate memory to different users/programsusers/programs

4.4. Share resources (files, printer) among Share resources (files, printer) among usersusers

5.5. Provide means for users/programs to Provide means for users/programs to communicate with each othercommunicate with each other

6.6. Provide protection and security for Provide protection and security for programsprograms

Page 4: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

OS functions - examplesOS functions - examples

1.1. You can access disks as file cabinets without You can access disks as file cabinets without the knowledge of tracks, sector, etc – the knowledge of tracks, sector, etc – hide I/O hide I/O detailsdetails

2.2. You can work with multiple programs at the You can work with multiple programs at the same time, e.g., using IE to download files and same time, e.g., using IE to download files and use Word to write a report - use Word to write a report - multitaskingmultitasking

3.3. In STT475 and 375, we share the same printers In STT475 and 375, we share the same printers – – share resourcesshare resources

4.4. You can interact with machines via the Internet You can interact with machines via the Internet – – communicate among users/machinescommunicate among users/machines

5.5. When you use password on your machine, no When you use password on your machine, no one can use your computer without the one can use your computer without the password - password - protectionprotection

Page 5: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Why are there difference Why are there difference OS’s?OS’s?

Different types of cars for different Different types of cars for different purposespurposes– Vans for familyVans for family– Compact cars for gas mileageCompact cars for gas mileage– SUV for rough terrains SUV for rough terrains

Different OS’s for different environments Different OS’s for different environments and applicationsand applications– Windows 2000/XP for personal computersWindows 2000/XP for personal computers– Windows 2003 Servers for web servers and Windows 2003 Servers for web servers and

big corporationsbig corporations– Unix/Linux for personal computers and serversUnix/Linux for personal computers and servers

Page 6: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

What is “multitasking”?What is “multitasking”?

The speed of CPUs is much faster than The speed of CPUs is much faster than any I/O deviceany I/O device– If a computer only execute one program If a computer only execute one program

(e.g., Word) from beginning to end, the (e.g., Word) from beginning to end, the CPU would stay idle most the time since CPU would stay idle most the time since no human can type fast enough.no human can type fast enough.

Multitasking allows multiple programs Multitasking allows multiple programs to reside in the memory/virtual to reside in the memory/virtual memory at the same time and switch memory at the same time and switch the CPU between those programsthe CPU between those programs

Page 7: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Why OS’s need to Why OS’s need to coordinate programs?coordinate programs?

Printing examplePrinting example– When you print a Word document and a When you print a Word document and a

webpage at the same time on your home webpage at the same time on your home printer, did you ever find that one is printer, did you ever find that one is printed in mid of the other?printed in mid of the other?

The OS determines which program uses the The OS determines which program uses the printer first and then next programprinter first and then next program

Memory exampleMemory example– When you use Word and IE at the same When you use Word and IE at the same

time, the OS must allocate memory space time, the OS must allocate memory space for both programsfor both programs

Page 8: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

What can’t Windows read What can’t Windows read Mac or Linux disksMac or Linux disks

Different OS’s define tracks and Different OS’s define tracks and sectors differently on the disk – sectors differently on the disk – formattingformatting

Windows machines do not know how Windows machines do not know how to interpret Mac’s formatto interpret Mac’s format

Today, Mac machines can read Today, Mac machines can read Windows disks is because that Mac OS Windows disks is because that Mac OS tries to read disks in Windows format tries to read disks in Windows format after it fails to read it in Mac’s format.after it fails to read it in Mac’s format.

Page 9: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Portable storage devicesPortable storage devices

Floppy disksFloppy disks– Limited capacity, very slow, not Limited capacity, very slow, not

reliablereliable– Most of today’s PC’s do not even Most of today’s PC’s do not even

install floppy disk drivesinstall floppy disk drives Jumpdrive, pin drive, USB Jumpdrive, pin drive, USB

memory stick, flash memory, etcmemory stick, flash memory, etc– High capacity, fast, and reliableHigh capacity, fast, and reliable– Use USB connectionUse USB connection

Page 10: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

What is “booting”?What is “booting”?

Start up the computer and allow Start up the computer and allow the OS to set up itselfthe OS to set up itself

Then the OS starts behind-the-Then the OS starts behind-the-scenes programs (services) for scenes programs (services) for special tasksspecial tasks– Monitoring email, coordinating Monitoring email, coordinating

printing requests, monitoring data printing requests, monitoring data on the network.on the network.

Page 11: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

What is “reboot”?What is “reboot”?

Stop all current processing andStop all current processing and Restart the computerRestart the computer If everything were perfect in a If everything were perfect in a

computer, reboot would not be neededcomputer, reboot would not be needed Reboot sometime is the most efficient Reboot sometime is the most efficient

way to restore the computer back to way to restore the computer back to normalnormal

Reboot is the only way to restore the Reboot is the only way to restore the system when the computer does not system when the computer does not respond to any keystroke and mouserespond to any keystroke and mouse

Page 12: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Virtual memoryVirtual memory

A technique for today’s computers to A technique for today’s computers to run many applications beyond the limit run many applications beyond the limit of the physical memory (RAM)of the physical memory (RAM)

Virtual memory is part of the hard diskVirtual memory is part of the hard disk Often it uses the free space of the hard Often it uses the free space of the hard

diskdisk All programs that are being executed All programs that are being executed

and data are being processed are all and data are being processed are all located in virtual memory.located in virtual memory.

Page 13: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Virtual memoryVirtual memory

Hard disk

Data files

And

Applications

Used space

Free space

Running programs and their

data

Virtual Memory

Page 14: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

RAM and virtual memoryRAM and virtual memory

Virtual memory

You Workbench.limited space.hand reachable

Workshop. Large. Has everything

RAMCPUYour computer

Page 15: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

CPU, RAM, Hard Disks - CPU, RAM, Hard Disks - ProgramProgram

You want to use MS WORD to write a letter.You want to use MS WORD to write a letter.– MS Word and its application data are installed MS Word and its application data are installed

onto the hard diskonto the hard disk– When you double-click the Word icon, Word is When you double-click the Word icon, Word is

copiedcopied from the from the hard disk hard disk toto virtual memory virtual memory along along with its application datawith its application data

– When you start using Word, part of Word is When you start using Word, part of Word is copied fromcopied from virtual memory virtual memory toto RAM RAM

– The text you enter from keyboard is saved in RAMThe text you enter from keyboard is saved in RAM– When you save the letter, the text along with When you save the letter, the text along with

format info (bold, italic, etc) is saved into a file on format info (bold, italic, etc) is saved into a file on thethe hard disk hard disk..

– When Word exits, it is When Word exits, it is removed from RAM and removed from RAM and virtual memoryvirtual memory along all data related to it. along all data related to it.

Page 16: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

CPU, RAM, Hard Disks - CPU, RAM, Hard Disks - ProgramProgram

What happens when no free space in RAM?What happens when no free space in RAM?– As you open more and more applications (multitasking) As you open more and more applications (multitasking)

and/or enter more data, RAM may become all occupied and/or enter more data, RAM may become all occupied – This is like your workbench is all covered by tools and This is like your workbench is all covered by tools and

materials.materials.– The operating system moves some part of some The operating system moves some part of some

applications to applications to virtual memory virtual memory to free up some RAM to free up some RAM spacespace

– This is like you move some tools and materials from This is like you move some tools and materials from workbench to the walls of the workshop.workbench to the walls of the workshop.

– Now you can continue entering more data or opening Now you can continue entering more data or opening more applications.more applications.

– This is like you continue your work on workbench using This is like you continue your work on workbench using newly freed space.newly freed space.

– When you need a part of a program or a program that When you need a part of a program or a program that was moved to virtual memory, it may be swapped back in was moved to virtual memory, it may be swapped back in RAM.RAM.

– This is like you need a tool you moved to the walls This is like you need a tool you moved to the walls earlier, you need to clear some space on workbench so earlier, you need to clear some space on workbench so you can move it back.you can move it back.

Page 17: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Add More MemoryAdd More Memory

Virtual memory allows us to run applications that Virtual memory allows us to run applications that together need more than the available physical together need more than the available physical RAMRAM

Virtual memory (hard disk) is much slower than Virtual memory (hard disk) is much slower than main memory (RAM).main memory (RAM).

The more swapping between RAM and virtual The more swapping between RAM and virtual memory, the slower of the systemmemory, the slower of the system

The more RAM (bigger workbench), the less likely The more RAM (bigger workbench), the less likely swapping occursswapping occurs

The more RAM, the faster the systemThe more RAM, the faster the system Stop applications that no longer needed, this frees Stop applications that no longer needed, this frees

the RAM space occupied by those applications the RAM space occupied by those applications remove no longer needed tools from your remove no longer needed tools from your workbench. workbench.

Page 18: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

File ManagementFile Management

Programs and user data are Programs and user data are stored as files on the hard diskstored as files on the hard disk

Each file always takes multiple Each file always takes multiple sectorssectors

Folders can be used to organize Folders can be used to organize files like file cabinetsfiles like file cabinets

Page 19: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Before DELETEBefore DELETE

Page 20: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

After DELETEAfter DELETE

Page 21: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

After ERASEAfter ERASE

Page 22: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Deleting a file vs. Erasing itDeleting a file vs. Erasing it

Deletion of a fileDeletion of a file1.1. Removes the record of the file from the corresponding Removes the record of the file from the corresponding

directorydirectory2.2. Marks that the various sectors of the file are now free Marks that the various sectors of the file are now free

Erasure of a fileErasure of a file1.1. Writes over all information in the various sectors Writes over all information in the various sectors

containing file datacontaining file data2.2. Removes the record of the file from the corresponding Removes the record of the file from the corresponding

directorydirectory3.3. Marks that the various sectors of the file are now free Marks that the various sectors of the file are now free

Delete a file === throw it into a garbage canDelete a file === throw it into a garbage can someone may steal it and read itsomeone may steal it and read itErase a file === shred itErase a file === shred it no one can read it anymoreno one can read it anymore

Page 23: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

I/O Devices - DriversI/O Devices - Drivers

OS needs a special program, called OS needs a special program, called device device driverdriver, for each I/O device, for each I/O device

The driver is designed for the device and the The driver is designed for the device and the OS. OS. – A HP printer driver designed for Windows XP normally A HP printer driver designed for Windows XP normally

would not work Vistawould not work Vista Many OS’s have device drivers of commonly Many OS’s have device drivers of commonly

used devices included in their installationused devices included in their installation Device drivers may be updated by the Device drivers may be updated by the

manufacture for various reasonsmanufacture for various reasons My advice: download drivers only from the My advice: download drivers only from the

manufacture’s websitemanufacture’s website

Page 24: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Which OS is best?Which OS is best?

Three most common OS’sThree most common OS’s– Windows by MicrosoftWindows by Microsoft

Aggressively marketedAggressively marketed Take a large fraction of individual stationsTake a large fraction of individual stations As a result, users can easily share programs and As a result, users can easily share programs and

datadata

– Macintosh OS X by AppleMacintosh OS X by Apple Offers a simple, clean, and powerful graphical user Offers a simple, clean, and powerful graphical user

interfaceinterface

– Linux by Linus Torvalds and others Linux by Linus Torvalds and others Offer higher reliability and ability to link complex Offer higher reliability and ability to link complex

taskstasks

Page 25: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

Summary – chapter 4Summary – chapter 4

Operating systems handle common tasksOperating systems handle common tasks Multitasking allows a computer to split its CPU time Multitasking allows a computer to split its CPU time

and resources among multiple programs and usersand resources among multiple programs and users Booting restarts the computer and the OS sets up the Booting restarts the computer and the OS sets up the

environmentenvironment Rebooting involves shutting down the computer and Rebooting involves shutting down the computer and

starting it up againstarting it up again Different OS’s are designed for different purposesDifferent OS’s are designed for different purposes Different OS’s define different formats on disksDifferent OS’s define different formats on disks Virtual memoryVirtual memory

– Allow more applications beyond the limit of RAMAllow more applications beyond the limit of RAM– Located on the hard diskLocated on the hard disk

Deleting vs. erasing filesDeleting vs. erasing files Disk fragmentation and defragmentationDisk fragmentation and defragmentation Viruses and anti-virus programsViruses and anti-virus programs

Page 26: Chapter 4: operating systems. What is an operating system? A program or collection of programs that coordinate computer usage among users and handle common

TerminologyTerminology

Operating systemsOperating systems Booting a Booting a

computercomputer Rebooting a Rebooting a

computercomputer Single-taskingSingle-tasking MultitaskingMultitasking Virtual memoryVirtual memory

FragmentationFragmentation DefragmentationDefragmentation Deleting filesDeleting files Erasing filesErasing files MS WindowsMS Windows Mac OS XMac OS X LinuxLinux