21
-1 1: What is an operating system? Last Modified: 07/03/22 20:58

1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

Embed Size (px)

Citation preview

Page 1: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-1

1: What is an operating system?

Last Modified:04/20/23 19:07

Page 2: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-2

What is an operating system?

A software layer that manages hardware resources provides an abstraction of the underlying

hardware that is easier to program and use

Applications

Operating Systems

Hardware

Page 3: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-3

Hardware Resources

CPU, Functional Units, Registers Main memory access Storage devices (disk drives, CD-ROMs, tape

drives) Network Interface Cards Human I/O devices (keyboards, monitors, mice) Other? Printers, cameras, sensors, …

How much do you know about what it would be like to interact with these devices without an OS?

Page 4: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-4

Benefits of Operating Systems (1)

Abstracting the Hardware Gory details of the raw hardware hidden so

applications can be smaller and simpler Fast access (as little “tax” as possible) Application writers can program to a simpler

and more portable “virtual machine” Providing useful logical abstractions

New types of logical resources (sockets, pipes, file systems)

Page 5: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-5

Benefits of Operating Systems (2)

Protecting applications from each other Enforce “fair” allocation of hardware

resources among applications Policies that say what is “fair” and

mechanisms to enforce it

Supporting communication and coordination among applications Support abstractions through which

different applications can share data and notify each other of events

Page 6: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-6

What an operating system is not? Compiler Standard libraries Command Shells

These are closely related pieces of system software, but they are not the OS.

Page 7: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-7

Is OS code like other code?

Most OSs implemented in C Developed without space-age development

environments (kernel debuggers?) The buck stops here!

OS must deal with gory hardware details• Try to keep hardware dependent parts isolated

What happens when get a device interrupt in the middle of executing an application? What happens when get a device interrupt while servicing another device interrupt?

What happens if you take a page fault while executing operating system code

Performance and reliability are crucial! Still a lot more like application code than you

might think

Page 8: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-8

Lots of variety of OSes

Unix (Solaris, HP-UX, AIX, FreeBSD, NetBSD,OpenBSD..)

Linux Windows XP, 2000, NT, ME, 98, 95 BeOS MacOS AndroidOS, PalmOS WindowsCE Mach, Amoeba, Sprite, Vino, SPIN, QnX,…

Page 9: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-9

What distinguishes operating systems? When people talk about which operating

system to run, they often talk about: Look and feel of the desktop windowing

system Devices that are supported What hardware platforms does it run on? Applications that are available for that OS Who developed the code? Who supports the

code? How often does the system crash? Reliability? Do you pay for it?

Are these really core OS issues?

Page 10: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-10

Core OS Issues: OS Structure

How is the OS structured? One monolithic kernel of spaghetti code One monolithic kernel that is internally composed of

distinct layers One monolithic kernel that is internally composed of

distinct objects Micro-kernel with trusted user level applications that

provide major OS functionality like virtual memory, scheduling, file systems, etc.

Software engineering question Maintainability? Performance? Reliability? Portability?

Page 11: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-11

Core OS Issues

Concurrency How many and what types of activities can

occur simultaneously? Protection

What is the granularity at which permission to access various resources are granted?

How do you verify an entity’s right to access a resource?

Fault Tolerance How do we deal with faults in applications?

In devices? In our own OS code?

Page 12: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-12

Core OS Issues

Resource/services provided to applications Does the OS offer kernel support for events? Signals?

Threads? Pipes? Shared memory? Naming

How do applications refer to and request the resources they want for themselves? Resources they want to share with others?

Sharing What objects can be shared among applications?

What is the granularity of sharing? Resource Allocation and Tracking

What is the unit (or units) of resource allocation? Can we track ( and bill for) resource usage?

Page 13: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-13

Core OS Issues

Service Time Guarantees What guarantees (if any) are made to

applications about the servicing of their requests or about the servicing of device interrupts?

Real-time OSs Scale/Load

What are the limits of resource allocation? (Biggest file, Maximum number of processes, etc.)

What happens as the demand for resources increases? (graceful degradation? )

Page 14: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-14

Core OS Issues

Extensibility /Tuning What interfaces are provided to change

operating system behavior? How does (or does) the OS optimize its

behavior based on the characteristics of the hardware or the application mix?

Page 15: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-15

Programmers/users demand performance Users want to realize the full “advertised” capability

of a hardware resource If they have a disk capable of 20 MB/sec transfer rate, then

they would like to be able to read files at that rate If they have a network interface card capable of 100

Mbit/sec transmission rate, then they would like to be able to send data at that rate

Operating System usually provide the desired functionality at a cost of some overhead (tax like the government) Avoid seek and rotational delay when reading/writing to

the disk Avoid control messages sent over the network Use a minimum of memory/disk space

Programmers/users want that tax to be at a minimum

Page 16: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-16

Performance Optimization

Operating systems try to optimize their algorithms to minimize the “tax” on applications

What algorithms minimize the tax? That is a hard question – depends on what your workload is

Example: What data do you keep in memory? LRU is generally good but is exactly the wrong thing

for large sequential accesses

Optimize for the “common” case? Adapt? Let applications give hints?

Page 17: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-17

OS Goals

So operating systems should: Abstract the raw hardware Protect apps from each other Not allow applications to monopolize more that their

fair share of system resources Provide desired functionality Expose the raw capability of the hardware,

minimizing the “tax” Optimize for the expected (any?) workload Be simple enough that the code executes quickly

and can be debugged easily

Does this sound like a big job to anyone?

Page 18: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-18

Topics

OS History, Architectural Support Processes, Threads Scheduling Synchronization, Deadlock Memory Management File Systems, IO Devices Networks, Distributed Systems Security

Page 19: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-19

Outtakes

Page 20: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-20

Logistics

Course Web Page Mailing List Staff Textbook

Page 21: 1: What is an operating system? Last Modified: 11/21/2015 1:20 AM

-21

Textbooks

Required: Operating System Concepts, 7th Edition, by

Silberschatz, Galvin, and Gagne, John Wiley & Sons, 2005, ISBN 0-471-69466-5.

Recommended: The C Programming Language, ANSI C, Second

Edition, by Kernighan & Ritchie, Prentice Hall, 1988, ISBN 0-13-110362-8.