/**
   * Nachos main entry point.
   *
   * @param args the command line arguments.
   */
  public static void main(final String[] args) {
    System.out.print("nachos 5.0j initializing...");

    Lib.assertTrue(Machine.args == null);
    Machine.args = args;

    processArgs();

    Config.load(configFileName);

    // get the current directory (.)
    baseDirectory = new File(new File("").getAbsolutePath());
    // get the nachos directory (./nachos)
    nachosDirectory = new File(baseDirectory, "nachos");

    String testDirectoryName = Config.getString("FileSystem.testDirectory");

    // get the test directory
    if (testDirectoryName != null) {
      testDirectory = new File(testDirectoryName);
    } else {
      // use ../test
      testDirectory = new File(baseDirectory.getParentFile(), "test");
    }

    securityManager = new NachosSecurityManager(testDirectory);
    privilege = securityManager.getPrivilege();

    privilege.machine = new MachinePrivilege();

    TCB.givePrivilege(privilege);
    privilege.stats = stats;

    securityManager.enable();
    createDevices();
    checkUserClasses();

    autoGrader = (AutoGrader) Lib.constructObject(autoGraderClassName);

    new TCB()
        .start(
            new Runnable() {
              public void run() {
                autoGrader.start(privilege);
              }
            });
  }
 /** Terminate Nachos. Same as <tt>TCB.die()</tt>. */
 public static void terminate() {
   TCB.die();
 }