CS 320 Home Page


<hr size=1 width="100%" align=center>

The syllabus, lab exercises, and other information are posted here.  These are links to Word documents which you should be able to download and print.

cs320syllabusfall2012.doc  Syllabus


Sun Java Tutorial

Java API Documentation

Main Page for Java Documentation


    Here are links to programs that have to do with chapter 4.  The first program is a more or less faithful copy of the book's C program illustrating the forking of children in Unix.  It compiles (with warnings about the use of the exit() call) and runs on the department's Unix machine.  The second program is a modification of the first with loops included.  It compiles and runs on the department's Unix machine and illustrates the switching back and forth between concurrent processes under multitasking.

oscprog.c

oscprogloop.c


    Below are links to question files and answer files. The question files are not assignments.  They consist of short answer questions on the chapters in the book.  These questions were taken from tests given in previous offerings of the class.  You may find it useful to read through them as part of studying for tests.  You are not supposed to hand in your answers and there are no points associated with these question sets.

cs320ch1questions.doc

cs320ch1answers.doc

cs320ch2questions.doc

cs320ch2answers.doc

cs320ch3questions.doc

cs320ch3answers.doc

cs320ch4questions.doc

cs320ch4answers.doc

cs320ch5questions.doc

cs320ch5answers.doc

cs320ch6questions.doc

cs320ch6answers.doc

cs320ch7questions.doc

cs320ch7answers.doc

cs320ch8questions.doc

cs320ch8answers.doc

cs320ch9questions.doc

cs320ch9answers.doc

Below are links to folders containing PowerPoint presentations for every chapter, along with associated material.  As can be seen, the MISC information needed to start the assignments is given between chapters 3 and 4.

Chapter1

Chapter2

Chapter3

cs320miscinfoV1powerpoint.pptx

cs320assignment1powerpoint.pptx

Chapter4

Chapter5

Chapter6

Chapter7

Chapter8

Chapter9



    All of the information below this point in the Web page has to do with programming assignments that you will get credit for if you do them and hand them in.


    miscinfojavaV1.doc  This is the main documentation file for the MISC machine simulation.  This simulation will be the basis for most of the programming assignments.

    miscinfojavaV1overheads.doc  This is a shorter documentation file for MISC.


    index.html  This is the entry point into the Web documentation for version 1 of the MISC simulation.  Notice that OsystemV1 is documented.

    The following give links to the MISC simulation version 1 source files.

    MachineByteV1.java

    MachineWordV1.java

    MachineV1.java

    OsystemV1.java

    MachineOSProgramV1.java

    MyTerminalIO.java

    sumtenV1.txt  This is a link to the machine language source code file that should run on version 1 of MISC.

    This is a link to the Web documentation for the MISC simulation.

This is the jar file which allows you to run the MISC simulation without seeing the source code:

    MachineOSProgramV1.jar


    File reading and writing in Java is a large topic.  You may have been exposed to some of it in your previous programming or other courses.  The Osystem, in addition to loading and running machine language program files, takes care of reading them as external files and dumping the machine contents into an external file.  The programs given below illustrate some of the techniques of file reading and writing that might be useful in writing the Osystem methods.

    ReadTemplate.java

    WriteTemplate.java

    You are not required to comment your code.  However, if you are interested in doing so and you're rusty on the technique for creating Web documentation for Java programs, the following program illustrates and explains how.

    CommentTemplate.java


    Here is a set of files provided by a student.  Since the student wrote this when working on assignment 2, the files are marked V3.  To make sure that there are no hidden inconsistencies between versions, the complete set of files is given.  The program PR is a program reader.  It reads a machine language program like sumtenV3.txt or sumtenbadV3.txt and produces an assembly language-like translation of it.  This might be a useful tool for you when trying to figure out what programs do.

    PR.jar

    PR.java

    ProgReader.java

    MachineWordV3.java

    MachineByteV3.java

    MyTerminalIO.java

    sumtenV3.txt

    sumtenbadV3.txt


    cs320assignment1.doc  This is assignment 1.  Your starting point for this assignment is the source code for Misc V1 given in the links above.  It is a little inconvenient, but even though this is assignment 1 your solution is version 2 of Misc.  Rename all the files and change the class names inside them with the naming convention V2 instead of V1.  sumtenV1.txt is the machine language source code file that should run on version 1 of MISC.  sumtenV2.txt is no different from sumtenV1.txt.  Links to both are given below.

    sumtenV1.txt

    sumtenV2.txt

 This is the jar file that illustrates how your solution should work:

MachineOSProgramV2.jar


    cs320assignment2.doc  This is assignment 2.  Your starting point for this assignment is your solution to assignment 1, Misc V2.  It is necessary to rename all the files and change the class names inside them with the naming convention V3 instead of V2.  sumtenV3.txt is no different from sumtenV2.txt.  However, sumtenV3bad.txt is something new.  Links to both are given below.

    sumtenV3.txt

    sumtenbadV3.txt

 This is the jar file that illustrates how your solution should work:

MachineOSProgramV3.jar


    cs320assignment3.doc  This is assignment 3.  In the assignment document I ask that you turn in your solution in one big Java file named TestConsoleThread.java.  hi.txt and bye.txt are input files which you can use to test your solution, and which I will use to test your solution.  Links to these files are given below.

    hi.txt

    bye.txt

 This is the jar file that illustrates how your solution should work:

TestConsoleThread.jar


    cs320assignment4.doc  This is assignment 4.  It is based on the code you've written in solving the previous assignments.  The assignment number now agrees with the version number of the code.  It is necessary to rename all the files and change the class names inside them with the naming convention V4.    The information given below may or may not be helpful to you.  If it's not, you can ignore it.

This is the jar file that illustrates how your solution should work:

MachineOSProgramV4.jar

    TraceFragments.java  This is not a complete program.  It is a collection of snippets of code taken from my solution that illustrate how the program can generate a trace file.  You are welcome to adapt this code for use in your program in case you need to do tracing in order to debug it.

    Here is an input file and some output files.  The input file only sums the first five integers instead of the first ten.  This gives enough output to analyze without giving so much that it's hard to wade through.  These files are given for your information.  You don't have to write code that produces a trace file, but you might want to in order to debug your program.  Any particular set of overlapping runs of the program might produce a different trace file.  The dmc files are representative of what I will be interested in seeing when doing black box testing of your program.  Even though these test runs are given with sumfive.txt, remember that your code will be tested using sumten.txt.

    sumfive.txt  This is the input file.

    sumfivedmc1.txt  This shows the contents of the machine's memory after successfully running a single copy of the program.

    sumfivetrace1.txt  This file contains a trace of the running of a single copy of the program.

    sumfivedmc2.txt  This shows the contents of the machine's memory after successfully running two copies of the program, where these two runs overlap.

    sumfivetrace2.txt  This file contains a trace of the running of the two copies of the program.

    sumfivemiddledmc2.txt  This file illustrates checking for whether the two copies are actually running at the same time.  This dmc found the first copy having reached a total of 10, while the second has reached a total of 1, both on their way to reaching 15.  This illustrates what is mentioned on the assignment sheet, about black box testing to make sure that two programs are really running concurrently and not sequentially.  Note the point on the assignment sheet that in order to be able to do this you will probably have to introduce a timing delay into the MachineOSProgram input loop.


The End.