2) Which of the following CPU instructions or memory regions should
be privileged?
The program counter
The CPU registers
The interrupt controller
The disk controller registers
RAM
The MMU page table
Rik Smitts
Larry Bird
3) Using Round Robin scheduling, in a preemptive scheduler, on Tuesday
at 4:17 pm, for applications written in C++, with Dale Davis at the computer,
on a computer with a joystick, on an Intel 486, list three things that
must be done at context switch time.
____________________________________________________________
____________________________________________________________
____________________________________________________________
4) (2 points) Suppose that it takes 100 ns to access a location
in RAM assuming the translation is in the TLB (the MMU's cache).
Further, it takes 200 ns to load the TLB using a normal page table,
and 2000 ns to load the TLB using an inverted page table. The
TLB hit rate is 99.9%. How long does the average memory access
take using both methods?
Normal Page Table _______________
Inverted Page Table _____________
5) Do threads within a process share the same stack? _____________
6) My computer spends it's whole life doing long computationally
expensive jobs. It crunches numbers for the NBA central office.
I've got a seemingly endless supply of jobs to do, and I'd like to do every
reasonable thing I can to maximize the total number of jobs finished
per month. I need to make sure that every job gets seen to eventually,
though some can wait a long while if need be. What type of scheduler
should I use, and why?
7) (2 points) My operating system uses the one handed clock algorithm. The page table is shown below, and the 'hand' is about to examine the first entry. What page do I replace, and do I need to write it to disk? Finally, show the page table after the page has been replaced.
Page to replace __________ Write to Disk? _______________
Physical Page Number | 2 | 3 | 4 | 7 | 6 |
Dirty | Y | Y | N | N | Y |
Referenced | Y | Y | Y | N | N |
8) Suppose Jalen Rose wants to begin to execute a program.
The executable is 1000 KB, and was written in C (not C++). When
the O.S. first starts the program, how much does it bring in?
9) In my computer, programs are loaded into low memory, and the heap starts at the end of the loaded code. In this scheme, where should the stack start? Which direction (towards high or towards low) should the heap grow, and which way should the stack grow?
Stack start:
________________________________________
Stack direction
_____________________________________
Heap direction
______________________________________
10) Kobe Briant (a better player than any Pacer) wants to store and then access repeatedly a zillion small objects (12 bytes each). Which will cause fewer page faults, a 10M hash table accessed randomly, or a 10M array accessed linearly? He can only afford 5M of RAM.
11) Below is space for a File Allocation Table and a directory for a Windows FAT file system. Add the file config.sys, which needs three disk blocks to hold it. Make me a new FAT table, and a new directory showing how things are after the file has been added. For the FAT table, '0' means not in use, and 999 means end of file chain. The first disk block is numbered 1, not zero.
|
|
|
|
12) The Pacer central office has 10 disks, each holding 10G. Using RAID level 5, how much can the RAID system hold? _______________
13) The same Pacer central office has 10 disks. Each disk
is 10% likely to fail in a given year, and there is a 0.01% chance
that two disks fail in the same day. There is a one in a million
chance that three or more disks fail in the same day (meteor, terrorist,
etc.). It takes the water boy a day to get a disk installed,
formatted, and repopulated with data. What are the odds the Pacers
lose data using RAID-5. _________ What are the odds using RAID-1?
___________ What are the odds using RAID-0?
14) My computer has 4K byte pages. I have 1,000 memory allocations to do. My total RAM size is a gigabyte. Average memory allocation size is 100K, but allocations vary greatly in size. What amount of memory is wasted due to external fragmentation? _____________ What amount do to internal fragmentation? _____________ Does everything fit into the RAM available?
15) Why do we run disk defragmentors? What advantage do we get
doing so?
16) How long does the average open() system call take?
one millisecond
one microsecond
one second
17) The Pacers want to break into the Utah Jazz play book (their only
hope of winning the Eastern Conference). They notice that when they
run their break-the-cypher program the disk light is on continuously, and
my program is too darn slow. What can they do to speed their program?
Buy a faster CPU
Buy more RAM
Buy a faster ethernet card.
Hire Austin 3:15
18) What was the coolest, neatest, most interesting algorithm we
talked about in class?
19) Which takes longer, to open a file for reading, or to exec() the
same file? Why?
20) Which takes longer, to open a file for the first time,
or to open it for the second time? Why?
21) A disk has 10 tracks, 100 sectors, 2 platters, and 10 cylinders.
Each sector holds 1K. How much does the disk hold? (show units.
Don't say 512, say 512K or 512M or something.)
22) Which is generally faster, a hard drive or a CD-ROM?
23) I have a program that has 100K of executable code,
and needs 50K to store data. I want to run 10 copies of
this program on an operating system using virtual memory, like Linux or
Windows. I'd like everything to fit into RAM, with no swapping or
paging. How much RAM do I need?
24) Suppose I have two different programs (maybe an editor
and a compiler). I want to run both at the same time.
The operating system uses load time binding (like Linux or Windows).
The first program you know loads at VIRTUAL address 1000, and is 100,000
bytes long. At what virtual address do you think the second program
is likely to load, and why?
25) The Pacer Fan Club server uses round robin scheduling, like
in Linux or Windows NT. Their are 100 Pacer fans, and they all run
jobs at various times. There are generally many jobs running at any
one time. Reggie Miller wants to cheat and get twice as much CPU
time as my coworkers. Is running two programs in parallel likely
to get him about twice as much CPU total?
26) What part of the class did you find most valuable? What part could be skipped?