1 / 43

Operating Systems High Level View

Operating Systems High Level View. Chapter 1,2. Who is the User?. End Users Application Programmers System Programmers Administrators. End Users Want. Ease of use and learn Adaptable to user’s style Alternative ways to do things Lots of visual cues Free of nasty surprises

annice
Download Presentation

Operating Systems High Level View

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Operating Systems High Level View • Chapter 1,2

  2. Who is the User? • End Users • Application Programmers • System Programmers • Administrators

  3. End Users Want • Ease of use and learn • Adaptable to user’s style • Alternative ways to do things • Lots of visual cues • Free of nasty surprises • Reliable quick response • Consistency among features

  4. Application Programmers Want • Easy to write programs • read keystrokes • draw to screen • change windows • Consistent view of system • Easy to use system facilities • creating new windows • accessing a network • Platform portability

  5. System Programmers Want • Easy to • create correct programs • configure • debug • maintain • expand

  6. Administrators Want • Easy to add or remove devices • Protect system and data • Easy to upgrade • Easy to manage user accounts • Good & predictable average response • Affordable

  7. A Mouse Example • User moves mouse -> hardware interrupt • OS driver sees movement in pulse rate • OS moves cursor on screen • Application sees “mouseover” event -> updates screen image • User sees image change – clicks icon

  8. Terms & Concepts • Operating System - software that manages resources of a computer & provides interfaces to them. • Device - piece of hardware connected to the main computer hardware. • Device controller - electronic interface which controls devices connected to the computer.

  9. Terms & Concepts • Bus - conductors connecting many hardware components in a computer. • Device driver – a part of the OS that interfaces to a device controller. • Kernel - part of an OS that implements basic functions – always running.

  10. Terms & Concepts (cont.) • Service - functions an OS provides to users through programmer interfaces. • Utility - programs not part of the operating system kernel. • Shell - user interface to most system services – command interpreter.

  11. Simplified PC Hardware Bus Hard Disk Disk Controller CPU Video Controller Video Monitor Keyboard Keyboard Controller Memory

  12. One picture of an OS Shell (Command Interpreter) Utilities Other Programs (Browsers, games, word processing) Operating System Kernel Devices (disks, keyboards) Memory CPU

  13. A Personal Computer & OS Command (CommandInterpreter) Utilities OtherPrograms (Browsers, games, wordprocessing) OperatingSystemKernel DeviceDrivers (DVDdriver, videodriver) BIOS (Interfacetohardware) Devices (Disks, keyboards) CPU Memory

  14. The Process Concept and OS Process Information • Process – a program in execution • Also called a job or task • Has CPU state – registers • Has allocated resources

  15. Process States • Started • Ready • Running • Waiting (Blocked) • Terminated (Ended)

  16. Process State Diagram 0 - Program Loaded New 1 - Process Initialized Ready 4 – Got What it needed Wait 2 – Gets CPU Time 5 - Interrupted Run 3 – Needs something 6 - Finished or aborted Exit 7 - Exits System

  17. State Transitions • 0 – OS is preparing the job to run • 1 – Job is ready to run • 2 – Job starts (or resumes) running • 3 – Job is waiting for something • 4 – Job waiting has finished • 5 – Job is preempted • 6 – Job ends or is aborted • 7 – Job exits system

  18. Process Information the OS Maintains • Process ID – a number (PID) • Process Control Block (PCB) • Priority information • Process state • Processor (CPU) state • -> Memory access table • -> Open files table • -> Next PCB

  19. Types of Processes • User or Application Processes • Systems Program Processes • OS Processes

  20. Processor Modes • Privileged • Monitor, kernel, supervisor, ring 0 or system • Non-privileged • user or application

  21. Types of OSs • Single-user • Multi-tasking or multi-programming • Time Sharing • Network and distributed • Real-Time

  22. Single-user OS • One user • One process running • Limited memory management • File services • I/O services

  23. Multi-tasking OS • Multiple processes running • May still be single user • All that a single task system does, + • CPU scheduling • Context switching

  24. Multi-user OS • Multiple users • Users are interactive • Jobs • are short • need fewer resources • need fast response time

  25. Network/ Distributed OS • Low-level services • Connect to the network • Send messages between systems • Higher-level services • Browsing • File sharing • Print services

  26. Real-Time OS • Time deadlines • Hard deadlines • Useless results or catastrophe • Soft deadlines • Some lateness tolerated

  27. Architectural Approaches to Building an OS • Monolithic single-kernel • Microkernel and Layered • Object-oriented Approach • Virtual Machines

  28. Monolithic Architecture • One dense module • RAM was expensive • Started adding features • Got bloated • Harder to add to • Harder to maintain

  29. Layered Architecture • Functions divided into Layers • Each layer higher abstraction • Hopefully don’t skip layers • Faster • Less portable

  30. Layered Architecture Shell (Command Interpreter) Utilities User Programs (Browsers, games, word processing) API Memory Management Processor Scheduling File System Kernel Device Drivers CPU Memory Devices (disks, keyboards)

  31. Microkernel Architecture • One small module • RAM getting cheaper • Started removing features • Moved into higher layers • Run in user mode • Still OS functions

  32. Microkernel Architecture Shell (Command Interpreter) Utilities Other Programs (Browsers, games, word processing, …) File System Memory Management Processor Scheduling USER Mode KERNEL Mode Microkernel Devices (disks, keyboards, …)

  33. Implementation Techniques • Interrupt Handling • Interrupt Vectors • System Calls • Queues and Tables • Object Oriented Approach • Minimalist vs. Maximalist Approaches • Backward Compatibility

  34. Interrupt Handling – Interrupt Vectors • Hardware signals an event • I/O completion or fault • Interrupt register holds interrupt # • # used to select routine address • Vector table in low RAM

  35. Interrupt Vector Interrupt Vector Interrupt Register Address of interrupt service routine 1 Address of interrupt service routine 2 Index into interrupt vector Address of interrupt service routine 3 o o o Illustrating an for handling interrupts Address of interrupt service routine N

  36. System Calls • Load registers/ variables with arguments • TRAP instruction • Generates an interrupt • Automatic switch to kernel mode • Arguments tell OS what to do • Afterwards • “return” as from a function call • Force return to user mode

  37. System Call There are 11 steps in making the system call read (fd, buffer, nbytes) B.Ramamurthy

  38. Some System Calls For Process Management and File Management B.Ramamurthy

  39. OS Queues and Tables • Tables • PCB • Open File Table • Page Tables • Queues • Ready processes • I/O requests • event waits

  40. Object Oriented Architecture • A collection of objects • Better software engineering • Performance penalty • Any object can use any other

  41. Virtual Machine Architecture • OS emulates hardware architecture • Runs other OS, not user applications • Good for OS development • Related – simulate abstract machines • Java • .Net CLR

  42. Hardware Virtual Machine Model Shell,Utilities, or Programs Shell, Utilities, or Programs Shell, Utilities, or Programs Kernel 3 Kernel 2 Kernel 1 Virtual Machine Devices (disks, keyboards, … ), CPU, Memory

  43. Minimalist vs. Maximalist • Less is more • Minimum in kernel • Else in libraries and layers • More choices • Linux • All in One • Operating Standards • MAC OS

More Related