<>


Operating Systems Goodies

This page contains lots of extra information used in the Operating Systems Course.


*Sample Exam
*Sample Programs


Sample Exam

Operating Systems Sample Exam   -- These are the kind of questions you might have on an exam.. Don't take them too literally.  They are meant to show the style of question rather than the specific material.

This was the exam given February 5, 2007  ---- CS3013_Midterm_C07.pdf

This is a solution for this exam ----                    CS3013_Midterm_C07_Soln.pdf
And these are statistics for the exam ----            CS3013_Midterm_C07_Stats.jpg

Sample Programs

Topic
Source Code
Comments
Processes signal.C
ManyProc.c, ManyProc.exe, RunManyProc.bat, RunManyProc.sh,
myfork.C
myexec.C
Program to receive signals via a kill command.
Creates hundreds of processes - how many does your machine support?
Simple fork program.
Simple fork and exec program
Threads ProcessOrThread.c
ProcessorThreadOrClone.c     
Shows simple properties of processes and threads.
Uses processes, threads, and clones to look at properties
of shared memory, kernel threads, etc.
Scheduling
sched.c    sched.exe   RunSched.bat

 SchedTimes.c     SchedTimes.exe       runSchedTimes.sh

Do identical processes get their "fair share" of CPU?

How long does it take a process to reschedule?

Synchronization ThreadsRunAmock.c
ThreadsRunAmockResults   
mutexthr.C
ThreadsTamed.c  
An adder and subtractor each operate on a number.
  What will result?
Uses synchronization in multithreaded program.
ThreadsRunAmock --- but now using synchronization
Deadlocks DeadWrong.c

DeadWrongXn.c

DeadRight.c 

Two threads each call mutexes - but in the wrong order

N threads form a circular wait via mutexes

A solution that recovers from an unsafe situation

Memory Management mmapexample.C
Simple.c
arch.c    arch.exe  
Example of the mmap system call.
Look at how globals, stacks, and memory are virtually addressed
Understand the underlying memory structure supported by an OS
Virtual Memory
StackItHigher.c      StackItHigher.exe  
HeapItOn.c            HeapItOn.exe

VirtualMemoryCharacteristics.xls  
cpuid.c                  cpuid.exe

SimpleLoop.c     SimpleLoop.exe 

How much memory does an OS allocate to stacks - try it!
How much memory can you get from the heap?  Try it!

Record of what happens when we run the previous two programs various hardware and software platforms.
Displays processor characteristics
How simple loops can affect performnace - run with vmstat or taks manager to see great stuff happen.

FileSystems/IO fileio.C,   pipe.C
Simple programs using files and pipes.
Project 1
myfork.C
myexec.C
Simple fork program.
Simple fork and exec program
Project 4
pcthreads.C,
prodcons.C
Producer/Consumer with threads
Producer/Consumer with fork
Project 5
mmapexample.C Example of the mmap system call.