19 Feb 2011

Case Study No. 6 in Operating Systems

Using the process state diagram, explain why there is no transition:

  • From the READY to WAITING.
  • From the WAITING to RUNNING.

In the process state diagram, there is no transition from READY state to WAITING state because when a job is ready to be executed, it is in the READY state and it will be in the RUNNING state once the job that precedes it is already done. However, when there is an I/O request page fault, then and only then will the job be put into queue (WAITING state). In other words, there will be no transition from READY to WAITING for two conditions: (1) if the job is not in RUNNING state; and (2) if there is an I/O request page fault that results in an interruption of the job. The interrupt will be handled by the Interrupt Handler.

When all interrupts have been taken care of, the job is then put into READY state. The job will continue when there will be a signal for the job to continue processing. The transition is from READY state à RUNNING state à WAITING state if there is an I/O request page fault, then back to READY state when the signal is given for the job to continue processing. The job will then continue until it is done (FINISHED state).

Also in the process state diagram, there is no transition from the WAITING state to the RUNNING state. That is because, as shown in the diagram, the job stays in the waiting queue until the signal to continue is given. Once it is ready to execute, and all interrupts have been solved, then the signal for the job to continue processing will be given and the job changes state from WAITING to READY. Once the said job is ready for execution, then it will be put into RUNNING state.

There is no transition from READY state to WAITING state and from WAITING to RUNNING state because the job has to undergo the processes and not just jump from one state to another. In other words, the job cannot skip states but must follow the process.


15 Feb 2011

Case Study no. 5 in Operating Systems

This is the fixed (pre-determined) partition of the memory:

Memory Block

Size

Block 1

50K

Block 2

200K

Block 3

70K

Block 4

115K

Block 5

15K

______________________________________________________________________________


A. Using best-fit allocation:

Memory Block

Size

Job 3

35K

Job 1

100K

Job 8

55K

Job 10

100K

Job 4

15K

Waiting List:

Job 2 – 10K

Job 5 – 23K

Job 6 – 6K

Job 7 – 25K

Job 9 – 88K

______________________________________________________________________________


Memory Block

Size

Job 3

35K

Job 1

100K

Job 8

55K

Job 10

100K

Job 2

10K

Waiting List:

Job 5 – 23K

Job 6 – 6K

Job 7 – 25K

Job 9 – 88K

______________________________________________________________________________


Memory Block

Size

Job 7

25K

Job 1

100K

---

---

Job 10

100K

Job 6

6K


Waiting List:

Job 5 – 23K

Job 9 – 88K

______________________________________________________________________________


Memory Block

Size

Job 5

23K

---

---

---

---

Job 9

88K

---

---

Waiting List:

No jobs remaining

______________________________________________________________________________

B. Using first-fit allocation:

Memory Block

Size

Job 3

35K

Job 10

100K

Job 8

55K

Job 1

115K

Job 4

15K

Waiting List:

Job 2 – 10K

Job 5 – 25K

Job 6 – 6K

Job 7 – 25K

Job 9 – 88K

______________________________________________________________________________


Memory Block

Size

Job 3

35K

Job 10

100K

Job 8

55K

Job 1

100K

Job 2

10K


Waiting List:

Job 5 – 25K

Job 6 – 6K

Job 7 – 25K

Job 9 – 88K

______________________________________________________________________________


Memory Block

Size

Job 5

25K

Job 10

100K

Job 7

25K

Job 1

100K

Job 6

6K


Waiting List:

Job 9 – 88K

______________________________________________________________________________

Memory Block

Size

Job 5

25K

---

---

---

---

Job 9

88K

---

---


Waiting List:

No jobs remaining

______________________________________________________________________________

C. Using worst-fit allocation method:

Memory Block

Size

Job 2

10K

Job 9

88K

Job 5

23K

Job 8

55K

Job 6

6K

Waiting List:

Job 1 – 100K

Job 3 – 35K

Job 4 – 15K

Job 7 – 25K

Job 10 – 100K

______________________________________________________________________________


Memory Block

Size

Job 3

35K

Job 9

88K

Job 5

23K

Job 8

55K

Job 4

15 K

Waiting List:

Job 1 – 100K

Job 7 – 25K

Job 10 – 100K

______________________________________________________________________________


Memory Block

Size

Job 3

35K

Job 9

88K

Job 7

25K

Job 1

100K

---

---

Waiting list:

Job 10 – 100K

___________________________________________________________________________


Memory Block

Size

---

---

Job 10

100K

---

---

Job 1

100K

---

---

Waiting List:

No jobs remaining