Plan 9 from Bell Labs’s /sys/src/pub/doc/netgear/ga620/12.3.21/openfw.README

Copyright © 2021 Plan 9 Foundation
Distributed under the MIT License.
Download the Plan 9 distribution.


Using Solaris
=============

Building the GNU tools
----------------------

Alteon provides the following tools in binary form, binutils (includes
gas and ld), gcc, and gdb.  Place all the tools from
./tools/sparc_solaris into /usr/local/alteon-tools/....  Alternatively
you can put these someplace else but then you'll have to play around
with some environment variables.

The source patches are also available in the openfw.tar file and you
can attempt to build these tools if you want to.  In this case make sure
you use --target=mips-any-elf.

NOTE: When building gcc libgcc will attempt to build which includes
a number of situations where mult and div instructions are generated.
Since our NIC has none of these instructions and the firmware doesn't
use libgcc you can ignore these errors.

Building the Alteon Networks tools
----------------------------------

You will need to build the genfw application.  This application takes
the ELF output from the firmware build (see below) and turns it into a
header file that the driver needs.  You will need either a native gcc
compiler or another Solaris C compiler to do this.  You will have to
modify the Makefiles if you use a compiler other than gcc.  Make sure
that the directory that you place the genfw executable is in your
PATH.

Currently these tools only build directly with version 2.6 of
binutils.  If you are using a later version (like 2.9.1) you will have
to modify CElf.c for endian problems.  These changes will be
incorporated into the tools at later date.

Building the firmware
---------------------

You will need GNU make installed.  If you don't use GNU make you may
have to modify the Makefiles.  Go to the host/nic/fw2 directory and
type make.  This will make three versions of the firmwater, a
production version (in common), a trace enabled version (in trace),
and a profile enabled version (in profile).

Make sure the TOOLS_BASE, EXPORTBASE, and SOURCEBASE variables are 
set correctly before attempting to build.

To build firmware that will be debugged you will need to make sure that
the code is not relocated to the scratchpad.  You can keep this from 
happening by changing the 

U32 scratch_pad_enable_code  = 1;

line to 

U32 scratch_pad_enable_code  = 0;

in fwmain.c under the #if defined(SCRATCH_PAD) paragraph.

If you use the included Solaris tools you'll need to remove the -APIC
option from the .c.o lines.

Building the driver
-------------------

You will need GNU make installed.  If you don't use GNU make you may
have to modify the Makefiles.  Go to the host/nic/host directory and
type make.  This will make a driver file called alt.


Installing the driver
---------------------

To install the driver you will need to copy it into /kernel/drv, add
it and ifconfig the interface.  We use the following commands for
this:

add_drv -m "* 0600 root root" -i '"pci12ae,1"' alt
ifconfig alt0 plumb
ifconfig alt0 <your ip address> up

Using NT
========

In order to do Alteon development on NT you will need to install a version
of the Cygnus development kit.  This can be obtained at ftp://go.cygnus.com.

Extract the files out of openfw.tar into a directory that you want to build
in.

Building the Cygnus Tools
-------------------------

Alteon provides the following tools in binary form, bfd, binutils
(includes gas and ld), gcc, and gdb.  Place all the tools from
./tools/i386_nt in a directory and mount this directory to
/alteon-tools.  Alternatively you can put these someplace else but
then you'll have to play around with some environment variables.

The source patches are also available in the openfw.tar file and you
can attempt to build these tools if you want to.  Supplementary notes
on this are below.

Building the Alteon Networks tools
----------------------------------

You will need to build the genfw application.  This application takes the
ELF output from the firmware build (see below) and turns it into a header
file that the driver needs.  You will need a native gcc compiler to do this.
Make sure that the directory that you place the genfw executable is in
your PATH.

Building the firmware
---------------------

Go to the host/nic/fw2 directory and type make.  This will make three versions
of the firmware, a production version (in common), a trace enabled version 
(in trace), and a profile enabled version (in profile).

Make sure the TOOLS_BASE, EXPORTBASE, and SOURCEBASE variables are 
set correctly before attempting to build.  Also make sure you set the right
tools in the alt.tg1.gnu file.

To build firmware that will be debugged you will need to make sure that
the code is not relocated to the scratchpad.  You can keep this from 
happening by changing the 

U32 scratch_pad_enable_code  = 1;

line to 

U32 scratch_pad_enable_code  = 0;

in fwmain.c under the #if defined(SCRATCH_PAD) paragraph.


Building the driver
-------------------

To set up for using the Windows 2000 DDK run the ntbuild5.bat file.

To set up for using the Windows NT 4.0 DDK run the ntbuild4.bat file
and modify the src/nic/host/common/alttypes.h (at approximately line
1522):
From

#define ALT_DESERIALIZE 1	/* NT uses deserialized sends */
#define USE_INTERNAL_QUEUE 1	/* NT deserialize can't use ndis queue */

To

