operating systems

18
Operating Systems Summer 02 CPS 1 Shannon Pollard

Upload: guillermo-manzanero

Post on 02-Jan-2016

19 views

Category:

Documents


0 download

DESCRIPTION

Operating Systems. Summer 02 CPS 1 Shannon Pollard. Computer Services. What things can your computer do? Calculator Word processing Web browsing Photoshop Paint program Games. These are all pieces of Software!. Software. Software applications usually have very nice interfaces – - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Operating Systems

Operating Systems

Summer 02

CPS 1

Shannon Pollard

Page 2: Operating Systems

Computer Services

What things can your computer do?

• Calculator

• Word processing

• Web browsing

• Photoshop

• Paint program

• Games

These are all pieces of Software!

Page 3: Operating Systems

Software

Software applications usually have very nice interfaces –

• Buttons

• Icons

• Menus

• Instructions

• Graphics

Page 4: Operating Systems

Computer Components

How does the computer perform these functions?

• Memory

• Disk drive

• Circuit Board

• Keyboard

• Monitor

These are pieces ofHardware!

Page 5: Operating Systems

Hardware

Hardware components usually have pretty difficult interfaces. Machine Language Program for MIPS Machine

[0x00400000] 0x8fa40000 lw $4, 0($29) ; lw $a0, 0($sp) [0x00400004] 0x27a50004 addiu $5, $29, 4 ; addiu $a1, $sp, 4 # argv [0x00400008] 0x24a60004 addiu $6, $5, 4 ; addiu $a2, $a1, 4 # envp [0x0040000c] 0x00041080 sll $2, $4, 2 ; sll $v0, $a0, 2 [0x00400010] 0x00c23021 addu $6, $6, $2 ; addu $a2, $a2, $v0 [0x00400014] 0x0c000000 jal 0x00400020 [main] ; jal main [0x00400018] 0x3402000a ori $2, $0, 10 ; li $v0 10 [0x0040001c]

0x0000000c syscall

Page 6: Operating Systems

Operating System

User

Operating System

Hardware

Page 7: Operating Systems

Virtual Environments

Operating Systems make the computer applications organized

• Hallway

• Desk

• File Cabinet

• Book Shelf

Page 8: Operating Systems

Virtual Environments

You’ve seen Operating Systems already:

• Windows whatever

• UNIX

• Mac

Usually work with WIMPs

(Windows, Icons, Menus, Pointers)

Page 9: Operating Systems

Booting up

• If the OS is the program that runs the other programs, how does the OS program get loaded and run in the first place?

• When you turn on the computer, it runs a hardwired program called bootstrap code that loads the OS.

Page 10: Operating Systems

OS Services

1. Provides access to software- Gives interface to user- Knows how to load applications into memory- Provides other communication between the

user and the application

Page 11: Operating Systems

OS Services

2. Provides a secure computing environment- Security for a system (logins and passwords)- Security for internal files and functions(You can’t erase my files; A program crash won’t crash the whole computer)- Security from hardware failure (tries to protect you from crashes with backup measures)

Page 12: Operating Systems

OS Services

3. Provides a file system

public_html

cps1 index.html<HTML>

My Homepage

images wedding

index.html<HTML>My CPS1Homepage

Lab 1 Comp.gif GuestlistSpreadsheet

Page 13: Operating Systems

OS Services4. Provides for Multiprogramming

(Multitasking)A process is a program in some state of

execution.Many can be running at once, while the

processor is waiting on one process, it runs a second.

It may also interrupt a process because of error or just to give another process a chance to run.

Page 14: Operating Systems

More on MultiprogrammingOS

Process 1

RegisterValues

Printer

Process 2

RegisterValues

Disk A

Process 3

RegisterValues

Disk A

Print a file

Read from Disk

Page 15: Operating Systems

More on Multiprogramming

• Several programs are competing for processor time, memory, use of devices, etc…

• OS is the manager that says who gets what

• OS must be programmed to avoid problems…

Page 16: Operating Systems

Multiprogramming Potential Problems

• Starvation – one process never gets the chance to get a resource

• Deadlock – every process waiting for something, and none can run

• Dirty Data – if more than one process is accessing a piece of data, there can be problems

Page 17: Operating Systems

Data Sharing

x = 4;

x = x + 1;

print x;

Shared integerx

x = x + 6;

Page 18: Operating Systems

Conclusion

• Operating Systems provide a bridge between user and computer

• They give access to computer functionality

• They provide security

• They provide file systems

• They manage multiprocessing and resource allocation