home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
network
/
pcb121.zip
/
COMPILE.DOC
< prev
next >
Wrap
Text File
|
1991-03-26
|
11KB
|
237 lines
Compiling New PCbridge code
The PCbridge distribution comes with precompiled versions of the code
for the most common bridge configurations. If your configuration is not
one of these common ones, or if you want to modify the code in some
special way, you will need to recompile it. This document describes how
to do this.
WHAT YOU WILL NEED.
The original source code was written using TURBO ASSEMBLER 1.0. I have
made no attempt to check if the code will assemble with other assemblers,
but you are welcome to try. Here I will assume that you have the TASM and
TLINK utilities that come with TURBO ASSEMBLER. In addition, the
compilation needs a FULL 640K of memory in order to compile. Thus you
need a PC with at least this much memory and you will probably have to
remove any TSR programs so that TURBO ASSEMBLER has as much space as possible.
CONFIGURING PCbridge.
In order to change the interface configuration of PCbridge it is only
necessary to change one file, BRIDGE.ASM. Near the top of this file
declaration section that contains a description of each card in the bridge
and it is this description that needs to be changed.
------------------------------------------------------------------------------
WD Ethernet Cards:
The easiest way to describe what is involved with configuring a WD ethernet
interface is simply to look at an example. Here is the declaration for
the first WD8013EBT card.
WDE_DECLARE %cur_if, 280H, 0D000H, 0H, 1, 64, 1 ;; promiscuous ,16K, 16bit
IF_DECLARE %cur_if, %cur_if, WDE
cur_if = cur_if + 1
The first line declares a WD800X card. The meaning of of the
parameters to the WDE_DECLARE statement is
Parameter
1 The name of the card. This never changes, it is always %cur_if
2 Is the I/O address of the card. This number is basically
arbitrary as long as it does not conflict with anything and
you set the DIP switches on the WD800X card to agree with
this number. In general I choose 280H for the first card
2A0H for the second card, 2C0H for the third card etc.
I recommend this pattern.
3,4 This is the address (segment, offset) of the shared memory.
It must be above 80000H (512K) and it can't conflict with
other device memory (like video memory). Most PCs have
a free region D0000H-DFFFFH and A0000H-AFFFFH, so I recommend
using these. To simplify configuration I give each WD800X
card a region that has a full 32K of memory even though the
WD80013EBT and the WD8003E will not use all of it. Thus I
reserve D0000H-D7FFFH for the first card, D8000H-DFFFFH for
the second A0000H-A7FFFFH for the third etc.
5 This flag, that indicates promiscuous mode, is always 1
for bridges.
6 This is the number of 256byte 'pages' of shared memory
on the card. WD8003E have 8K = 32 pages, WD8003EBT have
32K = 128 pages, and the WD8013EBT have 16K = 64 pages.
7 This flag, that indicates a 16 bit data path, is 1 for
the WD80013EBT card. Otherwise it is either 0 or blank.
The second line declares that the code for the WD800X implements a IF
software interface and that the names of the functions all begin with the
prefix 'WDE'. This line never changes.
Thus to configure Ethernet (or Starlan) cards, all you need do do is
have a set of three lines like the ones above with the proper parameters
to the WDE_DECLARE line. There are templates in the BRIDGE.ASM file that
have been commented out for various common cases. Simply modify the
template that is closest and comment it back in.
------------------------------------------------------------------------------
3Com 3c507 Ethernet Card:
The declaration for the 3c507 card looks like
C507_DECLARE %cur_if, 280H, 0D000H, 10000H, 1 ;; name,io,seg,len,prom
IF_DECLARE %cur_if, %cur_if, C507
cur_if = cur_if + 1
The first line declares a 3C507 card. The meaning of of the parameters to
the this statement is
Parameter
1 The name of the card. This never changes, it is always %cur_if
2 Is the I/O address of the card. This number is basically
arbitrary as long as it does not conflict with anything and
you configure the 33c507 card to to agree with this number.
In general I choose 280H for the first card 2A0H for the
second card, 2C0H for the third card etc. I recommend this
pattern.
3 This is the SEGMENT address of the shared memory. (Thus
the value D000H cooresponds to D0000H in the address space).
Most PCs have a free region D0000H-DFFFFH and C0000H-CFFFFH,
so I recommend using these. Note you should probably
check with using 'debug' that these regions are in fact
clear if you have any doubt. This value must agree with
the value set in the card.
4 The Length of the shared memory. The 3c507 has 64K of ram,
but can be configured to use less. This is only necessary
if you are using more than two 3c507 cards. In this case
there is not enough address space for all the memory on all
the cards. Thus you should probably change this number
to 32K (8000H), when this is the case. This value must
agree with the value set in the card
5 This flag, that indicates promiscuous mode, is always 1
for bridges.
The second line declares that the code for the 3C507 card implements a IF
software interface and that the names of the functions all begin with the
prefix 'C507'. This line never changes.
------------------------------------------------------------------------------
Serial Cards:
The declaration for a serial interface is more complicated. It looks
like this.
;; a serial card for a remote bridge
I8250_DECLARE %cur_if, SLIP, %cur_if, IBM_COM1_PORT, IBM_COM1_IRQ, 0
tmp = cur_if*100 ;; generate temp names
BUFF_DECLARE %(tmp+1), 3200 ;; the read buffer
QUEUE_DECLARE %(tmp+2), 5, %(size qif_entry) ;; the read queue
BUFF_DECLARE %(tmp+3), 10240 ;; the write buffer
QUEUE_DECLARE %(tmp+4), 16, %(size qif_entry) ;; the write queue
SLIP_DECLARE %cur_if,%cur_if,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4)
MY_SET_MTU %cur_if, 1518 ;; overide default MTU
Q_IF_DECLARE %cur_if,%(tmp+1),%(tmp+2),%(tmp+3),%(tmp+4),SLIP,%cur_if
IF_DECLARE %cur_if, %cur_if, Q
cur_if = cur_if + 1
Luckily, the ONLY line you will ever need to modify is the I8250_DECLARE
line and even on that line you will ever want to change parameters 4-6.
Lets look at these parameters more closely.
Parameter
4 This is the I/O address of the serial port. There is
an standard place for the first 4 serial ports on the
PC, and these have been given symbolic names of the
form IBM_COM<number>_PORT. Use these names if you can,
or a hexidecimal number if the port is in a non-standard
place.
5 This is the Interrupt line (IRQ) for the serial port.
There are standard interrupt lines for the first 2 serial
ports and these have been given names IBM_COM_<number>_IRQ.
Note that standard IRQ for COM1 is 4 and the standard
IRQ for COM2 is 3. Often other non-standard hardware will
use these interrupt lines, so be sure that they are free
before you use them.
interrupt line
6 This flag indicates if hardware flow control should be
used. If this flag is 1, then PCbridge will only send
out characters if the RS232 signal CTS (clear to send)
is asserted. PCbridge does not need flow control because
it can accept characters at the full baud rate, but
it is possible that you are connecting the PCs with modems
that can't handle the full baud rate all the time (compressing
modems for example). By enabling this flag, and setting
the modem properly, this feature will make sure PCbridge
sends characters only as fast as the modem can transmit them.
------------------------------------------------------------------------------
The Packet driver
It is possible to use PCbridge with ethernet cards other than the
Western Digital ones by using the packet driver. Unfortunately, this
relatively slow and since EVERY packet has to be examined, it is very
likely that many packet will be dropped. Nevertheless some people may
want to experiment with it, so here is the declaration.
PKT_DECLARE %cur_if, 60H, 01, 1 ;; <name> <Int num> <Class (Eth=1), prom
IF_DECLARE %cur_if, %cur_if, PKT
cur_if = cur_if + 1
The only parmeter that might change is the second one to PKT_DECLARE.
This parameter (in this case 60H) is the software interrupt used to
access the packet driver. For EACH packet driver interface there must
be a packet driver loaded that will respond to this interrupt.
=============================================================================
Compiling the software:
Once the BRIDGE.ASM file has been configured, compiling it could not
be easier. Simply type
TASM bridge
TLINK bridge
and a new version of the bridge code called bridge.exe will be produced.
=============================================================================
Debugging:
For those of you that are modifying the code and wish to print out
debugging statements this is possible. The file DEBUG.INC contains
routines for doing just that. The main routines are PRINT, PRINT_REG
and DUMP_in_SI_CX. PRINT simply prints a string. PRINT_REG prints
a string and the contents of any 16 bit register (in hex). DUMP_in_SI_CX
prints CX memory locations starting at SI using the named segment
register. All of these routines modify NO registers so they can be
used anywhere (except between a cmp and its jump instr).
Here is an example of how these macro look when they are called
print <Starting program>
print_reg <SI = >, SI
print_reg <CX = >, CX
print <Dumping at SI for CX bytes>
dump_in_SI_CX DS