Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating Systems Chapter 1.

Similar presentations


Presentation on theme: "Operating Systems Chapter 1."— Presentation transcript:

1 Operating Systems Chapter 1

2 Outline How does this class operate?
History & Examples of Operating Systems High level introduction to Operating Systems What is an Operating System? Why study Operating Systems? Conclusion

3 Course Administration
Text Book: Operating Systems Concepts, 7th Edition Silbershatz, Galvin, Gagne References: Wikibook, Wikipedia, OER (open courseware) TAs. Office hours: Web Page: Terms and Policies Mailing list Rough Grading Breakdown Exams: Three exams 10%~15% each Exam dates (3/11/07, 1/12/07, 5/1/08) Assignments 10%~15%, you need to work with Linux Class Participation 5%, using a Wiki

4 Course prerequisites Data Structures Assembly Programming
Computer Architecture SW-Engineer (Preferable)

5 Course Objectives Short term goals Long term goals
Gain a good knowledge of OS in general, and how their internals work Long term goals This course is the basis for future work in other areas of OS: hacking Linux, i.e. contribute to the Open source OS :-) postgraduate degree with an OS major

6 Topic Coverage Fundamentals (Operating Systems Structures)
Process Control and Threads Synchronization and scheduling VM, Protection, Address translation, Caching File Systems, I/O ~Security, Networking

7 Let us begin!

8 Computing Devices Everywhere

9 Computing Devices Everywhere
Operating Systems drive the inner workings of virtually every computer in the world today PCs, servers, iPods, cell phones, missile guidance systems, etc. all have an OS that dictate how they operate. The OS manages many aspects of how programs run, and how they interact with hardware and the outside world.

10 Understanding the OS is essential for understanding:
System performance and reliability Resource management Virtualization and abstraction Concurrency and parallelism Hardware interfaces and I/O

11 IS OS Development easy? Developing huge OS needs a lot of Man-Power, Organization and Budget, e.g. Windows Vista has approx. 30 Million lines of code I recommend visiting Channel 9 ( Example video: Windows Vista PreOS Environment: What happens before the OS loads *nix OS has an interesting story, search for Richard Stallman and Linus Torvalds in Google Video. I highly recommend watching “Triumph of the Nerds.”

12 Organization & Components of a computer system

13 Computer System Organization
Computer-system operation One or more CPUs, device controllers connect through common bus providing access to shared memory Concurrent execution of CPUs and devices competing for memory cycles

14 Three Components of a Computer System
A computer system consists of hardware system programs application programs

15 Four Components of a Computer System

16 What does an Operating System do?
Silberschatz and Gavin: “An OS is Similar to a government” Coordinator and Traffic Cop: Manages all resources Settles conflicting requests for resources Prevent errors and improper use of the computer Facilitator: Provides facilities that everyone needs Standard Libraries, Windowing systems Make application programming easier, faster, less error-prone Some features reflect both tasks: E.g. File system is needed by everyone (Facilitator) But File system must be Protected (Traffic Cop)

17 What is an Operating System,… Really?
Most Likely: Memory Management I/O Management CPU Scheduling Communications? (Does belong in OS?) Multitasking/multiprogramming? What about? File System? Multimedia Support? User Interface? Internet Browser?

18 What is an OS? Hardware Kernel User Application User Application
Protection Boundary Kernel Memory Management CPU Scheduling File System Disk I/O Process Mang. Device Drivers Networking Multitasking Hardware/ Software interface Hardware

19 Operating System Definition
No universally accepted definition “Everything a vendor ships when you order an operating system” is good approximation But varies wildly “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program

20 What if we didn’t have an OS?
Source CodeCompilerObject CodeHardware How do you get object code onto the hardware? How do you print out the answer? Once upon a time, had to Toggle in program in binary and read out answer from LED’s! Altair 8080

21 What if we didn’t have an OS?
Early batch system bring cards to 1401 read cards to tape put tape on 7094 which does computing put tape on 1401 which prints output

22 Operating System Structure

23 Operating System Structure
Multiprogramming needed for efficiency Single user cannot keep CPU and I/O devices busy at all times Multiprogramming organizes jobs (code and data) so CPU always has one to execute A subset of total jobs in system is kept in memory One job selected and run via job scheduling When it has to wait (for I/O for example), OS switches to another job

24 Memory Layout for Multiprogrammed System

25 Operating System Structure
Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing Response time should be < 1 second Each user has at least one program executing in memory process If several jobs ready to run at the same time  CPU scheduling If processes don’t fit in memory, swapping moves them in and out to run Virtual memory allows execution of processes not completely in memory

26 Operating-System Operations

27 Operating-System Operations
Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system

28 Dual Mode Operation Hardware provides at least two modes:
“Kernel” mode (or “supervisor” or “protected”) “User” mode: Normal programs executed Some instructions/ops prohibited in user mode: Example: cannot modify page tables in user mode Attempt to modify  Exception generated Transitions from user mode to kernel mode: System Calls, Interrupts, Other exceptions

29 Process Management (1) A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. Process needs resources to accomplish its task CPU, memory, I/O, files Initialization data Process termination requires reclaim of any reusable resources

30 Process Management (2) Single-threaded process has one program counter specifying location of next instruction to execute Process executes instructions sequentially, one at a time, until completion Multi-threaded process has one program counter per thread Typically system has many processes, some user, some operating system running concurrently on one or more CPUs Concurrency by multiplexing the CPUs among the processes / threads

31 Process Management Activities
The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling

32 Memory Management (1) All data in memory before and after processing
All instructions in memory in order to execute Memory management determines what is in memory when Optimizing CPU utilization and computer response to users

33 Memory Management (2) Memory management activities
Keeping track of which parts of memory are currently being used and by whom Deciding which processes (or parts thereof) and data to move into and out of memory Allocating and deallocating memory space as needed

34 Storage Management (1) OS provides uniform, logical view of information storage Abstracts physical properties to logical storage unit - file Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)

