Assignment 2 Solution
- How many interrupt levels are available on Intel machines running DOS or
Windows? [1]
- DOS and Windows 9x System Information list 16
IRQs; Windows 2000 and XP list 24.
- What is the advantage of preemptive multitasking over non-preemptive
multitasking? [2]
- The operating system can preempt (suspend) a
non-cooperative process (which may be hung, is taking too long and not
voluntarily giving up the processor).
- How would you find and remove a hung process in Windows? In UNIX? [4]
- In Windows, press Ctrl-Alt-Del and possibly
click the Task Manager button. Select the hung process and click End
Task. You may have to click End Task again a short time later.
- In UNIX, type ps or ps -e to list the process
IDs of processes. To end the process, type kill PID or kill -9 PID.
- What are two reasons for defragmenting a disk? [2]
- A defragmented disk runs faster because
disk seek times are shorter and disk accesses are fewer.
- A defragmented disk lasts longer because
less head movement produces less wear on mechanical parts.
- Why are memory and disk blocks usually allocated in sizes of powers of
two? [2]
- Computers are binary digital devices which
perform calculations using binary arithmetic.
- Memory and disks are therefore physically
arranged to store information in sizes of powers of two.
- Addressing and calculation are made easier; e.g.
a memory address or disk location can be broken into two parts (block
address and location within a block).
- What is the main difference between segments and pages? [1]
- Pages have a fixed size, but segment size varies
according to individual process requirements.
- Give one advantage of paging over segmentation and one advantage of
segmentation over paging. [2]
- Paging reduces external fragmentation.
- Segmentation reduces internal fragmentation and
improves performance because of locality of reference.
- A 32-bit address is divided into a page number and a displacement which
produces a page size of 16 KB.
- How many pages could be referenced? [3]
- If the page size is 16 KB, it must take 14 bits,
since 214=16K. The remaining 18 bits are used for the page
number, so 218=256K pages could be referenced.
- How much space would the page table use if each entry is four bytes? [1]
- 256K pages x 4 bytes/page table entry = 1 MB
- Why do modular object-oriented programs run faster than monolithic
programs with GOTO statements? [2]
- locality of reference: All code and
procedures for the object are stored in the same general location on
disk, so the number of disk accesses is less than for a process that
jumps around in spaghetti code.
- What is the advantage of having a separate register to point to the page
table or segment table? [1]
- Access to any register is much faster than
accessing memory. The page table and segment table are both frequently
used, so quick access is important for overall virtual memory performance.
- What two characteristics of pages do page replacement policies use to
remove pages? [2]
- Total time the page has lived in memory
- Time since the page was last used
- In which hardware device would you normally find real memory? virtual
memory? [2]
- Real memory is found in memory banks such
as RAM SIMMs or DIMMs which are inserted into slots on the motherboard.
- Virtual memory is found in a page or swap file
which is usually stored on a hard disk.
- What is the advantage of direct memory access? [1]
- Direct memory access allows a hardware device to
access (read or write to) memory without requiring intervention by the
processor. This improves performance.
- Why do disks and tape transfer data in blocks of characters rather than a
single character at a time? [2]
- Each disk or tape access takes much longer than
reading each character, so it is more efficient to read several
characters at once, even if they are not all used.
- What is the purpose of a buffer? [2]
- A buffer is a temporary storage area in memory.
- A buffer decouples communication between readers
and writers in order to improve performance.
- The readers and writers can work independently,
operate at different speeds and use different chunks of data.
- For example the processor is faster than disks
and disks read and write in units of blocks.
- Which two system files make up the core of MS-DOS? [2]
- How do you refer to an I/O device in DOS? in UNIX? [2]
- DOS I/O devices often end with a colon, e.g. A:,
C:, CON:, COM1:, LPT1:, etc.
- UNIX devices are treated as files and are listed
in the /dev directory.
- Which file loads DOS device drivers? [1]
- The config.sys file will load listed device
drivers when the system starts.
- What steps do you need to take to install a new hardware device on a PC
running Windows? [5]
- Physically connect the device to the
computer. Internal devices should be installed into the computer case.
External devices should be plugged into one of the ports on the back of
the computer.
- You may have to switch off and on or restart the
computer, though not for some devices e.g. those connected to USB ports.
- Install device driver files and related
software. This can occur automatically using Plug and Play hardware or
through the Add New Hardware control panel.
- Configure the hardware and related
software. This can often be done using a control panel. For example, you
might need to set DMA, I/O and IRQ addresses if it is not done
automatically or there is a conflict.
- What is the capacity of a hard disk with 512 bytes per sector, 200 sectors
per track, 1000 cylinders and 4 double-sided platters? [2]
- 4 platters x 2 sides/platter x 1000 tracks/side
x 200 sectors/track x 512 bytes/sector = 800 MB
- What must be done to a new hard disk before installing two different
operating systems like Linux and Windows? [2]
- Partition the disk to divide it into two
or more partitions
- Format each of the partitions with a file
system that is compatible with the operating system
- When Windows is not shut down properly (e.g. if the power is cut), files
and file tables can be damaged.
What two programs can be used to repair the file system? [2]
- chkdsk is used by DOS, Windows 3.1 and
Windows NT/2000/XP.
- scandisk is used by Windows 9x.
- What is the purpose of a cache? [2]
- A cache is a small, fast memory area to
hold recently accessed data which speeds up later accesses to the same
data.
- What are two reasons that memory performance is much faster than disk
performance? [2]
- Memory is entirely electronic, whereas
disks have physically moving parts.
- Memory is uses random access whereas
disks are accessed sequentially.