CS 450 MPX Project

advertisement
CS 450
MPX PROJECT
Introduction to MPX
INTRODUCTION TO MPX

The MPX module is divided into six modules
Module R1: User Interface
 Module R2: Process management framework





Control structure for processes (Process Control Block)
Queues to hold PCBs
Functions to create, destroy, and maintain PCBs
Module R3: Process scheduling


Dispatcher to run processes
Interrupt handler to process interrupts
Module R4: Dynamically loading MPX processes from files
 Module R5: Serial Communications Driver



Read and Write bytes to the serial (COM) port
Module F: Putting it all together

Continuous dispatch & I/O scheduling
PROGRAMMING ENVIRONMENT

Windows Operating System


Must have administrator access for Modules R5 and
F (R6)
C Programming Language

Any ANSI C Compiler will work, however use of
Turbo C version 1 or 3 is highly recommended. If you
do not use Turbo C, you will need to inject assembly
code into your project which will greatly increase
development and debugging time
USER MANUAL
Purpose is to describe the functionality of your
MPX project to potential users of your system
which would be individuals sitting at the
terminal and using your MPX system.
 Users should be able to completely use your
system by referencing the user’s manual.

USER’S MANUAL OUTLINE
Table of Contents
 Overview of Comhan/MPX



Summary of all commands


Paragraph summarizing the system
A list of all the commands and a short description
about each
Detailed description of each command
Syntax
 Use
 Example of Use
 Possible error(s) messages


Index
PROGRAMMER’S MANUAL
Should provide all information necessary for
programmers that have never seen your code
before to modify or enhance your code
 Describes the program structure and how your
program operates

PROGRAMMER’S MANUAL OUTLINE


Table of Contents
Overview of Comhan/MPX


Summary of the contents of each file



Use
Attributes – list including data types and brief description
Global variables – list including data types and description
Cross Reference


Prototype
Parameters – data type, description
Return value, including returns when an error is encountered
Description of what the function does
Description of all data structures



List the functions/data structures and a brief description about each
Description of each function





Paragraph(s) about the system, including the principle elements such
as command handler, interrupt handler, device driver, etc.
For each function, which functions does it call, and which functions
call it?
Index
CODE COMMENTS



You should use good commenting habits when you write
your code, including commenting specific portions of code –
examples in the L1 manual.
Use inline comments (//) rather than block comments
(/*…*/), except for headers. Reserve this for debugging. If
you try to comment out a section of code that contains a
block comment, C will terminate all block comments at the
first instance of */
At a minimum, you should have the following comments
(this will be part of your final grade):

File Header




File Name
Author Names
Version/Last Modified Date
Procedure/Data Type Header





Procedure Name
Parameters – name, type, and its purpose
Return value
List of procedures called and global variables accessed/modified
Description and purpose
SOFTWARE SUPPORT
Support software is available for use with your
project. This support software handles some low
level operations for you. You can download the
support software from Dr. Mooney’s website. It is
the MPX_SUPT.C and MPX_SUPT.H files.
 You should include MPX_SUPT.H in your source
files and put MPX_SUPT.C into your Turbo C
project so it gets linked with your other source
files.
 Many support functions return error codes, such
as ERR_SUP_DATINV. These are listed in the
MPX_SUPT.H file and in the manual for the
module in which each function is used.

TIPS




Plan ahead! Begin working on your modules right
away and plan on spending at least 3-5 days
debugging.
Develop an effective method of version control and
find a central repository for your code. Google Groups
and subversion have been used successfully in the
past. Keep track of who modified what in comments
and in a change log.
Create an “error handling” function that takes in an
integer error code as a parameter and prints out an
appropriate error message.
Use symbolic constants





For the size of ALL arrays
Anytime you use a number to represent something
Error Codes
Create a single .C and .H file for each module.
Pay attention to your use of pointers.
TIPS (CONT.)
Make sure you are null terminating strings
 Handle ALL possible errors
 Prioritize extra credit, but complete it
 For each module, create init() and cleanup()
functions. The init() function will perform
initialization of any global variables, data
structures, or devices used by that module. The
cleanup() will reclaim any memory allocated by
functions in that module. This will make starting
and exiting your MPX system easier.

Download