#define ALT_DESERIALIZE 0	/* NT uses deserialized sends */
#define USE_INTERNAL_QUEUE 0	/* NT deserialize can't use ndis queue */

In order for your driver to support the gdb firmware debugger you will
have to change the line of alttypes.h (at approximately line 1521):

From 

#define NT_USE_DEBUGGER 0	/* may be using firmware debugger? */

To

#define NT_USE_DEBUGGER 1	/* may be using firmware debugger? */

The batch files above create a perl script (ntbuild.pl) that lets you
build the NT driver and the utilities.  Type 'ntbuild.pl -utils' to
build the driver and the utilities for NT 4.0.  Type 'ntbuild.pl -5
-utils' to build the driver and the utilities for Windows 2000 (NT
5.0).  For this driver to work on Windows 2000 (NT 5.0) you must have
at least beta 3, build 1936.  You will need at least Service Pack 4
for this driver to work with Windows NT 4.0.

Building the DLL
----------------

For a Windows NT 4.0 driver you will need to build a DLL in order to
install the driver.  To do this type 'ntbuild.pl -dll -nodriver'.

Installing the driver
---------------------

To install the driver on Windows NT 4.0 you will need to place the
oeminfo.inf file, the dll that was built, and the driver that was
built onto a floppy disk.  Then go through the usual mechanism of
adding an NT 4.0 network driver by opening the properties of the
"Network Neighborhood", clicking on the Adapters tab, and doing a
driver add.  Click on "Have Disk" and point to the floppy you created
with the three necessary files on it.  You will be prompted to reboot
as necessary.

To install the driver on Windows 2000 you will need to place the
netalt.inf file and the driver that was built onto a floppy disk.
Then go through the usual mechanism of adding a Windows 2000 driver by
opening the properties of "My Computer", clicking on the Hardware tab,
and opening the "Device Manager" dialog box.  You will probably find
the Alteon Networks NIC card either under the "Network Adapters" tab
(if you've previously loaded a driver for it) or under the "Other
Device" tab.  Open the properties for this device.  Click the 
"Driver" tab and click "Update Driver".  You may be prompted to 
reboot.

Obtaining more information
--------------------------

A mailing list of Alteon developers and interested third party developers
is supported by Alteon Networks.  To get on this list send an email
to majordomo@mailhost.alteon.com with the message body 
"subscribe openfw <your email address>"
To send a message to the list just send an email to openfw@alteon.com.

Supplementary information on building the Cygnus tools
------------------------------------------------------

To build the Cygnus Beta 18 files on NT you need to do the following (running
BASH).  N.B. You must already have the Cygnus Win32 environment built and
setup on your computer.  See http://sourceware.cygnus.com/cygwin for info
on how to get and install this.

1) get the cdk-src.tar.gz file from ftp://go.cygnus.com
2) gunzip cdk-src.tar.gz
3) tar xf cdk-src.tar (this step may cause a VERY large file to appear on
  your hard drive.  It's the extended attributes file. It also makes it 
  very slow to access data and can cause things not be found properly.  I
  got around this by doing the tar extraction on a Unix host and then moving
  the data to the NT host with Explorer.  Rumor has it that beta 19 has a
  fix for this, but I don't know what it is or if it works.)
4) cd cdk
5) patch  < .../export/sparc_solaris/patches/tigon_cygnus-b18.patch
6) Make sure . is in your path (printenv)
7) configure --target=mips-any-elf --prefix=/alteon-tools --srcdir=.
8) cd bfd
9) make all
10) cd ../libiberty
11) make all
12) cd ../opcodes
13) make all
14) cd ../byacc
15) make all
16) cd ../binutils
17) edit Makefile and replace the BISON= line with BISON=../byacc/byacc
18) make all
19) cd ../gas
20) edit Makefile and replace the BISON= line with BISON=../byacc/byacc
21) make all
22) cd ../ld
23) edit Makefile and replace the BISON= line with BISON=../byacc/byacc
24) make all
25) cd ../gcc
26) configure --target=mips-any-elf --prefix=/alteon-tools --host=i386-pc-cygwin32 --with-gnu-as --with-gnu-ld -v
27) mv as as.orig
28) make all CC=gcc
29) cd ../readline
30) make all
31) cd ../mmalloc
32) make all
33) cd ../gdb
34) edit Makefile and comment out SIM= and SIM_OBS= in mips specific area
35) make all


Release History
===============

12.3.15 - added asm.h to the list of files
12.3.14 - added recvasm.s and dmaasm.s to the list of files
12.3.9 - removed unnecessary htonl() from genfw.c and CElf.c, added genfw
	binary for Solaris, added errata appendix to the Tigon document.
12.3.8 - fixed genfw.c to not include baf.h and added missing binary files
12.3.7 - added missing files to the release
12.3.6 - fixed documentation problem
12.3.5 - Initial release

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@plan9.bell-labs.com.