
Mini-Http Server For Technologic Systems Series
PC Compatible Single Board Computers

Introduction

This software was developed to demonstrate the capability of Technologic 
Systems (TS)
series of single board computers (SBC)

The HyperText Transport Protocol Daemon (HTTPD) server allows users to 
connect to the TS SBC utilizing either the Netscape Communicator/Navigator 
or the Microsoft Internet Explorer web browsers.  The provided pages allow
access to the onboard hardware as a demonstration of how hardware external
to a web server may be accessed.

The development environment

The development environment consists of the Borland C++ compiler with its
included make utility.  Create a working directory and unzip the supplied
file wat2001.zip, which
should create several directories as follows:
SRC  Contains the Wattcp C source files and makefile
ELIB Contains the Wattcp assembler source files and makefile
APPS Contains the Wattcp/NCSA applications such as ping.
LIB  Contains the TCP/IP Stack Library

Create your own working directory such as HTTP and copy the following files
into it:

       MAKEFILE        Makes the files into the executable
       BGHTTP.C        Main Http state machine
       BGHTTP.H        Main Http state machine definitions
       HTTP.H          Main http startup code definitions
       HTTPD.C H       Main http startup code definitions
       LEDCTRL.H       Definitions for the LED controls 
       WATTCP.CFG      The TCP configuration for Wattcp
       WHATAMI.H       Contains type definitions

In the main directory you have created perform the 'make' to create all of
the required Wattcp libraries.  In the HTTP directory perform a make to
create the server executable.

On the target machine (either the TS SBC or a generic PC running DOS) create
the following directory.  C:\WWW\ and copy the following files into it:
SERVER.HTM
DATA.HTM
INDEX.HTM
LED.HTM

Create a directory called IMAGES and copy the following file:
TSLOGO.GIF

Start the packet driver and then start the server by typing HTTPD.  Note that
typing HTTPD -? Or HTTPD /? Will display additional information.

Some design notes for those modifying the server

Even though the server is written in C the compiler is a C++ compiler.
Therefore many comments utilize the C++ // commenting convention

Some non-standard mechanisms were used to allow easy access to the hardware
without violating the HTML specification.

All outgoing text being read from an HTML file is processed via a function
named ProcessOutputString for special filename processing.  Whenever a
Special Filename is encountered internal IO functions are utilized to modify
the outgoing text string.  The Special Filename format is as follows: Iossuuii
where the following definitions apply:

Ss - 2 digit services identifier.  Used to indicate the generic function,
which will access hardware for output.  The value is stored in the global
variable: SsDigits

Uu - 2 digit unit identifier.  Used to identify a specific hardware base such
as one of a series of identical IO interface cards. .  The value is stored in
the Global variable: SsDigits

Ii - 2 digit index which indicates the data to be accessed. .  The value is
stored in the global variable: SsDigits

More details may be gleamed from the ProcessOutputString source code.

All incoming POST data is processed by the function ProcessPost.  The
"HTTP -d" debug options may be utilized for writing your own code to control
hardware.

Whenever a URL is entered to establish a connection to a server without
specifying a filename, the filename "index.htm" or "index.html" is accessed.
Changing the definition of DEFAULT_PAGE in the file http.h may change this
default filename.

The default file must also be assigned a root or starting directory.  In the
default case that directory is 'c:\www\'.  Changing the definition STARTIN
in the file http.h may change that default.

In order to develop code and test it on a generic DOS box, the server
starting software performs a test.  The global variable TsSbc is set to TRUE
if the code is running on a TS SBC.

One additional caveat concerning the server is that since it is an embedded
system there are some limitations.  Outgoing HTML data are prebuilt in a
variable named ''HoldBuf' which is a character array of 8192 characters.  If
any pages when expanded by the ProcessOutputString code will exceed this
value, you must modify this variable size accordingly.

Note also that the makefile allows both the large and small model
compilations for this server.  It also allows debug or non-debug modes. The
final version should be small model non-debug if it will compile and link
correctly.  The large mode costs about 20% code size expansion and the debug
mode even more.  The current release of the serve is approximately 115K in
debug mode and 39K in non-debug mode.


