You are on page 1of 3

Process Management Memory Management

n OS manages many kinds of activities: n Primary (Main) Memory


● User programs ● Provides direct access storage for CPU
● System programs: printer spoolers, ● Processes must be in main memory to
name servers, file servers, etc. execute

n Each is encapsulated in a process n OS must:


● A process includes the complete ● Mechanics
execution context (code, data, PC, n Keep track of memory in use
registers, OS resources in use, etc.) n Keep track of unused (“free”) memory
● A process is not a program n Protect memory space
n A process is one instance of a program in n Allocate, deallocate space for processes
execution; many processes can be n Swap processes: memory <–> disk
running the same program
● Policies
n Decide when to load each process into
n OS must: memory
● Create, delete, suspend, resume, and n Decide how much memory space to
schedule processes allocate each process
n Decide when a process should be
● Support inter-process communication and removed from memory
synchronization, handle deadlock
1 Fall 1998, Lecture 04 2 Fall 1998, Lecture 04

File System Management Disk Management

n File System n Disk


● Disks (secondary storage) provide long- ● The actual hardware that sits underneath
term storage, but are awkward to use the file system
directly
● Large enough to store all user programs
● File system provides files and various and data, application programs, entire OS
operations on files
● Persistent — endures system failures
n A file is a long-term storage entity, a
named collection of persistent information
that can be read or written n OS must:
n A file system supports directories, which ● Manage disk space at low level:
contain files and other directories n Keep track of used spaces
– Name, size, date created, date last
modified, owner, etc.
n Keep track of unused (free) space
n Keep track of “bad blocks”
n OS must: ● Handle low-level disk functions, such as:
● Create and delete files and directories n Scheduling of disk operations
n Head movement
● Manipulate files and directories
n Read, write, extend, rename, copy, protect ● Note fine line between disk management
and file system management
● Provide general higher-level services
n Backups, accounting, quotas
3 Fall 1998, Lecture 04 4 Fall 1998, Lecture 04
System Calls One OS Structure: Large Kernel

user programs
n Process control
● end/abort this program
sytem services: shells, compilers, printing, network access

● load/execute another program system calls

● create/terminate a process signals files CPU scheduling


machine-
terminals swapping page replacement
independent
n get/set attributes kernel character I/O disk, tape virtual memory

n wait specified time terminal device memory machine-


controllers controllers controllers dependent
n wait for event, signal event

n File manipulation hardware: terminals, I/O devices, memory

● create/open/read/write/close/delete file
● get/set attributes n The kernel is the protected part of the OS
that runs in kernel mode
n Device manipulation
● Critical OS data structures and device
● request/read/write/release device registers are protected from user
programs
n Information ● Can use privileged instructions
● get/set time/date

5 Fall 1998, Lecture 04 6 Fall 1998, Lecture 04

Coping with Hugeness OS Design Issues

n Ideal: n Another approach: layered OS


user programs

shell compiler printing


● Divide OS into layers
● Each layer uses services provided by
UNIX OS Kernel
next lower layer
n User programs
n Shell & compilers
n CPU scheduling & memory management
n Reality: n Device drivers
user programs n Hardware
shell compiler printing
● Advantages: modularity, simplicity
n Disadvantages: performance

n Big tradeoff in OS design:


UNIX OS Kernel
➥ simplicity versus performance
➥ Always strive for simplicity…
➥ …Unless you have a strong reason to
believe that complication is needed to
achieve acceptable performance
7 Fall 1998, Lecture 04 8 Fall 1998, Lecture 04
The Future?
Another OS Structure: Microkernel
Network Operating Systems

n Sun’s JavaOS architecture:


user Foundation AWT Net and I/O
processes Classes Classes Classes

user JavaOS NFS Client


mode TCP
Windows UDP
thread file CPU
system system scheduling JavaOS IP
Graphics Ethernet Keyboard Mouse
system
network
processes paging Java Virtual Machine
support

Booting, Traps, Interrupts, Threads


kernel
micro- mode
communication protection low-level VM processor control
kernel
Details at
http://java.sun.com/doc/white_papers.html
n Goal is to minimize what goes in the
n No disk
kernel, implementing as much of the OS
as possible in user-mode processes
n OS can only run a net browser
● Better reliability, easier extension
● Get whatever the OS needs over the net
● Lower performance (unfortunately)
● Get whatever application programs are
needed over the net (as Java applets)
n Examples: Mach (US), Chorus (France)
9 Fall 1998, Lecture 04 10 Fall 1998, Lecture 04

You might also like