mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 16:23:11 +02:00
411 lines
9.6 KiB
HTML
411 lines
9.6 KiB
HTML
<html>
|
|
<head>
|
|
<title>MOSS | Memory Management Simlulator | Installation |
|
|
|
|
|
|
Unix
|
|
|
|
</title>
|
|
</head>
|
|
<body bgcolor="#ffffff">
|
|
|
|
<h1>MOSS Memory Management Simulator
|
|
|
|
|
|
<br>Installation on Unix/Linux/Solaris/HP-UX Systems</h1>
|
|
|
|
|
|
<h2>Purpose</h2>
|
|
|
|
<p>
|
|
This document provides instructions for the installation
|
|
of the MOSS Memory Management Simulator on
|
|
|
|
|
|
Unix
|
|
|
|
operating systems. This procedure should be the same or similar on
|
|
|
|
|
|
Unix, Linux, Solaris, HP-UX and other Unix-compatible
|
|
|
|
systems.
|
|
The MOSS software
|
|
is designed for use with
|
|
<a href="http://www.cs.vu.nl/~ast/">Andrew S. Tanenbaum</a>,
|
|
<a href="http://vig.prenhall.com/catalog/academic/product/1,4096,0130313580,00.html">Modern Operating Systems, 2nd Edition</a>
|
|
(<a href="http://www.prenhall.com/">Prentice Hall</a>, 2001).
|
|
The Memory Management Simulator was written by
|
|
<a href="http://www.cs.earlham.edu/~odo/">Alex Reeder</a>
|
|
(<a href="mailto:alexr@e-sa.org"><i>alexr@e-sa.org</i></a>).
|
|
This installation guide was written by
|
|
<a href="http://www.ontko.com/~rayo/">Ray Ontko</a>
|
|
(<a href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
|
|
|
<p>
|
|
This installation guide only provides information about
|
|
installing the software and testing the configuration for
|
|
|
|
Unix-like operating systems. To install on Windows
|
|
operating systems, please read the
|
|
<a href="install_windows.html">Installation Guide for Win95/98/Me/NT/2000 Systems</a>.
|
|
|
|
|
|
For more detailed information about the simulator, please
|
|
read the <a href="user_guide.html">User Guide</a>.
|
|
</p>
|
|
|
|
<h2>Requirements</h2>
|
|
|
|
The following software components are required
|
|
to install and use the MOSS Memory Management
|
|
Simulator.
|
|
<ul>
|
|
|
|
|
|
<li>X-windows environment for running Java Application Window Toolkit (AWT) programs
|
|
|
|
<li>Java Development Kit (JDK) 1.0 or greater
|
|
<li>Text program editor (e.g., notepad)
|
|
</ul>
|
|
|
|
<h2>Pre-Installation</h2>
|
|
<p>
|
|
Before installation, you should verify:
|
|
</p>
|
|
<ul>
|
|
<li>that you have a working java runtime environment,
|
|
<li>that you have a working java development environment, and
|
|
<li>that the working directory is in the classpath for the runtime environment.
|
|
</ul>
|
|
<p>
|
|
If you're using a standard command-line java compiler, the following
|
|
instructions will help determine if your environment is configured
|
|
correctly.
|
|
</p>
|
|
<ol>
|
|
<li>Verify that you have java installed and configured in your environment.
|
|
|
|
|
|
<blockquote><pre>
|
|
$ java -version
|
|
</pre></blockquote>
|
|
|
|
You should see a message like this with possibly a different version number.
|
|
<blockquote><pre>
|
|
java version "1.1.8"
|
|
</pre></blockquote>
|
|
If you get a message like:
|
|
|
|
|
|
<blockquote><pre>
|
|
java: Command not found.
|
|
</pre></blockquote>
|
|
|
|
Then java may not be installed on your system, or may not be configured
|
|
for your use.
|
|
<p>
|
|
If you think that Java may already be installed on your system
|
|
but may not be in your "path", you can find it by
|
|
|
|
|
|
<blockquote><pre>
|
|
$ find /usr -name java -print
|
|
</pre></blockquote>
|
|
On my system, for example, the following is returned.
|
|
<blockquote><pre>
|
|
/usr/lib/netscape/477/communicator/java
|
|
/usr/lib/netscape/477/netscape/java
|
|
/usr/lib/jdk1.1/bin/java
|
|
/usr/lib/jdk1.1/bin/ia32/green_threads/java
|
|
/usr/share/java
|
|
/usr/bin/java
|
|
/usr/src/kernel-source-2.2.17/include/config/binfmt/java
|
|
</pre></blockquote>
|
|
On my system, I also searched for "javac" and found
|
|
that it exists in /usr/bin/java. I'll use this jdk for my
|
|
installation.
|
|
|
|
<p>
|
|
If Java isn't available on your system, you should check with
|
|
your instructor or system administrator. If you administer your
|
|
own system, then you should be able to find a copy of Java
|
|
for your operating system.
|
|
<p>
|
|
If you find that java is installed but not configured for
|
|
your use, then perhaps you need to add it to your path. Consult
|
|
your instructor or system administrator if you need help adding this
|
|
to your path.
|
|
</p>
|
|
<p><!-- --></p>
|
|
|
|
<li>Verify that the java compiler is installed and configured in
|
|
your environment.
|
|
|
|
|
|
<blockquote><pre>
|
|
$ javac
|
|
</pre></blockquote>
|
|
|
|
If you're using a standard java command-line compiler, you should
|
|
see a message similar to this.
|
|
<blockquote><pre>
|
|
use: javac [-g][-O][-debug][-depend][-nowarn][-verbose][-classpath path][-nowrite][-deprecation][-d dir][-J<runtime flag>] file.java...
|
|
</pre></blockquote>
|
|
If you get a message like:
|
|
|
|
|
|
<blockquote><pre>
|
|
javac: Command not found.
|
|
</pre></blockquote>
|
|
|
|
then the java compiler may not be installed on your system, or
|
|
may not be configured for your use. Consult your instructor
|
|
or system administrator.
|
|
<p><!-- --></p>
|
|
|
|
<li>Verify that that the current directory is in your classpath.
|
|
|
|
|
|
<blockquote><pre>
|
|
$ echo $CLASSPATH
|
|
</pre></blockquote>
|
|
You should see a list of directories separated by colons (":")
|
|
or possibly just a blank line. If you don't see the directory
|
|
"." (a single period, which stands for the current directory), then
|
|
you should add it to the claspath.
|
|
<p>
|
|
Determine which shell you're using:
|
|
</p>
|
|
<blockquote><pre>
|
|
$ echo $SHELL
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
If you're using sh, ksh, or bash:
|
|
</p>
|
|
<blockquote><pre>
|
|
$ CLASSPATH=.:$CLASSPATH
|
|
$ export CLASSPATH
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
If you're using csh, or tcsh:
|
|
</p>
|
|
<blockquote><pre>
|
|
% set CLASSPATH=.:$CLASSPATH
|
|
</pre></blockquote>
|
|
|
|
<p><!-- --></p>
|
|
|
|
</ol>
|
|
<p>
|
|
If you have a working java runtime environment, a working java
|
|
compiler, and the current directory is in your path, then you're
|
|
ready to proceed with the installation.
|
|
</p>
|
|
|
|
|
|
<h2>Installation</h2>
|
|
|
|
Installation of the software can be accomplished with
|
|
these simple steps:
|
|
<ol>
|
|
<li>
|
|
|
|
|
|
Create a directory in which you wish to install the
|
|
simulator (e.g., "moss/memory").
|
|
<blockquote><pre>
|
|
$ cd
|
|
$ mkdir moss
|
|
$ cd moss
|
|
$ mkdir memory
|
|
$ cd memory
|
|
</pre></blockquote>
|
|
|
|
<p><!-- --></p>
|
|
|
|
<li>
|
|
|
|
|
|
Download the compressed tar archive (memory.tgz) into
|
|
the directory.
|
|
The latest release for this file can always be found at
|
|
<a href="http://www.ontko.com/moss/memory/memory.tgz">http://www.ontko.com/moss/memory/memory.tgz</a>.
|
|
|
|
<p><!-- --></p>
|
|
|
|
<li>
|
|
|
|
|
|
Expand the compressed tar archive.
|
|
<blockquote><pre>
|
|
$ tar -xzf memory.tgz
|
|
</pre></blockquote>
|
|
or
|
|
<blockquote><pre>
|
|
$ gunzip memory.tgz
|
|
$ tar xf memory.tar
|
|
</pre></blockquote>
|
|
|
|
<p><!-- --></p>
|
|
|
|
</ol>
|
|
|
|
<h2>Files</h2>
|
|
<p>
|
|
The directory should now contain the following files:
|
|
</p>
|
|
<table border="1" cellspacing="0">
|
|
<tr>
|
|
<th>Files
|
|
<th>Description
|
|
<tr>
|
|
<td>
|
|
|
|
|
|
memory.tgz
|
|
<td>Compressed tar
|
|
|
|
archive which contains all the other files.
|
|
<tr>
|
|
<td>Common.java
|
|
<br>ControlPanel.java
|
|
<br>Instruction.java
|
|
<br>Kernel.java
|
|
<br>MemoryManagement.java
|
|
<br>PageFault.java
|
|
<br>Page.java
|
|
<br>Virtual2Physical.java
|
|
<td valign="top">
|
|
Java source files (*.java)
|
|
<tr>
|
|
<td>Common.class
|
|
<br>ControlPanel.class
|
|
<br>Instruction.class
|
|
<br>Kernel.class
|
|
<br>MemoryManagement.class
|
|
<br>PageFault.class
|
|
<br>Page.class
|
|
<br>Virtual2Physical.class
|
|
<td valign="top">
|
|
Compiled Java class files (*.class)
|
|
<tr>
|
|
<td>commands
|
|
<td>Sample input command file
|
|
<tr>
|
|
<td>memory.conf
|
|
<td>Sample configuration file
|
|
<tr>
|
|
<td>install_unix.html
|
|
<br>install_windows.html
|
|
<br>user_guide.html
|
|
<br>user_guide_1.gif
|
|
<td valign="top">
|
|
Documentation and associated images
|
|
<tr>
|
|
<td>copying.txt</td>
|
|
<td>Gnu General Public License: Terms and Conditions
|
|
for Copying, Distribution, and Modification
|
|
</table>
|
|
|
|
<h2>Compilation</h2>
|
|
|
|
<p>
|
|
The distribution includes compiled class files as
|
|
well as the source java files. You should not need
|
|
to recompile unless you decide to change the code.
|
|
If you wish to compile the code,
|
|
the following commands should work if you're using
|
|
a Java compiler that accepts the normal "javac" command
|
|
line.
|
|
|
|
|
|
<blockquote><pre>
|
|
$ javac -nowarn *.java
|
|
</pre></blockquote>
|
|
|
|
|
|
The <tt>-nowarn</tt> flag supresses warning messges, of which
|
|
there may be several. For backward compatability we use only
|
|
those features of Java which have been present from the beginning,
|
|
some of which are deprecated and are usually reported by the
|
|
compiler with warning messages.
|
|
|
|
<h2>Test</h2>
|
|
|
|
<p>
|
|
To test the program, enter the following command line.
|
|
|
|
|
|
|
|
<blockquote><pre>
|
|
$ java MemoryManagement commands memory.conf
|
|
</pre></blockquote>
|
|
|
|
|
|
<p>
|
|
The program will display a window allowing you to run the
|
|
simulator.
|
|
When the window presents itself, click on the Run
|
|
button.
|
|
You should see the
|
|
program "execute" 7 memory operations, about one per second.
|
|
When the simulation completes, click the
|
|
Exit button.
|
|
<p>
|
|
The memory operation commands are read from a file called
|
|
"commands",
|
|
and the initial configuration and various options are
|
|
specified in the file "memory.conf".
|
|
The program also produces a log file called "tracefile"
|
|
in the working directory.
|
|
|
|
<p>
|
|
The "commands" file looks something like this:
|
|
<blockquote><pre>
|
|
// Enter READ/WRITE commands into this file
|
|
// READ <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
|
|
// WRITE <OPTIONAL number type: bin/hex/oct> <virtual memory address or random>
|
|
READ bin 100
|
|
READ 19
|
|
WRITE hex CC32
|
|
READ bin 10000000000000000
|
|
READ bin 10000000000000000
|
|
WRITE bin 11000000000000001
|
|
WRITE random
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
If things are working correctly, the "tracefile" should look
|
|
something like this:
|
|
|
|
<blockquote><pre>
|
|
READ 4 ... okay
|
|
READ 13 ... okay
|
|
WRITE 3acc32 ... okay
|
|
READ 10000000 ... okay
|
|
READ 10000000 ... okay
|
|
WRITE c0001000 ... page fault
|
|
WRITE 1ff82cdc ... okay
|
|
</pre></blockquote>
|
|
|
|
<p>
|
|
The program and its input and output files are described
|
|
more fully in the <i>MOSS Memory Management Simulator
|
|
<a href="user_guide.html">User Guide</a></i>.
|
|
<p>
|
|
© Copyright 2001, Prentice-Hall, Inc.
|
|
This program is free software; it is distributed under the
|
|
terms of the Gnu General Public License.
|
|
See <a href="copying.txt">copying.txt</a>,
|
|
included with this distribution.
|
|
<p>
|
|
Please send suggestions, corrections, and comments to
|
|
Ray Ontko (<A href="mailto:rayo@ontko.com"><i>rayo@ontko.com</i></a>).
|
|
<p>
|
|
<i>Last updated: July 28, 2001</i>
|
|
</body>
|
|
</html>
|