Sunday, May 22, 2011

Case study 4


Using the process state diagram, explain why there is no transition: From the READY to WAITING and from the WAITING to RUNNING. 



 As I have observed in job handling, when we start any valid form of application programs, the High Level Scheduler of an Operating System loads entire or just a part of the code’s program from a secondary storage into memory. Then, it construct a structure of data in memory called a process control block that will be apply to hold information of the process, such as its current status and where in memory it is located. When a new process is created, it is given a unique process identification number and a new record is created for it in the process table which includes the address of the process control block in memory.
Dealing with the question “explain why there is no transition from the ready to waiting”, in the ready state of this diagram, only one job must be placed in the ready state at any one time after the job leaves the hold state. In the process state diagram, processes entering the system must be initialized into the ready state first before entering to other states. If a job or a process will enter the waiting state from ready state, it is impossible to have a job that has not yet entered the running state to have a moment of testing the job’s status if it has any interrupts or I/O requests that are needed to be in the waiting state. So therefore, any jobs that have entered the ready state must be initialized first in the running state. It has no transitions to be made if the job is from the ready state and goes to the waiting state. According to the rule, jobs that has I/O or interrupts must be placed in a waiting state before it goes back to the ready state.
On the other hand, the question “why there is no transition from waiting to running” can be answer according to these explanations. First of all, only one process or job can be in the running state at any one time.  The remaining processes will either be ready or blocked, and for each of these states there will be a queue of processes waiting for some event. The lines connecting the process state diagram represent possible transitions from one state to another. Processes entering the system must initially go into the ready state. A process can only enter the running state from the ready state. There would be no transition that would occur when any job transfers from waiting to running. 

Sunday, May 8, 2011

Case study 2

In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. Name at least two of these problems. Can we ensure the same degree of security in a time-share machine as we have in a dedicated machine? Explain your answer.

ANSWER:

Multiprogramming the process waited for servicing by another device, the CPU was idle. In an I/O intensive process, the CPU could be idle as much as 80% of the time. Advancements in operating systems led to computers that load several independent processes into memory and switch the CPU from one job to another when the first becomes blocked while waiting for servicing by another device. Multiprogramming accelerates the throughput of the system by efficiently using the CPU time. In order to use the multiprogramming concept, processes must be loaded into independent sections or memory. So, main memory is divided into fixed-sized or variable-sized partitions. Since a partition may not be large enough for the entire process, virtual memory is implemented to keep the processes executing. Time-sharing uses scheduling and multiprogramming to provide an economical interactive system of two or more users. The main advantage of using a time-sharing environment is that it interacts with the computer while the program is still running and will have a short response time which is usually less than ten seconds. But in these environments, several users share the system at the time. Time-sharing operating systems are more complex than multi-programmed operating systems Multiprogramming accelerates the throughput of the system by efficiently using the CPU time. In order to use the multiprogramming concept, processes must be loaded into independent sections or of memory. So, main memory is divided into fixed-sized or variable-sized partitions. Since a partition may not be large enough for the entire process, virtual memory is implemented to keep the processes executing. Time-sharing uses scheduling and multiprogramming to provide an economical interactive system of two or more users. The main advantage of using a time-sharing environment is that it interacts with the computer while the program is still running and will have a short response time which is usually less than ten seconds. But in these environments, several users share the system at the same time.

Time-sharing operating systems are more complex than multi-programmed operating systems. This is because in multi-programming several jobs must be kept simultaneously in memory, which requires some form of memory management and protection. Jobs may have to be swapped in and out of main memory to the secondary memory. To achieve this goal a technique called virtual memory is used; the primary objective of a multi-programmed operating system is to maximize the number of programs executed by a computer in a specified period and keep all the units of the computer simultaneously busy. A time shared operating system allows a number of users to simultaneously use a computer. The primary objective of a time shared operating system is to provide fast response to each user of the computer.

This situation can result in to various varieties of security problems .1) One user can copy another user's program / memory space. This could be very detrimental if, for example, an administrator was running a decryption protocol, and another user stole the decryption program and/or key. (2) Resource usage may not be completely controlled, and could cause deadlock for certain users. For example, if user A had resource 1 and was waiting for resource 2, and user B had resource 2 and was waiting for resource 1, deadlock would occur and neither user would be able to make progress in their program, no matter how many time slots they were allocated. Another example of these problems is that causing the printer to mix output by sending data while some other user's file is printing, using system resources like CPU, memory, disk space and peripherals.

Probably not, Time-shared machines are far less secure, and are very easy to overload the buffers; also they are much slower to catch a virus. Since any protection scheme devised by a human can also be broken and the more complex the scheme is, the more difficult it is to be confident of its correct implementation.