Вы находитесь на странице: 1из 3

Samrach Nouv

Homework 1
Student # 0738853
1.7 - How does the distinction between kernel mode and user mode function as a basic form
of protection?
The distinction between kernel mode and user mode protect operating system from
misbehaving users and misbehaving users from one another. Since some of machine
instructions may cause harm as privileged instructions. By restricting privileged instructions
to only be run in kernel mode, we are protected from the harm mentioned above.
1.8 - Which of the following instructions should be privileged?
a. set value of timer
c. clear memory
d. issue trap instruction
e. turn off interrupts
f. modify entries in device status table
g. switch from user to kernel mode
h. access I/O device
1.25
Name 2 reasons why caches are useful.
Temporal locality if data is requested again that has been requested
already.
Spatial locality if data is requested that is physically stored close to data
that has been requested alread.
What problems do they solve?
Speed up the access of repetitive data.
What problems do they cause?
Coherency problem. Once data exists in more than one place, we always
need to maintain the consistency of data.
If cache can be as large as the device we are caching, why not make it that large
and eliminate the device?
Cache is expensive. Caches are designed to be relatively small because they
are cost efficient and efficient lookup. Making cache as large as the device
violates the idea of cost efficient. Now that cache is as large as the device,
the lookup might not be as fast as a smaller cache anymore. Cache is built
on the exploitation of application's access pattern such as temporal locality
and spatial locality. Having large cache as the device does not the exploit
the reference patterns mentions above. Therefore, it is not efficient.
1.31 - What are tradeoffs inherent in hand-help computers?
Functionality VS. convenient and portability.
1.x.
What do you believe is the bottleneck resource on a modern single-user PC?
Generally disk is the bottleneck. However, there is exception for application
specific. For example, gaming even though we have a solid state drive, we
still cannot play the game if we do not have a graphic card that meets a
minimum specification of the game.
2.2 - What are the five major activities of the OS with regards to process management?
Creation and deletion of processes.
Suspension and resumption of processes.
A mechanism for process synchronization.
A mechanism for process communication.
A mechanism for deadlock handling or infinite loop.
2.6 - What system calls have to be executed by command interpreter or shell in order to
start new process?
Fork()
2.9 - List 5 services provided by OS, and explain how each creates convenience for user. In
which cases would it be impossible for user-level programs to provide these services?
explain.
User interface: Almost all operating systems have a user interface. User-level
programs cannot be trusted to provide this service because user-level program
would need to have access to privileged service to do it because it involve managing
many hardware components.
Program execution: the system must be able to load a program into memory and to
run that program. We cannot trust user-level programs to allocate CPU time.
I/O operation: A running program may require I/O, which may involve a file or an
I/O device. Again, we cannot trust user-programs to provide this service because
user-level programs have not idea if I/O is in use by other programs.
File-system manipulation: programs need to read and write files and directories.
They also need to create and delete them by name, search for a given file, and list
file information. User-level programs cannot be trust to allocate disk block because
the block might be taken or 2 program might try to occupy that same block at the
same time. It will be a mess.
Communication: There are many occasion that users want to communicate with one
another. This translates into message exchange between processes. It could be
process on the same host or different host. User-level programs can not be trusted
to provide this service because it involve deal directly with networking device. We
do not want programs to have any direct control over networking device.
2.13 - Describe 3 general methods for passing parameters to the OS
Storing parameters in registers
When number of registers is less than number of parameters, store parameters in a
block in memory and store the address of that block in a register.
Using stack, programs push parameters into the stack and OS pops parameters out
of the stack.
2.19 - Why is separation of mechanism and policy desirable?
Mechanisms determine how to do something; Policies determine what will be done.
Policies are likely to change. Without separation of mechanism and policy, changes in
policies will result in changes in mechanism. As a result, the system is not flexible. To
achieve a high level of flexibility, mechanism need to be insensitive to policy change.
Therefore, separation of mechanism and policy is desirable.
2.21
What is the main advantage of the microkernel approach?
Easy to extent because new service will be added to user space and do not
require kernel modification. Even when there is a need to modify kernel, it
will be fewer change since the mircokernel is a smaller kernel.
More secure because most of services are running as a user.
More reliable because when a service fails, the rest of the OS remain
untouched.
How do user programs and system services interact in the microkernel architecture?
User programs and system services interact using message passing. The
user programs never communicate directly with the system services.
Rather, they exchange message with the microkernel.
What are the disadvantages?
Microkernel can suffer performance decreases due overhead of interprocess
communication.

Вам также может понравиться