/** * Start this autograder. Extract the <tt>-#</tt> arguments, call <tt>init()</tt>, load and * initialize the kernel, and call <tt>run()</tt>. * * @param privilege encapsulates privileged access to the Nachos machine. */ public void start(Privilege privilege) { Lib.assertTrue(this.privilege == null, "start() called multiple times"); this.privilege = privilege; String[] args = Machine.getCommandLineArguments(); extractArguments(args); System.out.print(" grader"); init(); System.out.print("\n"); kernel = (Kernel) Lib.constructObject(Config.getString("Kernel.kernel")); kernel.initialize(args); run(); }
/** * Allocate and return a new process of the correct class. The class name is specified by the * <tt>nachos.conf</tt> key <tt>Kernel.processClassName</tt>. * * @return a new process of the correct class. */ public static UserProcess newUserProcess() { return (UserProcess) Lib.constructObject(Machine.getProcessClassName()); }