CSE3303 (Operating Systems) MT1 - Group A
Nov 17, 2007

Q1 (5 pts): Which one below is false in regards to real-time systems (RTS)?
(a) An Anti-lock Braking System (ABS) is a hard RTS.
(b) A video codec is a soft RTS.
(c) An RTS has OS functions that guarantee timing.
(d) An embedded system is always also an RTS.
(e) A mission critical application basically requires an RTS design.

Q2 (5 pts): Which one of the below is correct about a RAMDISK?
(a) RAMDISK is an area in RAM that appears as a disk drive to user programs.
(b) RAMDISK is another name for RAM on hard disks.
(c) RAMDISK provides many times slower file access than a fast disk drive.
(d) RAMDISK is not available on Linux systems.
(e) RAMDISK is a feature of DVD disk drives that are turned on by the OS.

Q3 (5 pts): Which one of the following is false?
(a) VMware lets us run Linux exe in Windows while Cygwin lets us use Linux src code on Windows.
(b) VMware lets us run Windows exe on Linux.
(c) VMware lets us create a network of virtual PCs on a single PC.
(d) VMware can run Windows XP inside Windows XP.
(e) VMware can run mainframe programs on Linux PCs.

Q4 (5 pts): When a process is not currently executing, there are certain things that the operating system must maintain on behalf of the process, so that when the process starts executing again, it does so correctly. On the list below identify what does not need to be maintained?
(a) Memory range.
(b) Values of registers.
(c) Stack pointer.
(d) Context switch start time.
(e) Instruction pointer.

Q5 (5 pts): DMA means Direct Memory Access. What describes best those that access RAM directly?
(a) Cache
(b) CPU
(c) Hard disk
(d) Peripherals
(e) Graphics adapter

Q6 (5 pts): Which one is not always true in the case of a cooperative multitasking OS?
(a) Processes cannot be preempted.
(b) There is no timer interrupt.
(c) A process can be halted when writing to or reading from the console.
(d) Processes are cooperative so they often yield to each other.
(e) The kernel does not trigger regularly.

Q7 (5 pts): Which of the following is not a plus of using dynamic libraries as opposed to static libraries?
(a) Smaller executables
(b) Quicker run times
(c) Quicker compile times
(d) Quicker program load times
(e) They are all pluses

Q8 (5 pts): Which of the following is false?
(a) Intel's protected mode processors include a dual mode capability.
(b) Real mode is a backwards compatibility mode included in Intel's protected mode processors.
(c) Kernel mode is a subset of dual mode.
(d) Kernel mode is included in Intel's protected mode.
(e) A protected mode Intel processor is simply a dual mode CPU.

Q9 (6 pts): I have a bash script that does a useful job. How am I going to run it on Windows?

Q10 (6 pts): In a true multi-tasking OS, when does the CPU switch from a user program to the OS. Give me two different cases when this happens.

Q11 (6 pts): In the hierarchy of memory types, take DRAM as your reference point and tell me the type of memory that is (i) one level faster (ii) one level smaller (iii) one level slower.

Q12 (10 pts): I have a task that I do as follows in Windows cmd window.

  C:\mydir> progA > tempfile
  C:\mydir> progB < tempfile

When I just type progA, progA reads from the screen and writes to the screen and so is progB. How should I run these programs in a cmd window so they execute faster in total. Hint: RAM access is faster than HD access, and HD access is faster than screen access.

Q13 (15 pts): I want to write a code that executes fn1() first and then executes fn2(), fn3(), and fn4() in parallel. Write a code fragment that does this using fork().

Q14 (15 pts): I have 4 processes running on a quad-core CPU, namely, P1, P2, P3, P4. Each program reads a line from the screen and writes a line to the screen. They process 1 million lines of input in 20, 30, 40, and 50 mins, respectively. When I run them in a pipe (P1|P2|P3|P4) with 3 million lines of input to P1, (i) how long will it take to see output line #10 on the screen? (ii) and how long will it take for the pipe to finish processing all input lines? Hint: Try to turn this into a simple pipelining latency/throughput problem. Ignore the speed caused by not writing the output of P1, P2, and P3 to the screen.

Q15 (20 pts): We have a true multi-tasking OS on our computer. It has a tq of 3ms. No tq for I/O tasks. Ignore the context switching time. Assume we only have the following two processes running on the OS. P1 is started at t=0 and P2 at t=1ms. Give me the Gantt chart of how the OS schedules the two processes on the CPU and I/O as a table running vertically. Show also the CPUwait and I/Owait queues.

 
  P1: C2I4C4I2C4
  P2: C2I2C5I5C3