1 / 7

Nachos Project Assignment 2 CPU scheduling

Nachos Project Assignment 2 CPU scheduling. If you still have trouble to install Nachos. https :// code.google.com/p/damody/downloads/detail?name=mips-decstation.linux-xgcc.gz. Part 1-System call. Implement a system call – Sleep() userprog / syscall.h Define a system call number of Sleep

Download Presentation

Nachos Project Assignment 2 CPU scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nachos Project Assignment 2CPU scheduling

  2. If you still have trouble to install Nachos • https://code.google.com/p/damody/downloads/detail?name=mips-decstation.linux-xgcc.gz

  3. Part 1-System call • Implement a system call – Sleep() • userprog/syscall.h • Define a system call number of Sleep • test/start.s • Prepare registers for Sleep • userprog/exception.cc • Add a new case for Sleep

  4. System call:start.s • Assembly language assist to make system calls to the Nachos kernel • http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html • Take System call Sleep as an example .globl Sleep .ent Sleep PrintInt: addiu $2,$0,SC_Sleep // put system call number in register 2 syscall /* all parameter of this system call will be stored in register4, 5, 6, and 7 by MIPS machine automatically. */ .end PrintInt

  5. Part 2-Non-preemptive shortest job first scheduler • Nachos default scheduler: Round Robin • Shortest job first • n+1 = tn + (1- )n • n time of the nth predicate CPU burst • tntime of the nth actual CPU burst • Design several test case to proof your result • E-mail your code and presentation files(report) to TA

  6. Begin Running Invoke Sleep(x) Per timer interrupt: 1.Record actual CPU burst 2.Wake up time up threads 1.Set next predicted CPU burst 2.Insert this thread to Sleeping thread lists 3.Invoke thread->Sleep Non-preemptive shortest job first scheduler • thread/alarm.cc, thread/alarm.h • Implement WaitUntil(int x) to handle sleep(int t) • Add a class to management the threads which are sleeping

  7. More details • http://puremonkey2010.blogspot.tw/2013/05/nachos-40-nachos-system-call.html

More Related