Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

 Nachos for Java README
Welcome to Nachos for Java. We believe that working in Java rather than
C++ will greatly simplify the development process by preventing bugs
arising from memory management errors, and improving debugging support.
* Additional software
Nachos requires the Java Devlopment Kit, version 1.5 or later. A
recent version of the JDK is already installed on the instructional
machines. If you are working at home, you will need to download the
JDK. It is available from:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Please DO NOT DOWNLOAD the JDK into your class account! Use the
preinstalled version instead.
The build process for Nachos relies on GNU make. If you are running on
one of the instructional machines, it is the default make in your
path. If you are running on Windows, you will need to download and
install a port. The most popular is the Cygwin toolkit, available at:
https://www.cygwin.com/
The Cygwin package includes ports of most common GNU utilities to
Windows.
For projects 2 and 3, you will need a MIPS cross compiler, which is a
specially compiled GCC which will run on one architecture (e.g. x86)
and produce files for the MIPS processor. These compilers are already
installed on the instructional machines, and are available in the
directory specified by the $ARCHDIR environment variable.
If you are working at home, you will need to get a cross-compiler for
yourself. The cross-compiler for Linux is available from the project
web page, along with instructions for installing it.
* Compiling Nachos
You should now have a directory called nachos, containing a Makefile,
this README, and a number of subdirectories. The "nachos" command invokes java to run Nachos. It is a script that
we have configured to already be in your path, and it is also
available in the "bin" directory.
To compile Nachos, go to the subdirectory for the project you wish to
compile (I will assume 'proj0/' for Project 0 in these examples), and
run make:
cd proj0
make
This will compile those portions of Nachos which are relevant to the
project, and place the compiled .class files in the proj0/nachos
directory. You can now test Nachos from the proj0/ directory with:
nachos
You should see output resembling the following:
nachos 5.0j initializing... config interrupt timer elevators user-check grader
*** thread 0 looped 0 times
*** thread 1 looped 0 times
*** thread 0 looped 1 times
*** thread 1 looped 1 times
*** thread 0 looped 2 times
*** thread 1 looped 2 times
*** thread 0 looped 3 times
*** thread 1 looped 3 times
*** thread 0 looped 4 times
*** thread 1 looped 4 times
Machine halting!
Ticks: total 24750, kernel 24750, user 0
Disk I/O: reads 0, writes 0
Console I/O: reads 0, writes 0
Paging: page faults 0, TLB misses 0
Network I/O: received 0, sent 0
This is the correct output for the "bare bones" Nachos, without any of
the features you will add during the projects.
If you are working on a project which runs user programs (projects 2-3), you will also need to compile the MIPS test programs with:
make test
* Command Line Arguments
For a summary of the command line arguments, run:
nachos -h
The commands are:
-d <debug flags>
Enable some debug flags, e.g. -d ti
-h
Print this help message.
-s <seed>
Specify the seed for the random number generator
-x <program>
Specify a program that UserKernel.run() should execute,
instead of the value of the configuration variable
Kernel.shellProgram
-z
print the copyright message
-- <grader class>
Specify an autograder class to use, instead of
nachos.ag.AutoGrader
-# <grader arguments>
Specify the argument string to pass to the autograder.
-[] <config file>
Specifiy a config file to use, instead of nachos.conf
Nachos offers the following debug flags:
c: COFF loader info i: HW interrupt controller info p: processor info m: disassembly M: more disassembly t: thread info a: process info (formerly "address space", hence a) To use multiple debug flags, clump them all together. For example, to
monitor coff info and process info, run:
nachos -d ac
* nachos.conf
When Nachos starts, it reads in nachos.conf from the current
directory. It contains a bunch of keys and values, in the simple
format "key = value" with one key/value pair per line. To change the
default scheduler, default shell program, to change the amount of
memory the simulator provides, or to reduce network reliability, modify
this file.
Machine.stubFileSystem:
Specifies whether the machine should provide a stub file system. A
stub file system just provides direct access to the test directory.
Since we're not doing the file system project, this should always
be true.
Machine.processor:
Specifies whether the machine should provide a MIPS processor. In
the first project, we only run kernel code, so this is false. In
the other projects it should be true.
Machine.console:
Specifies whether the machine should provide a console. Again, the
first project doesn't need it, but the rest of them do.
Machine.disk:
Specifies whether the machine should provide a simulated disk. No
file system project, so this should always be false.
ElevatorBank.allowElevatorGUI:
Normally true. When we grade, this will be false, to prevent
malicious students from running a GUI during grading.
NachosSecurityManager.fullySecure:
Normally false. When we grade, this will be true, to enable
additional security checks.
Kernel.kernel:
Specifies what kernel class to dynmically load. For proj1, this is
nachos.threads.ThreadedKernel. For proj2, this should be
nachos.userprog.UserKernel. For proj3, nachos.vm.VMKernel. For
proj4, nachos.network.NetKernel.
Processor.usingTLB:
Specifies whether the MIPS processor provides a page table
interface or a TLB interface. In page table mode (proj2), the
processor accesses an arbitrarily large kernel data structure to do
address translation. In TLB mode (proj3 and proj4), the processor
maintains a small TLB (4 entries).
Processor.numPhysPages:
The number of pages of physical memory. Each page is 1K. This is
normally 64, but we can lower it in proj3 to see whether projects
thrash or crash.
Documentation:
The JDK provides a command to create a set of HTML pages showing all
classes and methods in program. We will make these pages available on
the webpage, but you can create your own for your home machine by doing
the following (from the nachos/ directory):
mkdir ../doc
make doc
Troubleshooting:
If you receive an error about "class not found exception", it may be
because you have not set the CLASSPATH environment variable. Add the
following to your .cshrc:
setenv CLASSPATH .
or to your .bashrc:
export CLASSPATH=.
* Credits
Nachos was originally written by Wayne A. Christopher, Steven J.
Procter, and Thomas E. Anderson. It incorporates the SPIM simulator
written by John Ousterhout. Nachos was rewritten in Java by Daniel
Hettena.
This version of Nachos was borrowed from CS162 at Berkeley and
modified for use at UCSD.
* Copyright
Copyright (c) 1992-2001 The Regents of the University of California.
All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without written
agreement is hereby granted, provided that the above copyright notice
and the following two paragraphs appear in all copies of this
software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.

About

OS Nachos Implementation

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages