Operating System -- The Final in a Can
Misc.
-
Which of these is normally part of the operating system kernel? Circle
all that apply
the device drivers
the command interpreter (e.g. command.com or /bin/bash)
the code implementing the filesystem
the code implementing the file manager
-
What's you favorite soft drink? __________________________________________
Processes
-
When a process would like to use the CPU but does not yet have the CPU,
what queue is it in?
-
A Wait queue
-
The Run Queue
-
The Busy Queue
-
The Process Control Block
-
The Ice Cube Tray
-
None or all of the above
-
__________ On a NMU laptop, how many processes can be in the Run Queue
at once?
Scheduling
-
Which of these scheduling algorithms would work well for a Real Time OS?
FCFS
Shortest Job Next
Round Robin
Priority
Round Robin with Aging
First Come First Server with Aging
-
Using shortest Job next, what is the "job" that the timing number refers
to?
-
How long the process will need the CPU before it calls exit()
-
How long the process will need the CPU before it calls fork()
-
How long the process will need the CPU before it calls sleep()
-
None of the above
-
(Yes/No) My new scheduling algorithm us called "random", and it picks a
random process to run. Is random with preemption subject to starvation
in theory?
File systems
-
Name a task that FAT32 is much better at than EXT2
-
You had both read and write caching, with average hit rates. Suppose
to save RAM you eliminate the file cache. GENERALLY SPEAKING
on a NORMAL COMPUTER, How would that effect file operations?
-
Read might be about twice as slow, write might be about twice as slow
-
Read might be mostly uneffected, write might be about twice as slow
-
Read might be LOTS slower, write might be uneffected
-
Read might be about twice as slow, write might be LOTS slower
-
Name one part of an EXT2 filesystem (e.g. block bitmap, group descriptor)
that you could not repair if the data were lost.
-
You have a FAT16 filesystem. You have a 3G hard drive. You
write a one byte file. How much space does it need?
-
__________ You have a filesystem just like EXT2, but each inode only
holds 12 pointers (10 direct, 1 indirect, and one doubly indirect).
The file system has 1K blocks, and each pointer takes 4 bytes.
What's the biggest file you can make on this filesystem.
Memory Management
-
_____________ On Tuesday, I was running seven copies of a program
that helps me plan Coke production. This program used 200K or
RAM for code, and 50K or RAM for data. The data was different
for every copy I ran. How much RAM do I need to run all seven programs
and avoid swapping or paging?
-
_____________ I have a program that uses 500K. I call fork().
Assume my operating system uses copy-on-write. At the instant that
the fork() is finished, how much RAM do I need to avoid swapping or
paging?
-
_____________ Assume int's are 4 bytes each. Assume that it takes
10ms to bring a page in from the disk, and that I only have 10M or
RAM available for the array 'pepsi'. I have lots of free disk space
for swapping and paging. Assume that the non-disk parts of the program
below take an insignificant amount of time. How long does the program
below take to run? Your answer should be in seconds.
main() {
int i, j, pepsi[10 * 1000 * 1000];
for(i = 0; i < 1000*1000; i++) {
j = random_from_one_to_ten_million();
pepsi[j] = 3;
}
}
-
_____________ Assume int's are 4 bytes each. Assume that it takes
10ms to bring a page in from the disk, and that I only have 10M or
RAM available for the array 'pepsi'. I have lots of free disk space
for swapping and paging. Assume that the non-disk parts of the program
below take an insignificant amount of time. How long does the program
below take to run? Your answer should be in seconds.
main() {
int i, j, pepsi[10 * 1000 * 1000];
j = 0;
for(i = 0; i < 1000*1000; i++) {
j = j + 10
pepsi[j] = 3;
}
}
-
Looking at a page table, what does it mean if the 'dirty bit' is
set?
-
______________ Each page is 1K. You have a 32 bit CPU with 256K total
RAM. The virtual address space for this process is 100K. Each
page table entry takes 20 bytes. How big is the page table for this
process?
-
I have a 32 bit CPU, with 256K total RAM. Each page table
entry is 17 bytes. A process would like to see 1M of virtual
memory. What happens?
-
It works
-
It works, but there might be some swapping.
-
It doesn't work. No one process can have more virtual address space than
the total amount of RAM on the system.
Device Drivers
-
Normally, when does the interrupt happen (pick ONE)?
-
When the I/O is started.
-
When the I/O is finished.
-
On error.
-
Which set of information might be given to the disk driver (pick ALL THAT APPLY)
-
The filename to open from the disk
-
The block number to retrieve from the disk
-
The memory location to store the data
-
What normally happens when you have in you OS a device driver, but that
device is not attached (pick ALL that apply)?
-
Wastes memory
-
Locks up the computer
-
Uses CPU cycles as the computers runs
-
None of the above
Disk Drives
-
What makes RAID-5 better than RAID-4?
-
Reads are faster
-
Writes are faster
-
It holds more
-
It's less prone to disk failure
-
(True/False) Among disk scheduling algorithms, shortest seek next is provably
optimal.
-
Among disk scheduling algorithms, I want fairness above all else.
What algorithm should I use?
-
_____________ You are going to launch an orbital probe to Venus, to see
if they drink Coke there. On the mission, the pointy headed people
think EACH disk has a 10% chance of failure, due to the vast clouds
of hot hydrogen sulfide and vaporous Sprite. You have a RAID-1 setup
with 4 disks. What are the odds the probe gets to Venus without having
lost any data?
-
Connect with lines
RAID-0
Holds the least data
RAID-1
Holds the most data
RAID-5
The Middle One
-
____________ You have a disk with 1000 sectors per track, 4 platters, 250
cylinders, and each sector holds 1K. The disk holds 1G. The
computer has 256M or RAM, on a 32 bit CPU using EXT2. When
you spill Squirt on the disk, how many sectors have you destroyed?
(How many sectors on the disk in total?)
-
You are Coke, inc. You have lots of account balances to update every
day. You cannot stand to loose data. You have lots of money.
Which RAID system would you use, and WHY?
-
_____________ You have two disks. The first is 1G, and the other
is 1.5G. Using RAID-1, how much can they hold?
Deadlocks
-
Process one wants the lock for the page table, and holds the lock for the
ready queue. Process three wants the lock for the serial port, and
has the lock for the page table. Process #217 holds the lock for
the USB port, and wants the lock for the page table. Process
four has the lock for the serial port, and wants the lock for the ready
queue. Unfortunately, process four is in an infinite loop, and is
unlucky to ever make forward progress again. Can process one ever
finish (without killing or taking locks)?
-
Which is true?
-
There are more integers than even numbers
-
There are the same number of even numbers and integers
-
There is a need for a Coke, and a smile.