Questions: Course Intro
• What is spooling? What problem was it designed to
address?
• What are examples of computing systems that don’t
need all of the components shown on slide 23?
What are other common major elements that aren’t
shown on this slide?
• What is the major difference between a hard real-
time system and a soft real-time system? What is an
example of each?
cs431-cotter 1
Questions: OS Intro
• What is multi-programming? Why is it
important in OSs?
• What is the difference between a system call
and a local function call?
• What is the difference between user mode
and kernel mode?
• Why are Virtual Machines becoming popular
today in PCs?
• How is the Client / Server model being used
today?
cs431 -cotter 2
Questions: Linux intro
• Why does Linux distinguish between standard output
and standard error, when both default to the
terminal?
• What is the difference between a block I/O device
and a character I/O device?
• How would you compile and link “myProg.cpp”?
• How would you run the resulting executable?
• How would you add gdb debugging information to
the above executable?
• From within a debugger, how would you temporarily
(one shot) print out the contents of a variable
“filename.txt”?
cs431 - cotter 3
Questions: Queueing
• Given a queueing system of size 3 with a probability of
being empty P0 = 27/65, an arrival rate of 2/min and a
service rate of 3/min, what is the system throughput (rate
at which customers move through the system)?
• A) Please provide a state transition diagram for a queueing
system that has a system size of 3. B) If the mean arrival
rate is 3/min and the service rate is 4/min, what is the
probability that a process will be lost due to overflow of the
system?
• A) Given a queueing system of size 3 with an arrival rate of
2/min and a service rate of 3/min, if we change the system
size to 4, what effect will this have on the probability of
losing a customer (go up, go down, stay the same)? B)
Why?
cs431-cotter 4
Questions: Processes
• What is the difference between a thread and a process. Given that a task
might be implemented using either a new thread or a new process,
discuss some of the factors that might suggest one form over the other.
(When would a process be good and when would a thread be good?)
• What is the difference between a kernel thread and a user space thread?
What is the advantage of a user space thread? What is its disadvantage?
• What types of events might move a process from a running state to a
ready state?
• Why is it more efficient to run (schedule) multiple processes in parallel
rather than to just run them as serial (sequential) processes?
• What types of events might preempt a thread that is executing in the
CPU? (What events might make it change state?)
cs431-cotter 5
Questions: Linux Processes
• How does a native thread differ from a POSIX thread?
• What happens when a Linux program executes a "fork( )"
command?
• Following a fork( ), how do the resulting processes identify
which is the parent and which is the child?
• What special compiler/linker flag is needed to create an
executable program that creates POSIX threads (pthreads)?
• How can a process identify its parent process PID? (what
command)
• In the book figure 2-15, what problems may arise from the
way that the main program passes the thread ID to the
“hello_world” function?
cs431-cotter 6
Questions: CPU Scheduling
• On a system with multilevel queue scheduling, would you expect to see the same
scheduling algorithms used on all levels, or would you expect them to be
different? Justify your answer.
• Consider the following set of processes, with the length of the CPU burst time
given in milliseconds. The processes are assumed to have arrived in the order P1,
P2, P3, P4.
Process Job Size
P1 10
P2 1
P3 2
P4 5
Of the scheduling algorithms FCFS, SJF, and RR(qt=2) which algorithm offers the
best waiting time?
• In many multiprocessing systems, although there is a fixed limit to the amount of
time that a job can keep control of the CPU, in practice, the jobs are released
earlier. Why?
• The book talked about the multiple queueing system used by CTSS. If a process
needed 30 quanta to complete, how many times would it be swapped in to
complete?
• How does Lottery Scheduling work? What is its principle advantage over, say,
Guaranteed Scheduling?
cs431-cotter 7
Questions: Linux Scheduling
• How does the Linux scheduler decide which
process/thread to run when it schedules a new
process/thread for the CPU?
• How does Linux ensure that real-time processes
always run before any other processes?
• What timeslice values do real-time processes use?
• How does Linux dynamically adjust the scheduling for
I/O intensive processes (giving them a higher
priority)?
• Once all runnable processes have exhausted their
timeslices, how does the scheduler recalculate/
restart those processes?
cs431-cotter 8
Questions: Process Sync
• Why is it necessary to synchronize processes? Give an
example that demonstrates the need for process
synchronization.
• What is a "critical section"? How is it used in synchronizing
the operations of more than 1 process?
• How does the Bakery Algorithm solve the problem of
synchronizing multiple processes?
• What is the difference between a semaphore and a mutex?
• What is an atomic transaction?
• What is a serial schedule? How does it differ from a
serializable schedule?
cs431-cotter 9
Questions: Linux Process Sync
• What is a signal handler table? Where is it located? How is it used by a
process to handle signals sent to the process?
• How do you set up a program (process) to provide customized handling of
a signal? (What code is needed to replace the default signal handler with
our own signal handling routine?
• What function would a parent process use to capture the exit code of a
terminated child process? If the parent process creates multiple child
processes, how could it wait for one specific child process to terminate?
• If two processes want to pass information using an named pipe, what
must the relationship be between those processes (no relation required,
parent and child, children of the same parent, processes in the same
system, etc.)
• What functions (system calls) would be needed to create and initialize a
semaphore in Linux? What functions are needed to actually use the
semaphore in your program?
cs431-cotter cs431-cotter 10
Questions: Deadlock
• In the context of Operating System processes, what is a deadlock? What
conditions are required for a deadlock to exist?
• How does a resource allocation graph help identify opportunities for
deadlock? Please show an example of a resource allocation graph that
includes a deadlock.
• Discuss how the Banker's algorithm ensures that each process that tries to
get access to a critical section will eventually be guaranteed of getting in.
• The Banker’s algorithm only requires that there be at least 1 safe order to
make a transaction safe, however there may be many different orders
possible. Using the example shown on slide 34, how many safe orders
exist given the request by P1?
• How might we handle deadlocks? Give at least 3 of the methods discussed
in the book and provide examples of each.
cs431-cotter 11
Questions: Memory Management #1
• Explain the difference between logical address space and
physical address space. Which parts of a computer system use
logical addresses and which parts use physical addresses?
• When considering dynamic memory partitioning, what is the
major disadvantage of the “best fit” algorithm? What is the
advantage of the “worst fit” algorithm?
• How (where) is virtual memory managed in contemporary
computer systems?
• In an MMU why would we ever want to disable caching?
• The book suggests that page sizes range from 512 bytes to
perhaps 64kbytes. What are the advantages of a small page
size? When is a large page size preferred?
cs431-cotter 12
Questions: Memory Management #2
• How are TLBs used to improve main memory performance? What is the
effective access time for a system with 2 ns TLBs, 20 ns memory access
time, and a hit rate of 98%?
• Page tables are needed to find physical addresses in paging systems. What
is the major disadvantage of paging tables, and how do modern operating
systems get around this disadvantage?
• How much memory would be needed for a 1 MB program using a single
level page table (32 bit address space, 4 bytes per page, 4kb pages)? How
much would be needed for a 4 level page table?
• What is Belady's Anomaly?
• What is a working-set model? How does it help determine the allocation
of frames of main memory to active processes?
• What is thrashing in the context of virtual memory?
Questions: Memory Management #3
• What is the effective memory access time in a system with a memory
access time of 20 ns, a disk access time of 8 ms, and a page fault rate of
1*10-6?
• Programs today are so large, and memory is small (relative to the size of
all of the programs needed at one time). A paging system needs to ensure
that pages needed by the CPU are usually in main memory. Why? (Include
in your explanation the penalty that a program suffers if the page is not in
main memory). What mechanism in normal programs makes paging an
acceptable solution? (Why don't we have many page faults?)
• What is the difference between paging and segmentation? What are the
advantages and disadvantages of each?
• How can OSs use a pure paging scheme in CPUs that implement
segmentation?
cs431-cotter 14
Questions: File Systems
• Two primary access methods are used to manage files. Discuss
these two methods, including which types of physical devices
each is normally associated with.
• What is the difference between a tree structured file directory
and an acyclic graph directory? Please give an example
Operating System used today that uses each.
• Discuss 3 ways in which files might be allocated to file stores
(disks). What are the advantages or disadvantages of each?
• How might a file system manage its free space so that it can
easily assign space for a new file when needed? Give at least 2
approaches.
• What can an OS designer to improve the efficiency of a file
system? What factors should be considered? How do those
affect the efficiency of the system?
• Discuss at least 2 mechanisms that might be used to ensure the
recovery of information stored in a file system.
cs431-cotter 15
Questions: Input Output
• How does DMA improve the performance of common disk
operations (reading and writing)?
• In terms of I/O operations, what is the difference between
temporary and permanent failures? Provide an example of
each.
• On hard disks, the length of the inner track is perhaps 2/3 of
the outer track. How do modern disks deal with the
difference in the amount of space available to write data?
• On optical storage (CDROM, DVD, etc.) how have
manufacturers been able to increase the capacity of the
disks?
• In disk scheduling, what is the difference between the SCAN
algorithm and C_SCAN?
• Which RAID configuration (s) provide a complete duplicate of
all of the data?
cs431-cotter 16
Questions: Multi Processors
• What happens if two CPUs in a multiprocessor
attempt to access exactly the same work of memory
at exactly the same instant?
• In a multicomputer system, consider interconnecting
the systems with either a grid or a hyper cube. What
are the advantages and disadvantages of each?
• What is middleware? What is its role in a distributed
system? What are some examples?
Tanenbaum, Modern Operating Systems
cotter-cs431 3 e, (c) 2008 Prentice-Hall, Inc. All rights 17
reserved. 0-13-6006639
Questions: Virtualization
• In terms of resource allocation does a type 1
hypervisor leave more or less space for guest OSs
than a type 2 hypervisor? Why?
• In terms of a access to a guest OS, what is the
difference between a bridged interface and a NAT
interface?
• What changes are needed to convert a guest OS into
a paravirtualized OS?
• Why has virtualization not been available on PCs until
recently (2005)?
cs431-cotter 18
Questions: Security
• How can cryptography be used to provide a digital signature
that verifies the origin (owner) of a document?
• What is the difference between an ACL and a capabilities list?
• What is the fundamental objective of the Bell-La Padula
security model?
• What are the three general principles against which most user
authentication schemes are built?
• Discuss some of the ways that a computer virus can “hide”
from an anti-virus program.
cs431-cotter 19
Questions: Linux Review
• What command would be needed to print the last 250
characters of a file “data.txt”
• What function can a parent process use to capture the exit
code from a child process?
• In terms of Linux scheduling what is a runqueue?
• How does Linux use the Buddy algorithm to allocate memory
for a process?
• What information is kept in an open file description table that
isn’t kept anywhere else?
• What is the primary advantage of a journaling file system over
earlier file systems (such as ext2fs)?
cs431-cotter 20