Subject: RSTS/E CSR Access in MACRO

From: Christopher McNabb <[email-masked]>
Date: Mon Mar 10 19:27:00 2003

I've been attempting to do some macro programming of the DEQNA Ethernet
card under RSTS/E.  All of the system calls to actually send/receive
packetes seem to be very well documented and fairly easy to use.  What I
can't find in any of the manuals (or on the net) is a system call that
will return the card's MAC address.  

I know that the MAC address is the first six bytes of the CSR.  However,
I'm not sure how to go about accessing the device's CSR from within
RSTS/E.  Ideally, I'd use a subroutine that would return any network
card's MAC given its type (XH or XE) and unit number.

I know that I can't be the first person to have ever tried to do this,
so I'm turning to those who should know - you guys.  Any help would be
greatly appreciated.

-- 
Christopher L McNabb
Operating Systems Analyst         Email: [email-masked]
Virginia Tech                     ICBM:  37.1356N 80.4272N
GMRS: WPSR255                     ARS:   N2UX  Grid Sq: EM97SD

---

From: "John A. Dundas III" <[email-masked]>
Date: Tue Mar 11 18:23:00 2003

Well, nobody else is responding (publicly) so I'll take a stab at it.

>will return the card's MAC address.

I'm not aware of such a function either.

>I know that the MAC address is the first six bytes of the CSR.

Uh, I don't have my DEQNA manual in front of me at the moment, but are you
sure that's correct?  Usually the CSR implements bits that control the
module itself and provide status information.  The MAC address should be
readable (and writable too), but through some specific function code to the
device.  In any event, the correct sequence of commands can surely be
obtained from the manual.

>However,
>RSTS/E.

[I'll probably get flamed here, but I'll proceed anyway.  My experience is
primarily from RSTS V7 and prior.  While I did write system KBMs, run-time
libraries, etc.  However these were in user mode, not kernel mode.  Never
did get around to writing the virtual disk driver I wanted to.  DEC came
out with their own in V8 or V9.]

In order to talk directly to a device under RSTS you need to be in kernel
mode, not user mode.  I am not aware of a RSTS-native way to do something
like RSX or VMS connect-to-interrupt directives or the like.  Similarly
there is not a (published) way to map I/O space to user space.  This is
really the kind of thing you need to accomplish what you are asking.

>Ideally, I'd use a subroutine that would return any network

I imagine it could be done, but you'd have to do some kernel-mode hacking
to accomplish it.

>so I'm turning to those who should know - you guys.  Any help would be

Afraid that's the best I can offer.  You might check the various internals
manuals at <http://elvira.stacken.kth.se/rstsdoc/rsts-doc-v80/> and see if
that gives you any hints.  If you do figure it out, please post the results.

John

---

From: "John A. Dundas III" <[email-masked]>
Date: Wed Mar 12 17:25:00 2003

Following up to my own post...  I should have taken the easy approach.

>I'm not aware of such a function either.

The release notes for V9.3 indicate that the Ethernet interfaces are
available for DECnet use only.  There is no direct (general purpose)
interface.  Future releases are promised to have general support.

The release notes for V9.4 indicate that the promised general support was
added.  One should look at the RSTS/E Programming Manual for use under
Basic, the RSTS/E System Directives Manual for Macro.

See:

<http://elvira.stacken.kth.se/rstsdoc/rsts-doc-v97/v9.7-v6-a-aa-ez09a-tc-rsts-e-
programming-manual-v9.4.pdf>

Chapter 11 deals with Ethernet programming.  It indicates that a .SPEC call
documented in the System Directives manual is the way to go.  Unfortunately
the manual indicates that the .SPEC call is too complicated for Basic; use
Macro.  The correct revision System Directives manual is not available at
'elvira' (yet?).  However, if you could find the System Directives manual
for V9.4 or later, you should be able to do what you want with a .SPEC call.

John

---

From: Christopher McNabb <[email-masked]>
Date: Wed Mar 12 20:04:01 2003

> for V9.4 or later, you should be able to do what you want with a .SPEC call.

I do have the System Directives manual for RSTS/E 9.7.  While there are
various SPEC calls listed (including setting the mac address), there is
none listed for reading the default mac address.  I know that it is
possible from user space, since show dev xh: will give the mac address. 
Once I figure it out, I'll be sure to post the answer here.