public Processor(Privilege privilege, int numPhysPages) {
        System.out.print(" processor");

        // Sets the pagesize
        if(Config.getString("Processor.pageSize")!= null) {
            pageSize = Config.getInteger("Processor.pageSize");
        }
        else {
            // default pagesize
            pageSize = 0x400;
        }
        //System.out.println("PageSize = " + pageSize);
        
        maxPages = (int) (0x100000000L / pageSize);

        this.privilege = privilege;
        privilege.processor = new ProcessorPrivilege();

        Class clsKernel = Lib.loadClass(Config.getString("Kernel.kernel"));
        Class clsVMKernel = Lib.tryLoadClass("nachos.vm.VMKernel");

        usingTLB =
            (clsVMKernel != null && clsVMKernel.isAssignableFrom(clsKernel));
        
        this.numPhysPages = numPhysPages;

        for (int i=0; i<numUserRegisters; i++)
            registers[i] = 0;

        mainMemory = new byte[pageSize * numPhysPages];

        if (usingTLB) {
            translations = new TranslationEntry[tlbSize];
            for (int i=0; i<tlbSize; i++)
            translations[i] = new TranslationEntry();
        }
        else {
            translations = null;
        }
        

    }