OS Structure, Processes - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

OS Structure, Processes

Description:

Both are 'conceptually simple' Just a 'simple matter of programming' ... Hiding information at each layer. Develop a layer at a time. Examples. THE (6 layers) ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 23
Provided by: Kai45
Category:

less

Transcript and Presenter's Notes

Title: OS Structure, Processes


1
OS Structure, Processes Philosophizing
  • Vivek Pai / Kai Li
  • Princeton University

2
But First, A Word From Our Sponsor
  • Project 1 you have to do two things
  • bootblock.s
  • createimage.c
  • Both are conceptually simple
  • Just a simple matter of programming
  • Fred Brooks Mythical Man-Month

3
What you need to do
  • Create bootblock.s
  • Compile it
  • Using createimage, append dummy kernel
  • Transfer image to floppy disk
  • Boot from floppy disk

4
Monolithic
User program
User program
  • All kernel routines are together
  • A system call interface
  • Examples
  • Linux
  • Most Unix OS
  • NT

return
call
entry
Kernel many many things
5
Monolithic Pros and Cons
  • Pros
  • Relatively few crossings
  • Shared kernel address space
  • Performance
  • Cons
  • Flexibility
  • Stability
  • Experimentation

6
Layered Structure
  • Hiding information at each layer
  • Develop a layer at a time
  • Examples
  • THE (6 layers)
  • MS-DOS (4 layers)

Level N
. . .
Level 2
Level 1
Hardware
7
Layering Pros and Cons
  • Pros
  • Separation of concerns
  • Simplicity / elegance
  • Cons
  • Boundary crossings
  • Performance?

8
Microkernel
User program
Services
  • Micro-kernel is micro
  • Services are implemented as regular process
  • Micro-kernel get services on behalf of users by
    messaging with the service processes
  • Example Taos, Mach

return
call
entry
m-kernel
9
Microkernel Pros and Cons
  • Pros
  • Easier to develop services
  • Fault isolation
  • Customization
  • Smaller kernel gt easier to optimize
  • Cons
  • Lots of boundary crossings
  • Really poor performance

10
Virtual Machine
  • Virtual machine monitor
  • provide multiple virtual real hardware
  • run different OS codes
  • Example
  • IBM VM/370
  • virtual 8086 mode
  • Java

user
user
OS1
OSn
. . .
VM1
VMn
Small kernel
Bare hardware
11
Hardware Support
  • What is the minimal support?
  • Can virtual machine be protected without such
    support?
  • Hint what is a Turing machine?

12
Time For Philosophizin
  • I can out-learn you,
  • I can out-read you,
  • I can out-think you,
  • I can out-philosophize you

13
What Is a Program?
  • Idea / desire / specification
  • Source code
  • Compiled executable
  • But what brings it to life?

14
Programs Have a Time Component
  • What is the program doing now?
  • Execution state
  • Program state
  • Can two people do different things with the same
    program?
  • Can one person? How?

15
Resource Virtualization
  • CPU
  • Memory
  • Devices

16
Concurrency and Process
  • Problem
  • A shared CPU, many I/O devices and lots of
    interrupts
  • Users feel they have machine to themselves
  • Answer
  • Decompose hard problems into simple ones
  • Deal with one at a time
  • Process is such a unit

17
Process
  • Sequential execution
  • No concurrency inside a process
  • Everything happens sequentially
  • Process state
  • Registers
  • Main memory
  • Files in UNIX
  • Communication ports

18
Program and Process
main() ... foo() ... foo()
... Program
main() ... foo() ... foo()
... Process
heap
stack main foo
registers PC
19
Process vs. Program
  • Process gt program
  • Program is just part of process state
  • Example many users can run the same program
  • Process lt program
  • A program can invoke more than one process
  • Example Fork off processes to lookup webster

20
Process State Transition
terminate
Scheduler dispatch
Running
Wait for resource
Create a process
Ready
Blocked
Resource becomes available
21
Process Control Block(Process Table)
  • What
  • Process management info
  • State (ready, running, blocked)
  • Registers, PSW, parents, etc
  • Memory management info
  • Segments, page table, stats, etc
  • I/O and file management
  • Communication ports, directories, file
    descriptors, etc.

22
Discussion Question
  • What need to be saved and restored on a context
    switch and how?
  • What are the implications?
Write a Comment
User Comments (0)
About PowerShow.com