how to install and run prepared by: shubhra kanti karmaker santu lecturer cse department buet

24
NACHOS IN JAVA How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

Upload: emory-clark

Post on 12-Jan-2016

238 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

NACHOS IN JAVAHow to Install and Run

Prepared by:Shubhra Kanti Karmaker

SantuLecturerCSE DepartmentBUET

Page 2: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

JAVA VERSION The Java version of Nachos only

supports Java 1.3.1 you can download Java 1.3.1

here: http://java.sun.com/j2se/1.3/download.html

Also available in the Repository (Nachos-java-contents.zip) provided to you

Page 3: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

GETTING NACHOS Download nachos-java.tar.gz from the

Projects section of University of California, Berkeley

It is available in the following link: http://www-inst.EECS.Berkeley.EDU/~cs162/

Also available in the Repository (Nachos-java-contents.zip) provided to you

Page 4: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

GNU MAKE The build process for Nachos relies on

GNU make Be sure you run gmake, as make does

not support all the features used If you are running Windows, you will

need to download and install a port.

Page 5: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

CYGWIN TOOLKIT The most popular is the Cygwin toolkit,

http://sources.redhat.com/cygwin/mirrors.html

The Cygnus package includes ports of most common GNU utilities to Windows.

Also available in the Repository (Nachos-java-contents.zip) provided to you

Page 6: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

MIPS SIMULATOR You will need a MIPS cross compiler,

which is a specially compiled GCC which will run on one architecture and produce files for the MIPS processor.

Cross-compilers for Linux and Win32 will be available from the CS162 Projects web page of University of California, Berkeley.

Also available in the Repository (Nachos-java-contents.zip) provided to you

Page 7: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

COMPILING NACHOS: Step 1: Install java 1.3.1 Step 2: Install the Cygwin toolkit Step 3: Install the MIPS Cross compiler Step 4: Do some preporcessing

Page 8: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL JAVA 1.3.1 In the Repository (Nachos-java-

contents.zip) provided, you will find j2sdk-1_3_1-win.exe

Double click and java will be installed If higher version of java is already

installed in your PC, please uninstall it before installing java 1.3.1.

For confirmation run CMD, type java and find something like shown in the next slide

Page 9: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET
Page 10: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT You can install Cygwin by double clicking

the Cygwin setup.exe available in the repository.

You can directly install from the internet or from a local repository(if available).

I have provided the local repository in a folder named cygwin packages.

Installation steps are shown in details in the following slides:

Page 11: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL FROM INTERNET

Page 12: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL FROM LOCAL DIRECTORY

Page 13: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT

Page 14: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT

Page 15: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT The make and make depend commands

are not installed by default. You have to manually select it. In the Select packages window, Go to

Development tag and select the make and make depend tool.

Page 16: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT

Page 17: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT

Page 18: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

INSTALL THE CYGWIN TOOLKIT After installation, you will get a Cygwin

Terminal Its feeling like Linux within Windows

Page 19: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS Copy the nachos folder to your cygwin

home directory To know the home directory, open the

cygwin terminal and type pwd See whether your cygwin recognizes the

java by typing java in cygwin terminal If not, then type

export PATH=$PATH:”/cygdrive/C/your java path here”

Now cygwin will recognize java

Page 20: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS You should now have a directory called

nachos, containing a Makefile, a README, and a number of subdirectories

You will need to link the gmake with make as mentioned earlier

You can do this by the following command:ln –s /bin/make /bin/gmake

Page 21: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS nachos is the command to run your

nachos projects At first you are to make cygwin

recognize the nachos command. You can do this by the following

command: export PATH=$PATH:”/home/santu/nachos/bin”

Of course you will not write santu, replace it with your home directory.

Now, Cygwin recognizes the nachos command

Page 22: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS To compile Nachos, go to the

subdirectory for the project you wish to compile (I will assume 'proj1/' for Project 1 in my examples), and run:

gmake This will compile those portions of

Nachos which are relevant to the project, and place the compiled .class files in the proj1/nachos directory.

Page 23: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS You can now test Nachos from the proj1/

directory with: nachos You should see output resembling the

following:

Page 24: How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET

RUNNING NACHOS We have succesfully compiled and run

nachos