1 / 40

What is an Operating System? Various systems and their pros and cons E.g. multi-tasking vs. Batch

What is an Operating System? Various systems and their pros and cons E.g. multi-tasking vs. Batch OS definitions Resource allocator Control program Kernel. Abstract View of System Components. Important OS Features/services. Process Management (CPU scheduling) Main Memory Management

ethel
Download Presentation

What is an Operating System? Various systems and their pros and cons E.g. multi-tasking vs. Batch

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. What is an Operating System? • Various systems and their pros and cons • E.g. multi-tasking vs. Batch • OS definitions • Resource allocator • Control program • Kernel

  2. Abstract View of System Components

  3. Important OS Features/services • Process Management (CPU scheduling) • Main Memory Management • File Management • I/O System Management • Secondary Management • Networking • Protection System • Command-Interpreter System

  4. Memory Tables Process Image Memory I/O Tables User data User program System stack PCB I/O File File Tables Processes Primary Table Process 1 Process 2 … Process N OS Control Structure

  5. New Ready Running Exit Suspend Blocked Process State Diagram dispatch admit time-out release activate event wait suspend

  6. System call vs. System program

  7. Dual mode operation & why ?

  8. OS structure & Layered Approach • The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. • With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers.

  9. UNIX System Structure

  10. Process Management • Process vs. Thread creation • Process scheduling • Process Termination • Unix process creation fork() & exec() • Identify parent vs. child • How to find out process infomation

  11. Process Control Block (PCB)

  12. Process vs. Thread creation

  13. Multithreading Models • Many-to-One • One-to-One • Many-to-Many ---------------------------------------------- • Pthread, JAVA thread, Kernel vs. User thread

  14. CPU Switch From Process to Process

  15. Process Scheduling Queues • Job queue – set of all processes in the system. • Ready queue – set of all processes residing in main memory, ready and waiting to execute. • Device queues – set of processes waiting for an I/O device. • Process migration between the various queues.

  16. Representation of Process Scheduling

  17. Schedulers • Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready queue. • Short-term scheduler (or CPU scheduler) – selects which process should be executed next and allocates CPU. • Midterm scheduler

  18. Addition of Medium Term Scheduling

  19. Context Switch • When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process. • Context-switch time is overhead; the system does no useful work while switching. • Time dependent on hardware support.

  20. Process scheduling

  21. Process scheduling Concepts • Maximum CPU utilization obtained with multiprogramming • CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait. • CPU burst distribution • Pre-emptive and none-preemptive

  22. Scheduling Criteria • CPU utilization – keep the CPU as busy as possible • Throughput – # of processes that complete their execution per time unit • Turnaround time – amount of time to execute a particular process (finishing time – arrival time) • Waiting time – amount of time a process has been waiting in the ready queue • Response time – amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)

  23. Various scheduling algorithms • FCFS • SJF • SRTF • R-R with quantum • Priority • Multi-level Priority • --------------- • Pros and cons, different conditions (q time, starvation prevention etc.) • Example of process arrival rate

  24. Process Communication • IPC & Unix IPC • Client-Server • Raw socket • High-level comm (e.g. RPC, RMI, CORBA etc) • Pros & con on various mechanisms

  25. Process Synchronization & deadlocks • Critical Section • Semaphore & implementation (Unix) • Spin lock and sleep(wait) lock • Deadlock • Mutex, hold-wait, no-preemption, circular-wait • Identify deadlock from resource allocation graph or code

  26. Memory Management • Swapping • Contiguous Allocation • Paging • Segmentation • Segmentation with Paging • -------------------- • Pros and cons • Address translation

  27. Pros & cons • Paging vs Contiguous • Hierarchical Paging vs. Hashed Page Tables vs. Inverted Page Tables

  28. Example of address translation (segmetation)

  29. Example of address translation

  30. Virtual Memory

  31. Virtual Memory • Demand paging • Demand segmentation • Page fault and how to handle • Page replacement

  32. File Management • File structure • File Attributes (FCB) • directory • Access method • Access control

  33. A Typical File Control Block

  34. Virtual File System

  35. Allocation Methods • An allocation method refers to how disk blocks are allocated for files: • Contiguous allocation • Linked allocation • Indexed allocation

  36. I/O system • I/O Hardware • Application I/O Interface • Kernel I/O Subsystem • Chracter vs. block • Polling vs. interupt

  37. User program & Kernel interface Note: This picture is excerpted from Write a Linux Hardware Device Driver, Andrew O’Shauqhnessy, Unix world

  38. Two I/O Methods Synchronous Asynchronous Pooling or interrupt

  39. LKM • What is it? • Pros & cons (vs. recompile and patches)

More Related