110 likes | 265 Views
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
E N D
CS 450MPX 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 • Paragraph summarizing the system • Summary of all commands • 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 • Paragraph(s) about the system, including the principle elements such as command handler, interrupt handler, device driver, etc. • Summary of the contents of each file • List the functions/data structures and a brief description about each • Description of each function • 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 • Use • Attributes – list including data types and brief description • Global variables – list including data types and description • Cross Reference • 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.