Escolar Documentos
Profissional Documentos
Cultura Documentos
1
Due Date: April 8, 2003 at the end of the class
A late turn-in will not be accepted
3.2 What are the three major activities of an operating system in regard to memory
management?
Answer:
Keep track of which parts of memory are currently being used and by whom.
_
Decide which processes are to be loaded into memory when memory space becomes
_
available.
Allocate and deallocate memory space as needed.
_
Storage allocation.
_
Disk scheduling.
_
3.4 What are the five major activities of an operating system in regard to file
management?
Answer:
The creation and deletion of files
_
4) 3.6 (10%)
3.6 List five services provided by an operating system. Explain how each provides
convenience
to the users. Explain also in which cases it would be impossible for user-level
programs
to provide these services.
Answer:
Program execution. The operating system loads the contents (or sections) of a file
_
into memory and begins its execution. A user-level program could not be trusted to
properly allocate CPU time.
I/O operations. Disks, tapes, serial lines, and other devices must be communicated
_
with at a very low level. The user need only specify the device and the operation to
perform on it, while the system converts that request into device- or controller-
specific
commands. User-level programs cannot be trusted to only access devices they should
have access to and to only access them when they are otherwise unused.
File-system manipulation. There are many details in file creation, deletion,
_
allocation,
and naming that users should not have to perform. Blocks of disk space are used by
files and must be tracked. Deleting a file requires removing the name file information
and freeing the allocated blocks. Protections must also be checked to assure proper
file
access. User programs could neither ensure adherence to protection methods nor be
trusted to allocate only free blocks and deallocate blocks on file deletion.
Communications. Message passing between systems requires messages be turned
_
5) 3.11 (5%)
3.11 What is the main advantage of the layered approach to system design?
Answer: As in all cases of modular design, designing an operating system in a
modular
way has several advantages. The system is easier to debug and modify because
changes
affect only limited sections of the system rather than touching all sections of the
operating
system. Information is kept only where it is needed and is accessible only within a
defined
and restricted area, so any bugs affecting that data must be limited to a specific
module or
layer.
6) 2.2 (5%)
2.2 How does the distinction between monitor mode and usermode function as a
rudimentary
form of protection (security) system?
7) 2.4 (5%)
2.4 For what types of operations is DMA useful? Explain your answer.
Answer: DMA is useful for transferring large quantities of data between memory and
devices. It eliminates the need for the CPU to be involved in the transfer, allowing the
transfer to complete more quickly and the CPU to perform other tasks concurrently.
8) 2.5 (5%)
2.5 Which of the following instructions should be privileged?
a. Set value of timer.
b. Read the clock.
c. Clear memory.
d. Turn off interrupts.
e. Switch from user to monitor mode.
Answer: The following instructions should be privileged:
a. Set value of timer.
b. Clear memory.
c. Turn off interrupts.
d. Switch from user to monitor mode.
9) 2.6 (10%)
2.6 Some computer systems do not provide a privileged mode of operation in
hardware. Consider
whether it is possible to construct a secure operating system for these computers.
Give arguments both that it is and that it is not possible.
Answer: An operating system for a machine of this type would need to remain in
control
(or monitor mode) at all times. This could be accomplished by two methods:
a. Software interpretation of all user programs (like some BASIC, APL, and LISP
systems,
for example). The software interpreter would provide, in software, what the
hardware does not provide.
b. Require meant that all programs be written in high-level languages so that all
object
code is compiler-produced. The compiler would generate (either in-line or by
function calls) the protection checks that the hardware is missing.