Download presentation
Presentation is loading. Please wait.
1
Operating System Foundations Lecture #2
2
Operating System Functions Processor Hard- disk Memory Frame -buffer Sound -card Printer Mouse Application
3
Operating System Functions Processor Hard- disk Memory Frame -buffer Sound -card Printer Mouse Application Operating System
4
OS Functions OS as layer of protection Process 1 Process 2 Process 3 Protect Memory I/O
5
OS Protection Don’t let any single application hog the processor Only the OS manages the clock Set timers Kick out a process when the time expires Take control of the processor every so often when there are system-wide things to do (I/O, memory management, scheduling).
6
OS Protection Privileged Instructions Only access via a “privilege mode” Make a distinction between User and “supervisor” mode Only supervisor mode can mask interupts Only supervisor mode can access memory management structures Only supervisor mode can do I/O
7
Operating Systems Functions OS as Abstraction Layer System Call Interface Systems Calls For interacting with Hardware and other processes open(file, read_rights) read (file_id, block_number) alarm(up_call, seconds) send_message(socket_id, message)
8
Scheduling Processor ALU Main Memory Application Operating System Scheduler
9
Scheduling Process number Current state Program Counter CPU Registers Memory Mapping Misc Info (open files, name of executable, devices owned) Next and prev PCB
10
Context Switching Process A Process BOS Save state A Restore state B Save state B Restore state A
11
Memory Management Process 1 Process 2 Process 3 0x0000 0x00F0 0x00FF 0x0FFF Process1 From To 0x0dfff 0xfdfff Process2 ………… Process3
12
Memory Management An alternative way and intuitively easier to understand Process 1: Memory Segment 1,2 Process 2: Segment 3 Process 3: Memory segment 7,8,9 Every memory access is checked in hardware to verify that you are only accessing your own memory segment OS provides IPC!
13
I/O Operating System as a multiplexer of I/O devices Protect Resources, yet let processes share them Privilege Mode User Mode System Calls, Interrupts Set User mode (privilges Instruction)
14
I/O Open(device, rights) Privileged Instruction Process -- > Open Devices Table
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.