The Twinky Final
This test is all about an Operating System named TwinkyOS. This operating
system will be used to control several machines and sensors at a Twinkie
making factory.
-
The factory contains many hundreds of devices with requirements like "Must
get the correct command with 20 milliseconds or the currently assembled
box of twinkies will contain extra twinkies.", and a few machines that
say "Must receive the correct command with 40 ms. Failure to receive
the correct comand in the correct timeframe will result in destruction
of the machine's motor assembly."
-
The operating system must be hard real time
-
The operating system can be soft real time
-
The Twinky Assembly Machine (TAM) assembles boxes of twinkies. As
a twinky falls into the current box, the twinky blocks the path between
a laser and a light sensor. When the light sensor goes from on-off-on,
the computer should realize that a twinky has been added to the current
box. Would it be appropriate for the TAM device to use DMA?
-
Yes
-
No
-
Many devices are connected to the Twinky mainframe. These devices
generate interrupts to do I/O. Our mainframe requires that every
interrupt be given a priority number, such that higher numbered inturrupts
get acted on first. Luckily, the TwinkyOS designers have checked
things out, and it is possible to handle all inturrupts in the worst case,
if they are handled in the right order. Which device should have
the highest priority inturrupt?
-
Most important inturrupt
-
Device that needs the answer most quickly
-
Device that does the most byes/second of data
-
(3 points) The Twinky Box Sealing Machine (TBSM) is a very old machine.
It does not use interrupts to tell the mainframe when the box has been
sealed, and a new box may be sent. Instead, there is a memory location
that has the value "1" when the machine is ready for a new box, and "0"
when the machine is busy. TwinkyOS checks the memory location periodically,
and sends a box when the value is "1".
This is not called inturrupt driven IO. It's normally called ____________________________________________
List an advanatge of this technique over interrupt-driven I/O
List a disadvantage of this technique over interrupt-driven I/O
-
TwinkyOS is used on to run the Twinky.com web site. The computer
Twinky.com is attached to the Internet by an FDDI laser ring at 100
megaBYTES/second. The average packet size is 1000 bytes. How
many inturrupts per second must this machine take?
-
TwinkyOS uses a normal one-level paging scheme, with 32 bit addresses and
4K pages. If a process requests 17K of RAM, how many entries
in it's page table?
-
4
-
5
-
(2 ^ 32) / (4 * 1024)
-
2 ^ 32
-
What does it mean if the dirty bit is set. (Circle all that apply)
-
The page is not in RAM
-
The Twinky is to be rejected
-
The process does not have permission to write to that page
-
The page should be swapped out when you need to find free space.
-
None of these silly answers
-
TwinkyOS wants to use virtual memory and swap space so that it can run
programs that seem to use more memory that the mainframe really has.
The designers seem to have two choices on where to store their paged-out
ram.
They can store it on the hard drive. The hard drive can answer any
request in 10 ms, and has a bandwidth of 40 megabytes/second.
The Ethernet-Based-Storage-Device can answer any request in 1 ms, and has
a bandwidth of 10 megabyes/second.
The page size is 4K. Which device can answer requests faster?
(BTW, these are semi-realistic numbers)
-
A page must be pushed out to swapspace so that a new page can be brought
in. How should TwinkyOS decide which page to swap out? (You
must pick one. Pick the one that will perform the best among the
choices given.)
-
Keep a list of pages in the order they have been accessed by the CPU.
Toss the page at the end of the list (the oldest end).
-
Pick any page from the currently requesting process
-
Choose randomly
-
Suppose a normal process using TwinkyOS runs the following code.
Remember that TwinkyOS uses a one-level page table. Is the address
a virtual or physical address?
setToTwelve() {
char *wrapper = 0123456;
*wrapper = 12;
}
-
Suppose a DMA transfer is set up from a device in TwinkyOS to some
ram held by a process. The process will be put to sleep until the
transfer finishes. Is it OK to swap out the ram while waiting for
the inturrupt signalling the device is finished?
-
Yes
-
No
-
Twinkies.com is a web site running TwinkyOS. The goal of the designers
of TwinkyOS is to ensure that as many web requests get answered per
seond. Which scheduling algorithm would be best?
-
Round robin without aging
-
First Come First Serve with Aging
-
Shortest Job Next with premption
-
A Priority scheme where the priorities are set by username
-
Using the Twinkes.com mainframe, the hard drive can answer any querry in
10 ms. TwinkyOS uses EXT2. How many milliseconds would it take
to do a 'DIR /'? Assume that the 'dir' executable, the partition
table and the superblock is cached, but nothing else. The root dir
itself can fit onto one block.
-
Using the Twinkes.com mainframe, the hard drive can answer any querry in
10 ms. TwinkyOS uses VFAT. How many milliseconds would it take
to do a 'DIR \'? Assume that the 'dir' executable and the partition
table is cached, but nothing else. The root dir itself can fit onto
one block.
-
The Twinkies.com mainframe has a RAID array. The goal is to
set up this RAID array to handle any one disk failure without loss
of data. It is important that the RAID array be very fast at small
reads, but no one cares about write speed at all (It's a web server, after
all). We have 40M to store, 6 disks, and they hold 10M each.
Which RAID levels will work? Circle all that apply.
-
RAID 0
-
RAID 1
-
RAID 4
-
RAID 5
-
RAID 6
-
Twinkies.com uses the EXT2 file system. We have used every one of
the entries in our inode table. How? Pick all that apply.
-
We made too many files
-
We made several large files
-
We filled with disk with one huge file
-
We deleted and rewrote too many files
-
One can never run out of inodes.
-
My filesystem has 1000 files. Files come in all sizes, and the average
file is 23,000 bytes. My allocation unit is 4K (i.e. the VFAT cluster
is 4K, or the EXT2 blocksize is 4K.) How big should my disk be?
-
I've improved EXT2. The new filesystem, TwinkyFS, is just like EXT2
except that instead of 13 direct blocks, one indirect block, and 1 doubly
indirect block, I have 1 direct block, 1 indirect block, and 1 doubley
indirect block. My filesystem holds web pages, gifs, and MP3s.
It does not hold multi-gigabye databases. In what way will the performance
of TwinkyFS differ from EXT2?
-
I have a file cache of 10M. I have a 12M file, that I access
repeatidly in seuential order. I use LRU. How much will
my cache help?
-
10 / 12 of all blocks needed will be in the cache
-
2 / 12 of all blocks needed will be in the cache
-
2 / 10 blocks needed will be in the cache
-
The cache is worhtless in this situation
-
Comparing VFAT and EXT2, which would do better when accessing a file
in REVERSE order. Assume no cache.
-
Using TwinkyFS, I notice that it takes on average 10 disk blocks to
answer every read. Each disk read takes 10 ms. Luckily, my
disk cache can answer 1/2 of all the block requests I make.
How long does it take to answer the average read using TwinkyFS?
-
How long does the average open system call take?
-
One microsecond
-
One millisecond
-
One second
-
TwinkyOS will use priority scheduling without aging and without premption.
Which process is running at time slice #10? Low numbers are low priorities.
If a process arrives at time 7, it can run at time 7.
Job Priority
Arival Time Length
---------------------------
1
10
1
5
2
5
2
3
3
12
3
17
4
6
4
8
-
Oops. My mistake. TwinkyOS really uses shortest job
next with premption. WHat job is really running at time 10?