35 Storage Management (2) File-System management
Files usually organized into directories Access control on most systems to determine who can access what OS activities include Creating and deleting files and directories Primitives to manipulate files and dirs Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media

36 Mass-Storage Management (1)
Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time. Proper management is of central importance Entire speed of computer operation hinges on disk subsystem and its algorithms

37 Mass-Storage Management (2)
OS activities Free-space management Storage allocation Disk scheduling Some storage need not be fast Tertiary storage includes optical storage, magnetic tape Still must be managed Varies between WORM (write-once, read-many-times) and RW (read-write)

38 I/O Subsystem One purpose of OS is to hide peculiarities of hardware devices from the user I/O subsystem responsible for Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs) General device-driver interface Drivers for specific hardware devices

39 Protection and Security (1)
Protection – any mechanism for controlling access of processes or users to resources defined by the OS Security – defense of the system against internal and external attacks Huge range, including denial-of-service, worms, viruses, identity theft, theft of service

40 Protection and Security (2)
Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file Privilege escalation allows user to change to effective ID with more rights

41 Computing Environments
Traditional computer Blurring over time Office environment PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing Now portals allowing networked and remote systems access to same resources Home networks Used to be single system, then modems Now firewalled, networked

42 Computing Environments (Cont.)
Client-Server Computing Dumb terminals supplanted by smart PCs Many systems now servers, responding to requests generated by clients Compute-server provides an interface to client to request services (i.e. database) File-server provides interface for clients to store and retrieve files

43 Peer-to-Peer Computing
Another model of distributed system P2P does not distinguish clients and servers Instead all nodes are considered peers May each act as client, server or both Node must join P2P network Registers its service with central lookup service on network, or Broadcast request for service and respond to requests for service via discovery protocol Examples include Napster and Gnutella

44 Web-Based Computing Web has become ubiquitous
PCs most prevalent devices More devices becoming networked to allow web access New category of devices to manage web traffic among similar servers: load balancers Use of operating systems like Windows 95, client-side, have evolved into Linux and Windows XP, which can be clients and servers

45 Chapter Conclusion

46 OS Systems Principles OS as illusionist: OS as government:
Make hardware limitations go away Provide illusion of dedicated machine with infinite memory and infinite processors OS as government: Protect users from each other Allocate resources efficiently and fairly OS as complex system: Constant tension between simplicity and functionality or performance OS as history teacher Learn from past Adapt as hardware tradeoffs change

47 Why Study OS? Learn how computer works
Learn how to build complex systems: How can you manage complexity for future projects? Engineering issues: Why is the web so slow sometimes? Can you fix it? How do large distributed systems work? (Kazaa, etc) Buying and using a personal computer: Why different PCs with same CPU behave differently How to choose a processor (Itanium, Celeron, Pentium, etc)? Should you get Windows XP, 2000, Linux, Mac OS …? Because OS is everywhere!!

48 Conclusion Operating systems provide a virtual machine abstraction to handle diverse hardware Operating systems coordinate resources and protect users from each other Operating systems simplify application development by providing standard services Operating systems can provide an array of fault containment, fault tolerance, and fault recovery

49 References Pictures & some slides Content
Prof. Kubiatowicz & Prof. Anthony, Berkeley university, Prof. Welsh, Harvard University Modern OS slides by A. Tanenbaum Content Text book Modern OS Book Wikipedia And much more


Download ppt "Operating Systems Chapter 1."

Similar presentations


Ads by Google