Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, using Eclipse and Java language, the operating system will create PCB, run processes, suspend processes. fetching and queuing, changing process state, etc.

In this assignment, using Eclipse and Java language, the operating system will create PCB, run processes, suspend processes.

fetching and queuing, changing process state, etc. You are expected to develop a dynamic console application that simulates processes and performs the following operations.

Other matters are as follows:

1. When the application runs, it should first read the file named "input.txt". There are two parts in the "input.txt" file.

In the first part, the applications section, there is information about the applications (application name, number of commands in the application, locations and types of I/O commands in the application).

In the second part, the events part, there are external events and the time of occurrence of the events.

The only external event is the run event. Run means to run a program. A sample file will be uploaded to the system along with the assignment. It is useful to create different files suitable for the format yourself and test your application. 2. A screenshot of a sample file is given below. There is a space between each value in the file. The line format of the applications section in the file is as follows:

application_name application_command_num I/O_command_type I/O_command_order

Example: A.exe 20 screen 8 ethernet 17 (In this example, the application named A.exe consists of 20 commands. The 8th command is the screen requesting, the 17th command is the ethernet request I/O commands. Similarly, other

If there are I/O commands, they are also written side by side. There may be applications that do not contain any I/O commands) The hardware response time to any I/O request is 3 seconds. During these 3 seconds, the relevant process must be in the corresponding waiting queue.

The line format of the events section in the file is as follows:

For the run event: run application_name time_of-occurrence (Example: run A.exe 1) In this example, the application named A.exe is run at 1 Second.

3. A PCB (Process Control Block) must be created for each run application. PCB following information

should include:

-

Process number (it is a positive integer and must be unique.)

-

Process state (one of 5 states)

-

Program counter value (which command of the application will be executed in the next step)

-

Account information (the amount of CPU used and the time elapsed since the creation of the process should be kept in seconds)

4. It will be assumed that 1 instruction is executed every second on the CPU (computer).

5. The time slice of each application (process) is 5 seconds. If the process is not finished within the time slice, it should be taken to the ready queue and the next process in the ready queue should be assigned to the CPU. (If in the ready queue

CPU should never be idle if there is at least 1 process.)

6. The operating system's own cost will be ignored. That is, it will be assumed that the operating system does not use the CPU at all.

7. The priorities of all processes will be considered the same.

8. There are 4 queues in total in the system. These are the ready queue, the display queue, the disk queue, and the ethernet queue. For the queue, you can use java's own ready-made Queue interface or a similar approach.

9. In accordance with the picture on page 8 of the Week 3 presentation of our lesson, the status of the process should be updated when an event occurs. When a process is terminated, the PCB for that process must also be deleted.

10. When your program runs, it will ask the user for the second he wants to see the status of the system. After the user enters the second, the program will output information about the state of the system at that second to the screen.

Then, your program will ask the user the name of the process whose PCB it wants to display in the relevant second and will output the PCB information of the process whose name is entered in the relevant second to the screen. (An example file content is given below. Your application should also produce output to the screen in the same format. Do not change the format and the order of the messages on the screen.

11. Consider the object-oriented programming technique while making your project. Therefore, a certain number and appropriately of classes and methods should be defined in your project

-

A.exe 10 screen 7 ethernet 9

B.com 8 disc 4 screen 6

calculate.exe 12

events:

run calculate.exe 1

runA.exe 3

run B.com 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial accounting

Authors: Walter T. Harrison, Charles T. Horngren, William Bill Thomas

8th Edition

9780135114933, 136108865, 978-0136108863

More Books

Students also viewed these General Management questions

Question

programming starts with

Answered: 1 week ago

Question

Bonus shares can be issued out of revenue reserves. True/False?

Answered: 1 week ago