0% found this document useful (0 votes)
33 views16 pages

L3 OS Structure

Uploaded by

ruiting.chen.pub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views16 pages

L3 OS Structure

Uploaded by

ruiting.chen.pub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Lecture 3: OS Structure

Layered systems
Open systems
Monolithic kernels
Microkernels

CSC 469 / CSC 2208

Spring 2024
Overview
• Kernel structures
• Layered systems
• Open systems
Today
• Monolithic kernels
• Microkernels
• Virtual Machines
Next Week
• Kernel Extensions
Early Layered System: THE
• Djikstra, 1st SOSP, 1967

Operator

4 User programs

3 Buffering of input & output data streams Peripherals

2 Message Interpreter (console handler) Keyboard


TTY out

1 Segment Controller (Memory Management) Memory


Disk
0 Processor Allocation and Timer Interrupt Handling CPU
Properties of Layered Systems
• Each layer has well-defined function and interface to layer above/below
• Provides easier-to-use abstraction for higher layers
Layer provides interface to layer above.
• Other examples: MULTICS (rings) Can use/invoke interface of layer below.
• Advantages?
• Each layer can be designed, implemented and tested independently (exhaustive
testing possible due to limited interactions)
• Processes at any level can only invoke services of level below  no circular wait
 no deadlock
• Disadvantages?
• Hard to partition functions into this strict hierarchy (why is console below other
peripherals?) Peripherals need to invoke message interpreter to report errors.
Open Systems

Mozilla libpthread

Emacs libc
Applications
Apache
Kernel and

Interprocess
Communication
Virtual
Memory File System
Networking

CPU Network Memory Disk


Properties of Open Systems
• Applications, libraries, kernel all in the same address space
• Crazy?
• Idea first described by Lampson & Sproull, 7th SOSP, 1979 “An open operating
system for a single-user machine”
• Examples? MS-DOS; Mac OS 9 and earlier; Windows ME, 98, 95, 3.1
• Palm OS and some embedded systems
• Used to be very common
• Advantages?
• Very good performance (no overhead for usersystem crossings)
• very extensible/customizable
• works well for single-user
• Disadvantages?
• No protection between kernel and/or apps, not very stable
• Composing extensions can lead to unpredictable behavior
Classifying Open Systems
• Why is Windows 95/98/ME classified as “open”?
• 32-bit applications have own address space BUT
• 16-bit Win, DOS apps, and dll’s share 1GB space
• Including key system dll’s (kernel32.dll)

• Next up: monolithic OSs and microkernels…


unprivileged
Monolithic OS
Apache Mozilla Emacs
User-level
Processes
libc libpthread libc libpthread libc
privileged

Interprocess
Communication Security
Kernel

Operating
CPU Scheduling Virtual
File System System
Memory Software
Networking

CPU Network Memory Disk Hardware


Properties of Monolithic Kernels
• OS is all in one place, below the “red line”
• Applications use a well-defined system call interface to interact with
kernel
• Examples: Unix, Windows NT/XP, Linux, BSD
• Common in commercial systems
• Advantages?
• Good performance
• Well-understood, easy for kernel developers
• High level of protection between applications
• Disadvantages?
• No protection between kernel components
• Not (safely, easily) extensible
• Overall structure becomes complicated (no clear boundaries between modules)
Microkernel OS
Mozilla
Networking
libc libpthread
user processes

unprivileged
unprivileged

Apache Emacs

OS servers
Device File
libc libpthread libc Drivers System

privileged
privileged

Microkernel

Interprocess Thread Memory


Communication Management Management

CPU Network Memory Disk


Properties of Microkernels
• Design Philosophy: protected kernel code provides minimal “small,
clean, logical” set of abstractions
• Tasks and threads
• Virtual memory
• Interprocess communication
• Everything else is a server process running at user-level

• Early examples: Nucleus (1970),


• Later examples: Mach, Chorus, QNX, L4, GNU Hurd
• Mixed results …
Microkernel Advantages
• Extensible: add a new server to add new OS functionality
• Kernel does not determine operating system environment
• Allows support for multiple OS personalities
• Need an emulation server for each system
• e.g., Mac, Windows, Unix
• All applications run on same microkernel
• Applications can use customized OS
• e.g., for databases
More Advantages
• Mostly hardware agnostic
• Threads, IPC, some user-level servers don’t need to worry about underlying
hardware
• Strong protection
• Even of the OS against itself
• i.e., the parts of the OS that are implemented as servers
• Easy extension to multiprocessor and distributed systems
Microkernel Disadvantages
• Performance
• System calls can require a lot of protection mode changes (next slide)
• Expensive to reimplement everything with a new model
• OS personalities are easier to port to new hardware after porting to microkernel,
but porting to microkernel may be harder than porting to new hardware
• Bad past history
• See IBM Workplace OS story
Microkernel System Call Example
1. Application calls read(), traps to
microkernel
2. microkernel sends message to
Unix Personality requesting
read Application Unix File System
3. Unix personality sends message Personality Server (FSS)
to File System Server (FSS)
asking for data 7 5
1 10 9
4. FSS receives message and
begins processing 8 6
5. FSS sends message to
microkernel asking for disk
blocks
6. Microkernel sends data back to 2 3 4
FSS Microkernel
7. FSS sends message to UNIX
Personality with results
8. Unix Personality receives
message with data As we will see, IPC performance is
9. Unix Personality sends data to critical for microkernels.
Application
10.Application receives data
Next Time
• Example microkernels and microkernel evolution
• The Mach microkernel
• Read mach_usenix86.pdf, “Mach: A New Kernel Foundation for UNIX
Development”
• The L4 microkernel

• Briefly, other designs (Exokernel)

• Kernel Extensions

• Virtual machines (starting)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy