Download Self-Managing Techniques for Shared Server Resources

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

MTS system architecture wikipedia , lookup

Mobile operating system wikipedia , lookup

OS/2 wikipedia , lookup

Acorn MOS wikipedia , lookup

Burroughs MCP wikipedia , lookup

Plan 9 from Bell Labs wikipedia , lookup

Security-focused operating system wikipedia , lookup

Copland (operating system) wikipedia , lookup

Distributed operating system wikipedia , lookup

DNIX wikipedia , lookup

RSTS/E wikipedia , lookup

Unix security wikipedia , lookup

Spring (operating system) wikipedia , lookup

CP/M wikipedia , lookup

Kernel (operating system) wikipedia , lookup

Process management (computing) wikipedia , lookup

VS/9 wikipedia , lookup

Transcript
Today

CSCI 5103
Operating Systems

OS Services and Execution
OS Structure
Instructor: Abhishek Chandra
2
Computer System
Computer Organization: Basics

User Programs
Shells, Tools and Utilities

Applications


Processes, File System,
Virtual Memory, Threads,
Sockets
CPU, Memory,
Disks, Devices
3
CPUs
Memory hierarchy
Storage
I/O devices
Operating
System
Hardware
4
1
Operating System Services

User-oriented:




Operating System Execution

Program execution: Processes, threads
File systems and I/O
Inter-process Communication (IPC)

System-oriented:



Resource allocation
Accounting
Protection and security
5
6
OS Booting





OS Execution
Bootstrap program:


Small program in ROM
Executed on system start
Loads OS from fixed address on disk
Could load more complex bootstrap program

What does an OS do most of the time?




Starts execution from boot block
Loads and initializes rest of OS


Nothing much
User-level code runs most of the time
When is OS invoked?

OS:

7
How does the OS execute on the hardware?
What’s the relation between OS and user
programs?
Hardware interrupt: I/O pending, timer
System call: User program wants a service
Exception: Segmentation fault, Divide-by-zero
What if no user program to execute?
8
2
Dual-Mode Execution

Kernel Mode
Hardware provides two modes (or more) of
operation:


Kernel mode
User mode




9
Kernel Mode
Operating
System
Access to hardware resources
Access to protected memory
Access to OS data structures
Tighter control, security of system resources
10
User Mode




System Calls
User Mode
Applications
Kernel Mode
Operating
System
User Mode
System Call
Result
Kernel Mode
Applications, utilities, shell run in user mode
Restricted access to

11
Applications
OS runs in kernel mode: hardware-enabled
Higher privileges than user mode


User Mode

System resources
Kernel data structures


Protection boundaries
Applications
Operating
System
Kernel API
Entry points into the kernel
Provide restricted access to the kernel
12
3
System Call Operation
P arameters,
S y scall no.
Trap
Result
Sy scall Table
Dispatcher
Sy scall
Handler
Operating System Structure
User Mode


Kernel Mode





User program executes a TRAP instruction
 Switches to kernel mode
 Passes parameters, system call no.
Kernel looks up system call table
System call handler is invoked
Results returned to user program
Processes, File System, Virtual Memory, Threads, ...
Kernel: Core of the Operating System

13
What should it contain?
14
Monolithic
User Programs
Shells, Tools and Utilities
Processes, File System,
Virtual Memory, Threads,
Sockets
CPU, Memory,
Disks, Devices
15
How should the components of an OS be
organized?
Unix Structure
Applications, Utilities, and User Programs
Applications
Shell
Libraries
System Call Interface
Operating
System
Kernel
Processes, File Sy stem,
Virtual Memory, Threads, Sock ets
Hardware
CPU, Memory,
Disks, Devices
AUI
(Application
User Interface)
API
(A pplication
Programmer Interface)
Operating
System
Hardware
16
4
Monolithic Structure: Pros & Cons
Layered
Applications
Shell
OS Layer 2
OS Layer 1
Hardware
17
18
Layered Approach: Pros and Cons
Microkernel

Kernel contains minimal functionality



All OS services implemented as user-level servers



19
Basic process abstraction, memory management
Inter-process Communication (e.g., messages)
File system, device drivers, network stack
Applications interact via message-passing
Example: MACH
20
5
Microkernel: Pros and Cons
Modules

Kernel has core components
Other components are linked in dynamically

Examples: Linux, Solaris

Pros and Cons?


21
22
Virtual Machines

Virtualize whole system environment

Virtual Machine Monitor (VMM):






23
Device drivers, special file systems
Why do virtualization?
OS, Applications
Software layer that provides virtualization support
Manages multiple virtual machines
“OS for OSes”
Virtual Machine: Replica of the native machine
environment
Guest OS: OS running inside a VM
24
6
VMM Implementation

Hypervisor:





Software layer on top of hardware
Controls all system resources
E.g.: VMWare ESX, Xen




VMM uses services of host OS
VMs run as applications
E.g.: VMWare GSX

Allows executing an OS on a different architecture
E.g.: Bochs
Process VMs: Virtualization at process-level (i.e.,
program code+resources)


Architecture support

Emulation: Replicate a hardware architecture in
software

Host-based:


Other Forms of Virtualization
Program binary = “virtual hardware” instructions
E.g.: JVM supports Java bytecodes
Hardware support for VMM
E.g.: Intel VT-x, AMD Pacifica
25
26
OS Design and Implementation

Design goals: What metrics to optimize?



What does this depend on?
Mechanism vs. policy
Implementation issues:




What structure to use?
What programming language to use?
What should be included as part of the OS?
How to debug?
27
7