What functions are required from a processor
(CPU) in order to implement a secure multitasking operating system?
Rather than talking about programs we will
usually call a running program a process.
Each process (or task) needs
New Topic - Implementing a pipeline
In the first part of the course you would have
used Unix pipelines at the command line.
All Unix processes have three open files by
stdin - standard input, normally gets data from
Occasional DPC problems
The Unix solution to the problem of interrupts
doing too much computation we saw in
lecture 31 was the use of top half and bottom
half interrupt routines.
A similar thing is done in Windows with
Deferred Procedure Calls
Lots of processing
Split the interrupt handler
Interrupts need to be handled quickly, partly so
that information is not lost and partly because
the processor needs to get back to what it was
However sometimes the amount of work to
Input and Output
Input and Output
Processors by themselves are pretty much
If you cant get any data into the machine from the real
world nor get any results out of it then it is just an
expensive (and not very efficient) door stop.
Last time we l
Different operating systems have different ways
of dealing with the exceptions which occur
during the execution of a process.
We will focus on dealing with exceptions using
Unix. The usual way to deal with exceptions
on Unix is w
With system calls we have seen a technique where
the processor jumps from a position in user
mode to a different position in kernel mode.
Before we get to interrupts we need to consider
how does the operating system know when
Switching between processes
Threads vs Processes
One of the tasks the operating system has to
perform is to quickly switch from one process
to another so that all processes which should
be running get a chance to run.
This is the basis for multi-tasking.
Which system call?
The int instruction
Rather than have dozens or hundreds of entry
points into the kernel to each of the different
system calls we usually only have the one.
Because it works on all x86 processors both
Windows and Linux can use the int
Example gdb session
Controlling the windows
Compile the program to assembly language:
Show information on the current layout:
gcc -m32 -S program.c
goes back to the one window
Run gdb with the textual user interface:
shows a dissassembly
What is a page?
Pages and Frames
The logical address space is divided up into
fixed size chunks known as pages. Pages are
commonly 4KB (4096 = 212 bytes) in size,
but they can vary from a small number of
Kilobytes up to Megabytes in size.
The virtual or l