Powered By Blogger

Linggo, Mayo 22, 2011

Case Study4


Process State Diagram
Using the process state diagram, explain why there is no transition:
• From the READY to WAITING.
• From the WAITING to RUNNING.



In a multitasking computer system, processes may occupy a variety of states. These distinct states may not actually be recognized as such by the operating system kernel, however they are a useful abstraction for the understanding of processes.
Carefully reconsider the simple process implementation scheme of the previous section from the point of view of the individual programs, or tasks, being executed in each process. Do they need to know about their execution context, or about their being repeatedly suspended and restarted by the OS? Of course not, as long as they can rely upon the OS providing them the resources they need. The OS needs context information to perform its job of allocating resources among tasks according to a certain policy, and the application programmers who write the tasks usually don't want (and sometimes must not be allowed) to care about that policy. Moreover, as long as the OS represents faithfully and completely the state of a suspended task in its context, that task can be restarted at any time without it taking notice of the past suspension.
A "ready" or "waiting" process has been loaded into main memory and is awaiting execution on a CPU (to be context switched onto the CPU by the dispatcher, or short-term scheduler). There may be many "ready" processes at any one point of the systems execution - for example, in a one processor system, only one process can be executing at any one time, and all other "concurrently executing" processes will be waiting for execution. Running is a process moves into the running state when it is chosen for execution. The process's instructions are executed by one of the CPUs (or cores) of the system. There is at most one running process per CPU or core.
In the ready state to waiting state, there is no transition between them because you can only send the job in the waiting state if it came from the running state. Also, it will proceed to the waiting state if there are some interrupts and if it needs input/output request. In the waiting state to running state, there is also no transition because the process scheduler selects processes from the ready state for the CPU. Also, all jobs in the waiting list was arranged and prepared to proceed in the ready state.  In addition, only the ready jobs or only the jobs in the ready state will proceed to the running state to be run and to bypass the ready state would make process management impossible.




Linggo, Mayo 15, 2011

Case Study3

Memory Allocation
Load the following jobs into memory using fixed partition following a certain memory allocation method (a. best-fit, b. first-fit, c. worst-fit).
Memory Block Size
Block 1 50K
Block 2 200K
Block 3 70K
Block 4 115K
Block 5 15K

a. Job1 (100k) f. Job6 (6k)
turnaround: 3 turnaround: 1
b. Job2 (10k) g. Job7 (25k)
turnaround: 1 turnaround: 1
c. Job3 (35k) h. Job8 (55k)
turnaround: 2 turnaround: 2
d. Job4 (15k) i. Job9 (88k)
turnaround: 1 turnaround: 3
e. Job5 (23k) j. Job10 (100k)
turnaround: 2 turnaround: 3
*turnaround – how long it will stay in the memory.




Linggo, Mayo 8, 2011

Case Study2


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?
As we all know multiprogramming is a technique that allows a single processor to process several programs residing simultaneously in main memory and interleaving their execution by overlapping Input/output request with Central Processing Unit (CPU) request. It attempts to increase Central Processing Unit (CPU) utilization by always having something for the Central Processing Unit (CPU) to execute. Time-sharing uses scheduling and multiprogramming to provide an economical interactive system of two or more users. The system switches among the programs for efficient processing and minimal idle time.  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. This is the various security problems that occur in a multiprogramming and time-sharing environment.
Stealing or copying a user's files; writing over another program's (belonging to another user or to the OS) area in memory; using system resources (CPU, disk space) without proper accounting; causing the printer to mix output by sending data while some other user's file is printing. In printer let’s state some situation that in internet cafĂ© a user is asking the attendant to print a file from her unit and there’s a student who accidentally press the “ok” button, so the file will print and it will interrupt the current file process. The expected output of the user is not what she wanted to be and it ruins the users output. The printer will mix the output because the student accidentally printed her own file. It is because they also share system resources, it will interrupt other current processing files.
A time-share machine is interactive and is used by many users and performs different functions or tasks while a dedicated machine's purpose is to serve one primary function or task. This means in dedicated machine, the scheme is not yet complicated. We cannot ensure the same degree of security because they are used in different ways and since human's security protection can be also hacked, braked, or damaged by others, it will be more difficult to for users to know the right usage and controls of the machines. Even a standard personal computer (PC) is a time-sharing system machine, because you can run many different programs on it at the same time, like anti viruses, browsing and many more. For example, an automobile which is a dedicated machine will have its own level of security because it's usage is dedicated exclusively to the navigation of the car which is not the same with the time-shared machines which can be accessed by others if and only if the authority or the main system implements a certain security for the protection of the files. Probably not, 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.