Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This code is currently setting the schedule for an xv6 practice operating system and I was wondering how to modify this code from it's current

This code is currently setting the schedule for an xv6 practice operating system and I was wondering how to modify this code from it's current state, Round Robin, to MLFQ?

scheduler(void) { struct proc *p;

for(;;){ // Enable interrupts on this processor. sti();

// Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->state != RUNNABLE) continue;

// Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. proc = p; switchuvm(p); p->state = RUNNING; swtch(&cpu->scheduler, proc->context); switchkvm();

// Process is done running for now. // It should have changed its p->state before coming back. proc = 0; } release(&ptable.lock);

} }

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

Step: 3

blur-text-image

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago