CSE-316 (OPERATING SYSTEM) HOMEWORK 1Submitted by-Tej prakashRM2801A2010803816Part A
1. In a multiprogramming and time sharing environment, several users share the system simultaneously. This situation can result in various security problems. a) What are two such problems? Ans- a. St e a l i n g or co p y i n g on e’ s pr o g r a m s or da t a ; us i n g sy s -te m re s o u r c e s ( CP U , m e m o r y , di s k sp a c e , pe r i p h e r a l s ) wi t h o u t pr o p e r ac -coun t i n g .. b) Can we ensure the same degree of security in a time shared machine as in a dedicated machine? Explain your answer. . Pr o b a b l y no t , si n c e an y pr o t e c t i o n sc h e m e de v i s e d by hu m a n sc a n in e v i t a b l y be br o k e n by a hu m a n , an d th e mo r e c o m p l e x th e sc h e m e , th e mo r e di f f i c u l t it is to fe e l c o n f i d e n t of it s co r r e c t im p l e m e n t a t i o n . 2. Under what circumstances would a user be better off using a time sharing system rather than a PC or single user workstation? Ans- When there are few other users, the task is large, and the hardware is fast, time-sharing makes sense. The full power of the system can be brought to bear on the user’s problem. The problem can be solved faster than on a personal computer. Another case occurs when lots of other users need resources at the same time. A personal computer is best when the job is small enough to be executed reasonably on it and when performance is sufﬁcient to execute the program to the user’s satisfaction
3. In the designing of the operating system there are two approaches modular kernel and layered approach? How are they different? The modularkernelapproach requiressubsystems to inter - actwitheach otherthrough careful y l constructedinter - faces thatare typica l narrow (in terms of the funct ly ion - ali thatisexposed to externalmodules). The layered ker ty - nelapproach issimi r thatrespect. However, the lay la in - ered kernelimposes a str t ic orderingof subsystems such thatsubsystems at the lowerlayersare not allowed to in - voke operationscorresponding to the upper-layersubsys - tems. There are no such restr c i inthe modular- ernel i t ons k approach, whereinmodules are freeto invoke each other withoutany constra ts. in Part B4. There is guest operating system and a host operating system like VMware? List all the factors in choosing the host operating system? Ans- Guest operatingsystem provides i serviceby ts mapping them intothe functional t provided by the host iy operatingsystem.a key issue thatneeds to be considered in choosing the hostoperatingsystem iswhetheritis suff c en l generalinterms of system cal inter ii ty l facein orderto be able to supportthe functional t associated iy withthe guestoperatingsystem.5- The kernel is responsible for a action with the processes. Search through the action of kernel and describe what is the action?
Ans- In general, the operating system must save the state of the currently running process and re- store the state of the process scheduled to be run next. Saving the state of a process typically in- cludes the values of all the CPU registers in addition to memory allocation. Con- text switches must also perform many architecture speciﬁc operations, including ﬂushing data and instruction caches. 6- Considering both the system level and the programmer level. Consider the advantage and disadvantage of the following structure. a-)Synchronous and asynchronous communication. A beneﬁt of sym- metric communication is that it allows a rendezvous between the senderand receiver. A disadvantage of a blocking send is that a rendezvous may not be required and themessage could be de- livered asynchronously; received at a point of no interest to the sender. As aresult, message-passing systems often provide both forms of synchronization b )Automatic and explicit buffering. Automatic buffering provides a queue with indeﬁnite length; thus ensuring the sender will never have to block while waiting to copy a message. There are no speciﬁcations how automatic buffering will be provided; one scheme may reserve sufﬁciently large memory where much of the memory is wasted. Explicit buffering speciﬁes how large the buffer is. In this situation, the sender may be blocked while waiting for available space in the queue. However, it is less likely memory will be wasted with explicit buffering. C ) Send by copy and send by reference Send by copy does not allow the receiver to alter the state of the parameter; send by reference does allow it. A beneﬁt of send by reference is that it allows the programmer to write a distributed version of a centralized application. Java’s RMI provides both, however passing a parameter by reference requires declaring the parameter as a remote object as well.
d ) Fixed-sized and variable-sized messages.The implications of this are mostly related to buffering issues; with ﬁxed-size mes- sages, abuffer with a speciﬁc size can hold a known number of messages. The number of variable-sized messages that can be held by such a buffer is unknown. Consider how Windows 2000handles this situation: with ﬁxed-sized messages (anything< 256 bytes), the messages arecopied from the address space of the sender to the address space of the receiving process.Larger mes- sages (i.e. variable-sized messages) use shared memory to pass the message