Title: Chapter 4: operating systems
1Chapter 4 operating systems
2What is an operating system?
- A program or collection of programs that
coordinate computer usage among users and handle
common tasks.
3OS - functions
- Hide details of input and output
- Provide an environment for multiple
users/programs to work concurrently
multitasking and multi-slacking - Allocate memory to different users/programs
- Share resources (files, printer) among users
- Provide means for users/programs to communicate
with each other - Provide protection and security for programs
4OS functions - examples
- You can access disks as file cabinets without the
knowledge of tracks, sector, etc hide I/O
details - You can work with multiple programs at the same
time, e.g., using IE to download files and use
Word to write a report - multitasking - In STT475 and 375, we share the same printers
share resources - You can interact with machines via the Internet
communicate among users/machines - When you use password on your machine, no one can
use your computer without the password -
protection
5Why are there difference OSs?
- Different types of cars for different purposes
- Vans for family
- Compact cars for gas mileage
- SUV for rough terrains
- Different OSs for different environments and
applications - Windows 2000/XP for personal computers
- Windows 2003 Servers for web servers and big
corporations - Unix/Linux for personal computers and servers
6What is multitasking?
- The speed of CPUs is much faster than any I/O
device - If a computer only execute one program (e.g.,
Word) from beginning to end, the CPU would stay
idle most the time since no human can type fast
enough. - Multitasking allows multiple programs to reside
in the memory/virtual memory at the same time and
switch the CPU between those programs
7Why OSs need to coordinate programs?
- Printing example
- When you print a Word document and a webpage at
the same time on your home printer, did you ever
find that one is printed in mid of the other? - The OS determines which program uses the printer
first and then next program - Memory example
- When you use Word and IE at the same time, the OS
must allocate memory space for both programs -
8What cant Windows read Mac or Linux disks
- Different OSs define tracks and sectors
differently on the disk formatting - Windows machines do not know how to interpret
Macs format - Today, Mac machines can read Windows disks is
because that Mac OS tries to read disks in
Windows format after it fails to read it in Macs
format.
9Portable storage devices
- Floppy disks
- Limited capacity, very slow, not reliable
- Most of todays PCs do not even install floppy
disk drives - Jumpdrive, pin drive, USB memory stick, flash
memory, etc - High capacity, fast, and reliable
- Use USB connection
10What is booting?
- Start up the computer and allow the OS to set up
itself - Then the OS starts behind-the-scenes programs
(services) for special tasks - Monitoring email, coordinating printing requests,
monitoring data on the network.
11What is reboot?
- Stop all current processing and
- Restart the computer
- If everything were perfect in a computer, reboot
would not be needed - Reboot sometime is the most efficient way to
restore the computer back to normal - Reboot is the only way to restore the system when
the computer does not respond to any keystroke
and mouse
12Virtual memory
- A technique for todays computers to run many
applications beyond the limit of the physical
memory (RAM) - Virtual memory is part of the hard disk
- Often it uses the free space of the hard disk
- All programs that are being executed and data are
being processed are all located in virtual memory.
13Virtual memory
Hard disk
Free space
Used space
Data files And Applications
Running programs and their data
Virtual Memory
14RAM and virtual memory
Workbench .limited space .hand reachable
You
Workshop . Large . Has everything
Your computer
RAM
CPU
Virtual memory
15CPU, RAM, Hard Disks - Program
- You want to use MS WORD to write a letter.
- MS Word and its application data are installed
onto the hard disk - When you double-click the Word icon, Word is
copied from the hard disk to virtual memory along
with its application data - When you start using Word, part of Word is copied
from virtual memory to RAM - The text you enter from keyboard is saved in RAM
- When you save the letter, the text along with
format info (bold, italic, etc) is saved into a
file on the hard disk. - When Word exits, it is removed from RAM and
virtual memory along all data related to it.
16CPU, RAM, Hard Disks - Program
- What happens when no free space in RAM?
- As you open more and more applications
(multitasking) and/or enter more data, RAM may
become all occupied - This is like your workbench is all covered by
tools and materials. - The operating system moves some part of some
applications to virtual memory to free up some
RAM space - This is like you move some tools and materials
from workbench to the walls of the workshop. - Now you can continue entering more data or
opening more applications. - This is like you continue your work on workbench
using newly freed space. - When you need a part of a program or a program
that was moved to virtual memory, it may be
swapped back in RAM. - This is like you need a tool you moved to the
walls earlier, you need to clear some space on
workbench so you can move it back.
17Add More Memory
- Virtual memory allows us to run applications that
together need more than the available physical
RAM - Virtual memory (hard disk) is much slower than
main memory (RAM). - The more swapping between RAM and virtual memory,
the slower of the system - The more RAM (bigger workbench), the less likely
swapping occurs - The more RAM, the faster the system
- Stop applications that no longer needed, this
frees the RAM space occupied by those
applications ? remove no longer needed tools from
your workbench.
18File Management
- Programs and user data are stored as files on the
hard disk - Each file always takes multiple sectors
- Folders can be used to organize files like file
cabinets
19Before DELETE
20After DELETE
21After ERASE
22Deleting a file vs. Erasing it
- Deletion of a file
- Removes the record of the file from the
corresponding directory - Marks that the various sectors of the file are
now free - Erasure of a file
- Writes over all information in the various
sectors containing file data - Removes the record of the file from the
corresponding directory - Marks that the various sectors of the file are
now free
Delete a file throw it into a garbage can
someone may steal it and
read it Erase a file shred it
no one can read it anymore
23I/O Devices - Drivers
- OS needs a special program, called device driver,
for each I/O device - The driver is designed for the device and the OS.
- A HP printer driver designed for Windows XP
normally would not work Vista - Many OSs have device drivers of commonly used
devices included in their installation - Device drivers may be updated by the manufacture
for various reasons - My advice download drivers only from the
manufactures website
24Which OS is best?
- Three most common OSs
- Windows by Microsoft
- Aggressively marketed
- Take a large fraction of individual stations
- As a result, users can easily share programs and
data - Macintosh OS X by Apple
- Offers a simple, clean, and powerful graphical
user interface - Linux by Linus Torvalds and others
- Offer higher reliability and ability to link
complex tasks
25Summary chapter 4
- Operating systems handle common tasks
- Multitasking allows a computer to split its CPU
time and resources among multiple programs and
users - Booting restarts the computer and the OS sets up
the environment - Rebooting involves shutting down the computer and
starting it up again - Different OSs are designed for different
purposes - Different OSs define different formats on disks
- Virtual memory
- Allow more applications beyond the limit of RAM
- Located on the hard disk
- Deleting vs. erasing files
- Disk fragmentation and defragmentation
- Viruses and anti-virus programs
26Terminology
- Operating systems
- Booting a computer
- Rebooting a computer
- Single-tasking
- Multitasking
- Virtual memory
- Fragmentation
- Defragmentation
- Deleting files
- Erasing files
- MS Windows
- Mac OS X
- Linux