Assignment 2 (Replacement) Solution
- Write the full UNIX command that could be used to find the ID numbers of
all running processes.
How could you find information about running processes in Windows? [4]
- task manager (right click taskbar or press
Ctrl-Alt-Del) or System Information (Accessories, System Tools)
- Why are Windows NT-based operating systems generally more stable than
Windows 95-based operating systems? [2]
- Windows NT uses true multitasking; the kernel is
protected from applications; better memory management; not DOS-based
- What memory management technique eliminates external fragmentation?
Internal fragmentation? [2]
- When is garbage collection of main memory most important? [1]
- when memory is (nearly) full or when free space
is needed
- Memory accesses are much faster than disk accesses, but memory capacity is
much smaller than disk capacity.
Based on these two principles, what techniques do operating systems use [4]
- when memory space is too small for all scheduled processes? (two
techniques)
- paging and segmentation (swapping a process
to/from disk)
- to reduce the number of disk accesses? (two techniques)
- cacheing and reading/writing a block at a
time
- What is the advantage of using large pages? small pages? [2]
- Large pages reduces page table size
- Small pages reduces internal fragmentation
- What causes fragmentation? [2]
- deleting and adding files to the disk; holes
filled by different files so pieces of files are scattered and not
contiguous
- A 32-bit address is divided into a 14-bit segment number, an 8-bit page
number and a 10-bit displacement. [3]
- How many pages can a segment have?
- What is the page size?
- 210 bytes = 1024 bytes or 1 KB
- How many segments can be addressed?
- What methods would an operating system likely use to select a page table
entry to remove from a cache when it becomes full? [2]
- least recently used, least frequently used, or
longest in the cache
- What is one benefit and one cost of disk compression? [2]
- benefit: each file uses less disk space; more
information can be stored on the disk
- cost: reduced performance because of the extra
processing to compress and decompress during writes and reads
- cost: entire disk is more easily corrupted and
more difficult to recover
- What is the purpose of the Windows scandisk program? [2]
- detects and repairs disk errors and problems
such as deleting lost cluster chains or converting them to files
- A 4 GB hard disk has 0.5 KB per sector, 1,000,000 clusters,
2,000 cylinders and 8 double-sided platters.
Calculate the following numbers. Approximations are acceptable. [4]
- sectors
- 4 GB / 0.5 KB/sector = 8,000,000 sectors
- tracks
- 2000 cylinders x 16 heads = 32,000 tracks
- sectors per cluster
- 8,000,000 sectors / 1,000,000 clusters = 8
sectors/cluster
- sectors per track
- 8,000,000 sectors / 32,000 tracks = 250
sectors/track
- What are some important file types in Windows and UNIX,
and how can you determine what type of files are in the current directory in each system?
[6]
- Windows file types are displayed by extensions
- Windows file types include .exe=executable,
.com=command, .sys=system, .dll=library, .txt=text, .tmp=temporary
- UNIX file types are displayed using the ls -l
command
- UNIX file types include regular, special
(block/character devices), directories and executable files.
- Name the following directories in a UNIX system. [3]
- .
- ..
- /
- You have correctly installed a program on your computer,
and you want to run it by typing the program name at the MS-DOS command prompt,
but you receive an error message "bad command or filename". [3]
- What would you need to type to get the program to run from the DOS prompt?
- the full path name of the program
- How could you remove the need to do this if you want to run the program more than once?
- add the program's directory to the search path
(the PATH environmental variable)
- How could you run the program every time the computer starts?
- add the program to the autoexec.bat file or add
the directory to the search path and put a shortcut in the startup folder
- Compare the way Windows and UNIX allow you to add and access different disks. [4]
- Windows adds a new drive letter sequentially
e.g. D:, E:, F:, etc.
- To access a disk, include the drive letter in
the file path e.g. dir "d:\my documents"
- UNIX mounts a disk onto an existing folder
- The disk is accessed through the mount point or
the /dev directory
- Compare the way Windows and UNIX store and access pieces of files. [4]
- Windows uses a File Allocation Table which
contains chains of clusters which are allocated to files.
- UNIX uses inodes which contain pointers to data
and index blocks; the index blocks point to data or index blocks.