Fermé

write a program in Java that simulates the behavior of the multiprogramming operating system.

Available computer system for the simulation has:

Hardware:

The computer hardware is assumed to have:

1. A RAM of size 256MB, where 16MB is used to store the OS.

2. A single core CPU that executes one instruction each unit of time.

3. An I/O device for input and output operations.

4. An internal clock that allows to measure time in milliseconds.

Operating System:

The operating system is the multiprogramming OS. We would be interested in only two features in this simulation: The Job and CPU scheduling.

1. Job Scheduling: The system implements multiprogramming batch processing.

2. A long term scheduler selects jobs in sequence and allocates them the needed

memory until the 80% of the memory is full. A job is loaded only if there is enough

memory to satisfy its first memory requirement.

3. Each required memory block should be contiguous but a process may have more than

one block of memory in different locations of the memory

4. The short term scheduler will allocate processes to the CPU following a multi-level

feedback queue scheduling.

5. A process will have several CPU-burst / IO burst sequences at described in the

example below. In each CPU burst a process may require additional memory or

decide to free part of its memory.

6. If a process requires additional memory and there is not enough memory to satisfy its

request, it should be put in Waiting state until there is enough memory for it.

7. If all processes are in Waiting state, only if all waiting for memory allocation, this is a deadlock. The system should declare a deadlock and select the largest waiting process

to be killed in order to get some free memory for the other processes.

8. At any moment the processes will have one of the states, READY, WAITING, RUNNING, TERMINATED, KILLED.

9. When the job queue is empty and all processes are killed or terminated, the system should write a file containing statistics about all processes and their final status TERMINATED or KILLED.

10. Every 100 milliseconds, the long term scheduler will wake-up, check the memory and load more jobs until the 80% of the memory is full.

Instructions:

1. You MUST use multithreading where the long-term (Job) scheduler runs in one

thread while the short-term (CPU) scheduler runs in another thread.

2. Design the multi-level feedback queue however you see fit. Your design and

implementation should include:

a. Number of queues.

b. Scheduling algorithms for each queue.

c. Method used to determine when to upgrade a process.

d. Method used to determine when to demote a process.

Initialization phase:

You should perform the following steps before running the simulation:

1. Load all jobs in the jobs file into a jobs queue in memory

2. Start the system clock (in milliseconds)

3. Start the long term scheduler that check the first job in the job queue, check if there is

enough memory for it and then:

a. create a process for that job,

b. allocate its memory

c. put it in the Ready queue,

d. remove it from the jobs queue

4. Load the RAM with the maximum number of user programs, then go to sleep for 200ms.

5. Start the simulation run which consists of a simulation of the Machine Execution Cycle. At each millisecond, the scheduler will check if a job CPU-burst has ended

and if the I/O burst of a process has ended. It should also check if any waiting process can be reactivated and put in the ready queue.

Output from the simulation:

A text file containing statistics about all processes and their final status TERMINATED or KILLED. Statistics about a process should contain:

a. Process ID

b. Program name

c. When it was loaded into the ready queue.

d. Number of times it was in the CPU.

e. Total time spent in the CPU

f. Number of times it performed an IO.

g. Total time spent in performing IO

h. Number of times it was waiting for memory.

i. Time it terminated or was killed

j. Its final state: Killed or Terminated

k. CPU Utilization

l. Waiting time.

m. Turnaround time.

i will provide a sample text file

Compétences : Java

en voir plus : write program java graphical user interface, write program java deposit money, write program java tube, write program java calculate payment amount mortgage loans, write program java read text files randomly, write program java convert xml file sql database, write program java calculating mortgage payments, task write program java graphical user interface calculate display mortgage payment amount user input amount mortgage term mortg

Concernant l'employeur :
( 1 commentaire ) Riyadh, Saudi Arabia

Nº du projet : #19152723

5 freelance font une offre moyenne de $379 pour ce travail

NovaSofts

Hello Sir/ Ma’am We are a group of Software Engineers (Programmers) having 10+ years of experience. Expert in JAVA, C, C++ , C# , Python, ANDROID,IOS, MATLAB, IONIC. Done 600+ projects here on FREELANCER.COM Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(304 Commentaires)
7.4
usman1493

Hello Sir I can help you with your Simulation task I have good advanced expertise in Java This is an initial bid Feel free to message me Regards

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(155 Commentaires)
6.4
liveexperts123

Hi there, I have read your project description and i'm confident i can do this project for you perfectly.I still have a few questions. please leave a message on my chat so we can discuss the budget and deadline of the Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(15 Commentaires)
5.5
umg536

Hi there, I have read your project description and i'm confident i can do this project for you perfectly.I still have a few questions. please leave a message on my chat so we can discuss the budget and deadline of the Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(4 Commentaires)
4.4
bluesea1990

Hello. I'm software engineer. I'm Java perfecter. Your task is exactly my skill. Also I have C, C++, C#, Python, ObjectiveC, Java, SQL, Database Management, DataMining and so on Especially I'm algorithm expert. I' Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 20 jours
(1 Évaluation)
3.0