CS 450 MPX Project

11
CS 450 MPX Project Introduction to MPX

description

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 ( P rocess C ontrol B lock) Queues to hold PCBs - PowerPoint PPT Presentation

Transcript of CS 450 MPX Project

Page 1: CS 450 MPX Project

CS 450MPX Project

Introduction to MPX

Page 2: CS 450 MPX Project

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

Page 3: CS 450 MPX Project

Programming Environment

Windows Operating System• Must have administrator access for Modules R5

and F

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.

Page 4: CS 450 MPX Project

User’s Manual

Purpose is to describe the functionality of your MPX project to potential users of your system- which would be persons sitting at the terminal and using your MPX system.

Users should be able to completely use your system by referencing the user’s manual.

Page 5: CS 450 MPX Project

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 blurb about each

Detailed description of each command• Syntax

• Use

• Example of use

• Possible errors/error messages

Index

Page 6: CS 450 MPX Project

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

Page 7: CS 450 MPX Project

Programmer’s Manual Outline Table of Contents Overview of MPX and Comhan

• Paragraph(s) about the system, including the principal elements such as command handler, interrupt handler, device driver, etc.

Summary of the contents of each file• List the functions/data structures and brief blurb 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

Page 8: CS 450 MPX Project

Code Comments You should use good commenting habits when you write your code, including

commenting specific portions of code- examples in the I1 manual. Use inline comments (//) rather than block comments (/*…*/), except for headers.

Reserve /*..*/ 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 (will be part of your final grade):

• File Header

• File Name

• Author Names

• Version/Last Modified Date

• Procedures/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

Page 9: CS 450 MPX Project

Support Software

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.

Page 10: CS 450 MPX Project

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

Page 11: CS 450 MPX Project

Tips (Con’t)

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, and cleanup() will reclaim any memory allocated by functions in that module. This will make starting and exiting your MPX system easier.