HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Programming dedicated LAT application ports on Itanium

 
twhjr
Advisor

Programming dedicated LAT application ports on Itanium

Greetings,

VMS 8.3-1h1 UPDATE 10

I have an application I am porting from an Alpha to Itanium that uses a dedicated LAT application port. My problem is that when I post my initial read to the port a 0x1c is returned in the status (IOSB is 0) which is EXQUOTA. I bumped all of my process quotas (AST, ENQ, TQE, BIO & BYTLM) until authorize told me that the numbers where too big… I have steped through the code with the debugger and monitored the process quotas and I cannot see any quotas being over utilized. It has been a long time since I programmed any LAT ports, it was on a VAX, so I am not sure if I am missing anything simple?

NOTE there is no actual terminal server on the Itanium development system, however, there is also no terminal server pointed to the Develoment Alpha and I do not get any errors. I also have another application that runs on the Alpaha and Itanium that only communcates with one LAT port so when it hangs a READVBLK it does a QIOW. The application that is having the problem is listening to four LAT ports and is supposed to hang 4 reads, one to each port, then hybernate and wait for the ASTs to fire.

$ lcp create service/identification="TAS Communications"/application/log TAS
$!
$ lcp create port /logical=(name=TAS_PORT'portNum', table=LNM$SYSTEM)/dedicated/log
$ lcp set port/service=TAS TAS_PORT'portNum'
$!
$ set term/perm/hostsync/nobroadcast/ttsync/eight_bit/hangup/type_ahead-
/edit_mode/line_editing/disconnect/insert/ansi_crt/autobaud/nodialup -
TAS_PORT'portNum'
$!
$ set security/protection=(s:rwlp,o:rwlp,g:rwlp,w:rwlp)/class=dev TAS_PORT'portNum'

LATCP> sho port
Port Name Port Type Status Remote Target (Node/Port/Service)
--------- ----------- ------------- -----------------------------------------
_LTA5089: Ded. (NonQ) Inactive //TAS
_LTA5092: Ded. (NonQ) Inactive //TAS
_LTA5095: Ded. (NonQ) Inactive //TAS
_LTA5098: Ded. (NonQ) Inactive //TAS
_LTA5101: Ded. (NonQ) Inactive //TAS
_LTA5104: Ded. (NonQ) Inactive //TAS
_LTA5107: Ded. (NonQ) Inactive //TAS
_LTA5110: Ded. (NonQ) Inactive //TAS
_LTA5113: Ded. (NonQ) Inactive //TAS
_LTA5116: Ded. (NonQ) Inactive //TAS
_LTA5119: Ded. (NonQ) Inactive //TAS
_LTA5122: Ded. (NonQ) Inactive //TAS
_LTA5125: Ded. (NonQ) Inactive //TAS
_LTA5128: Ded. (NonQ) Inactive //TAS
_LTA5131: Ded. (NonQ) Inactive //TAS
_LTA5134: Ded. (NonQ) Inactive //TAS


//
// Assign communication channels for modem port names to DEV channels.
//
status = sys$alloc(&portName_desc[index], 0, 0, 0, 0);
if((status & 1) || (status == SS$_DEVALRALLOC)) {
status = sys$assign(&portName_desc[index], &DEV_chan[index], 0, 0);
if(status & 1) {
//
// Enable CTRL+Y and CTRL+C ASTs on DEV devices.
//
CTRLindex = index + LINE_BREAK;
status = sys$qiow(EFN$C_ENF, DEV_chan[index],
IO$_SETMODE|IO$M_CTRLYAST,
&DEViosb[index], 0, 0,
Hangup_Handler, CTRLindex,
0, 0, 0, 0);

if(status == SS$_NORMAL) {
//
// Post first read AST on DEV device.
//
DEVinfo[index].prompt_index = 0;
Port_Status[index] = 1;

strncpy(DEV_buf[index], "\0", DEF_IN_BUF_SIZE);
strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);

status = sys$qio(EFN$C_ENF, DEV_chan[index],
IO$_READVBLK|IO$M_NOECHO,
&DEViosb[index],
Port_Connection, index,
DEV_buf[index], DEF_IN_BUF_SIZE,
0, 0, 0, 0);

if(status != SS$_NORMAL) {
As one skilled in the art it should be obvious...
23 REPLIES
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

OK, folks here is some more interesting tid bitsâ ¦ If I use set host/lat to get to my port I get the following:

ENG641> set host/lat/node=eng642/dest=tas_port01 tas
%LAT-F-CONFAIL, connection to TAS not established
-LAT-F-LRJINUSE, port or service in use
-LAT-I-END, control returned to node ENG641

I can, however, connect to the repair port and run the application that is hanging on a QIOW:

ENG641> set host/lat/node=eng642/dest=repare_port01 repair
%LAT-S-CONNECTED, session to REPAIR on node ENG642 established
%LAT-I-TODISCON, type ^\ to disconnect the session
Enter your name (ex. John Doe) --> fred
Enter your business name (ex. All Mechanics) --> freds repair

Now I just have to figure out what is using the ports for TAS.

Have Fun,
twhjr
As one skilled in the art it should be obvious...
John Gillings
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

twhgr,

First comment. LAT is dead. You'd be much better off reimplementing whatever you're doing using a current protocol.

Second, did this ever work? I don't believe it should have. LAT application ports are primarily OUTBOUND. That is, one external physical serial device, like a modem or printer services multiple back end nodes any of which can INITIATE a connection to the device and communicate with it. The key here is the host establishes the connection to the LAT device.

In your example above, there is no initiation. Your LCP commands create the device, association, and network path, but your code just opens the device and attempts to read, without first establishing the actual connection.

Consider. Suppose there were several nodes which execute your code at the same time, all sitting waiting for input. Now, a character arrives at the LAT device. How does it know where to send it if none of the nodes have established a connection? There's no way for the LAT device to know who, if anyone, is listening.

A "supported" application would explicitly issue $QIOs to the LAT port to establish the a connection before attempting to read. (I say "supported" in quotes, because nothing to do with LAT has had any serious level of support for at least a decade).

Sometimes you can get away with an initial WRITE operation to the LAT device. This may implicitly establish a connection, but technically, it's not supported, and it assumes the LAT device will tolerate unsolicited output.

I don't know why you're getting the x1c status, but until you've got a workable program model, it's not really relevant.

Again, I stress that writing LAT code today is like storing your programs on punched cards. Please investigate more appropriate mechanisms.
A crucible of informative mistakes
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

MY god man can't you read... This has been working on the alphas for over a decade and it still works. Many years ago this was a very common practice.

It is a customer requirement and I have less than a week to make this interface work.

If you have no constructive answers please do not take up any more of my bandwidth...

Have Fun,
twhjr
As one skilled in the art it should be obvious...
John Gillings
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

twhjr,

This IS constructive comment...

If this code worked, it was a fluke. If you don't explicitly establish a LAT connection from your application, there are no guarantees that it will work as you expect.

You're reporting that the code doesn't work, and I'm explaining to you why not.

Moving code from one platform to another will often expose latent errors or invalid assumptions in your code. Sorry if you don't like that answer, but if you want to make it work, you'll need to correct your code.

See Chapter 5 of the I/O Users Reference Manual, in particular Section 5.3.4 LAT Port Driver QIO Interface.

If you can't find a $QIO with function code IO$_TTY_PORT!IO$M_LT_CONNECT somewhere, then your code is wrong. There are a few other calls you need to make as well. See the IOURM for full details.

You MAY be able to get around the problem by issuing a WRITE operation on your port before your READ. This MAY implicitly establish the connection. It MIGHT be a quick and dirty fix for your immediate problem, but long term you should fix your code.

I worked in the Digital/Compaq/HP Customer Support Centre for many, many years. I've seen this symptom many times, and had the discussion about how to communicate with LAT application ports with dozens of programmers. The answer is always the same. Conform with the way LAT was designed to work, and your code will work. Try to take shortcuts and it MIGHT work, but it might not. Don't complain if it breaks. Fix your code.

>Many years ago this was a very common practice.

Perhaps so, but that doesn't make it correct, nor does it make it work. Think about what I said. Take N nodes, each of which posts an outstanding READ to a LAT port mapped to the same physical device. How does the device know where to send data? From the perspective of the host there's only one destination, but from the LAT device there are potentially many. You need to resolve that by explicitly establishing a connection from a host to the LAT device.

latin motto #2 of customer support:

Insunt interdum menda in eo quod est efficax

translated

There are sometimes flaws in that which is efficacious

in other words

just because it (seems to) work, doesn't mean it's correct
A crucible of informative mistakes
Craig A Berry
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

This is a really odd construct:

strncpy(DEV_buf[index], "\0", DEF_IN_BUF_SIZE);
strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);

If you're trying to null terminate ASCIZ strings, this may kinda sorta work but definitely looks like it was written by someone unfamiliar with C. If the intent is to zero-fill the buffers (which would make more sense in this context) then the code as written isn't doing that. Compare the docs for strncpy and memset and use the latter.

Just because the code has been working for over a decade doesn't mean it's correct nor that latent bugs in the code aren't the immediate source of the problem.
Bob Blunt
Respected Contributor

Re: Programming dedicated LAT application ports on Itanium

twhjr, while I can't question the code you're writing or attempting to use there are still situations where LAT should work as long as your environment supports it. There have been other facilities that have proven to need work after the port to Integrity. When I had access to a small rx26xx server in our office lab I had tested all the older networking giblets and had successfully run that system as a DECnet Phase IV system with LAT and TCP/IP. I only toyed around with some $ SET HOST/LAT around the lab and it seemed to work.

At the same time I was using the CA version of Console Manager on Alpha to manage the consoles but an Integrity solution wasn't available yet. So I wasn't able to test a product that could be configured with LAT connections to terminal servers to validate that part of LAT. Personally? I'd look around for some simple examples of creating and connecting LAT ports from what were the DECUS libraries in the hope that you can find something that works on Alpha and is simple enough to get it working on Integrity.

Like I said, I can't check your application code to say how well it'll work but I would hope that you could find some examples that can help you. And if the problem continues to generate the errors you're seeing I'd definitely take it to HP. I don't remember LAT becoming unsupported BUT I also don't know how well those features got tested if at all. Some basic stuff worked for me but thats a far cry from what you're trying to do.

bob
Robert Gezelter
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

twjhr,

I would want to take a careful look at the code. It is not uncommon for latent bugs to be unearthed during a port. I have programmed LAT from the host side quite a few times, and admittedly the error returns can be cryptic.

One thing I would also check are the LAT node settings on both systems.

My apologies for terseness, but I have to get ready to give a presentation later.

- Bob Gezelter, http://www.rlgsc.com
Craig A Berry
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

I said:

<<<<<
strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);

If you're trying to null terminate ASCIZ strings, this may kinda sorta work.
>>>>>

Actually, it won't. strncpy copies the source string up to but *not including* the null terminator. So these calls do precisely nothing because the source strings have nothing in them but a null terminator. May or may not have anything to do with your problem, but code that clearly doesn't do what it was intended to raises a red flag.
Hoff
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

Old code is quite often buggy, and the older the code, the more and weirder the bugs, and usually buggy in some creative ways, and old code seldom includes decent embedded diagnostics and embedded debugging support. VAX code? Usually buggy. Ported code? Buggy. Working code? Yep; buggy.

(Some of the older C lurking around is also built with /STANDARD=VAXC, and seemingly as a way to suppress all the nasty little coding errors that the newer compilers are finding in the code, but that's another discussion.)

I can't tell if that code here is correctly using the IOSBs. Errant IOSB processing can cause EXQUOTA errors.

C code such as this is seldom auspicious:

>if(status != SS$_NORMAL) { ...

That's quite often the footprint of a broken status check. (It should be the $VMS_STATUS_SUCCESS macro or a low-bit test, as there can be more than one successful return status value from various of the system calls.)

This C code:

>strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);

Definitely broken. Was memset intended there?

Is it possible that the $qio is getting (unintentionally) called multiple times; if the synchronization is broken, then a run-away loop is feasible and can trigger weird EXQUOTA errors. Depending on how you've used the debugger here (and how this code is structured) it might not be the first $qio call that tosses the error.

You'll want to test with a real terminal server, too.

Check the MAXBUF system parameter on both the old and the new boxes. The default needs to be bigger than DEF_IN_BUF_SIZE and DEF_OUT_BUF_SIZE here.

And VMS application code almost always stinks at error logging, too. No ties into syslog or other tools commonly used for centralized logging.

The usual suspects for hosed serial communications are:

MIN_TTY_TYPAHDSZ = 8192
MIN_TTY_ALTYPAHD = 8192
MIN_MAXBUF=16384

I don't recall if the TTY buffer stuff also hits the LAT ports, though.

It's commonplace to add minimum quota checks and minimum parameter checks into some applications, and particularly if the code is used on a variety of systems.

And $DIETY, it's FREE TECHNICAL HELP you're getting!
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

Yea, there is some really nasty code here and fortunately I did not write it but equally unfortunately it was thrown over the wall and I have less than a week to make it work. I have spent most of the week trying to fix the obvious, when I took the VAXC out of the build.

I have stepped through this code line by line with the debugger putting break points a all of the Async entry points and I do not get into any loops. In fact the error happens attemting to post the first AST. Guess what, examining the buffers from the strncpy in the debugger indicates that what they appear to have intended with the statement actually worked? Go figure...

I guess you get what you pay for, as they say...

Have Fun,
twhjr
As one skilled in the art it should be obvious...
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

From the Docs:

Programming Application Services and Dedicated Ports

Rather than the normal timesharing service offered by the operating system, application programs can make use of LAT application services that allow terminal server users (or users on sytems with outgoing connections) to connect to a specialized application. To do this, the system manager must create LAT ports that are dedicated to a particular application service. (Alternatively, this LAT port creation can be done from a program using the QIOs discussed in previous sections, providing OPER privilege.) When the remote user makes the connection to the application service, the connection is directly to the application program that controls a LAT port (LTA device) associated with the service. In this case the prompt, Username:, is not received. HP recommends that you follow these steps to create an application service:

1. Define the dedicated ports in LAT$SYSTARTUP.COM and execute the command procedure in SYSTARTUP_VMS.COM. (Refer to the HP OpenVMS System Management Utilities Reference Manual and the HP OpenVMS System Manager's Manual for additional information.)

2. Run the application program. Within the application program, allocate dedicated ports with the same name as those defined in LAT$SYSTARTUP.COM. Use the Assign I/O Channel ($ASSIGN) system service to assign service channels to the ports.

3. Post a read request to the dedicated ports. When the terminal user connects to the service and presses the Return key, the application program can perform I/O to the dedicated port.

4. To break the connection, use the Deassign I/O Channel ($DASSGN) system service to deassign the channel and the Deallocate Device ($DALLOC) system service to deallocate the device. The application program must reallocate the port and reassign the channel in preparation for the next connection.
An example of the application service concept is a program that provides the time of day. For this example, the system manager includes the following lines in LAT$SYSTARTUP.COM (or enters them manually in the LATCP program):

CREATE SERVICE TIME/ID="At the tone, the time will be"/APPLICATION
CREATE PORT LTA99:/DEDICATED
SET PORT LTA99:/SERVICE=TIME

An application program then assigns a channel to device LTA99. When a terminal server user types CONNECT TIME, the user is connected to this application program, and the program prints out the time of day. The program then deassigns the channel, which disconnects the server user.

A system manager may associate more than one LAT port with the same service. In that case, the application program that offers the service should assign channels to all of the LTA devices created for that service.

Have Fun,
twhjr
As one skilled in the art it should be obvious...
Andy Bustamante
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

I used to support an VAX/Alpha application that used modems and terminal servers along the same lines. Along the way, we dropped LAT support and migrated to TCPIP.

As I recall, LAT needed to be configured to allow in bound connections. If you have more than one network interface, you also need to enable LAT for each NIC. Check the startup proceedures on the working Alphaserver.
If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net
Hoff
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

> guess you get what you pay for, as they say...

More specifically, your boss gets what your boss is willing to pay for, and your boss also gets what the customers are willing to pay for, etc.

Bad code can become immortal. The same bad decisions and bad designs and bad implementations that wrought the code creature can also lead to its continued zombie-like existence. Existing long past its intended lifetime, the creature will continue seeking brains from anyone in the vicinity, and can survive well past when an incremental rewrite or a port to IP or a port to Unix would have been warranted. But I digress.

Build a small reproducer of this and toss it at HP support.

And check MAXBUF parameter.
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

If I had any say in these matters I would write them a quick web page that does the RDB lookup and be done with it but government agencies are not always flexible when it comes to changing their interfaces which means changing their docs, etc, etc...

I am going to change the code to use a single port with a QIOW like the repair application and be done with it... I know that works because it is currently running and I can set host/lat to the port in enter repair info.

Have Fun,
twhjr
As one skilled in the art it should be obvious...
Bob Blunt
Respected Contributor

Re: Programming dedicated LAT application ports on Itanium

twhjr, I checked with a developer who has written and ported complex LAT code. His recommendation was to, first, refer to the IO Users Guide's sections on LAT and to code using the standards listed therein. I also found this example code that appears to have been submitted as an example to one of the support center's knowledge bases. The URL for this is:

http://vouters.dyndns.org/tima/OpenVMS-LAT-Creating-Application-Port-programming-example.html

bob
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

I have scrutinized every word in the IO Users Guide especiall these sections:

LAT Port Types

QIO functions can be used to create the following LAT port types:

Application Port: This type of port can be used to connect to a remote device (typically a printer) on a terminal server or to a dedicated port on another LAT service node. This is the default port type. See Programming Application Ports for a description of programming an application port.

Dedicated Port: This type of port specifies that the logical port on your node is dedicated to an application service. When users on a terminal server (or on another node that supports outgoing connections) request a connection to this service name, they are connected to a dedicated port. See Programming Application Services and Dedicated Ports for a description of programming a dedicated port and application service.

Forward Port: This type of port is used for outgoing LAT connections (to remote services) and is created by assigning a channel to the LAT template device _LTA0: with the $ASSIGN system service.

I am attempting to utilize a "Dedicated Port" buy utilizing the procedures layed out in the docs and I have included previously in this thread and again here:

Programming Application Services and Dedicated Ports

Rather than the normal timesharing service offered by the operating system, application programs can make use of LAT application services that allow terminal server users (or users on sytems with outgoing connections) to connect to a specialized application. To do this, the system manager must create LAT ports that are dedicated to a particular application service. (Alternatively, this LAT port creation can be done from a program using the QIOs discussed in previous sections, providing OPER privilege.) When the remote user makes the connection to the application service, the connection is directly to the application program that controls a LAT port (LTA device) associated with the service. In this case the prompt, Username:, is not received. HP recommends that you follow these steps to create an application service:

1. Define the dedicated ports in LAT$SYSTARTUP.COM and execute the command procedure in SYSTARTUP_VMS.COM. (Refer to the HP OpenVMS System Management Utilities Reference Manual and the HP OpenVMS System Manager's Manual for additional information.)

2. Run the application program. Within the application program, allocate dedicated ports with the same name as those defined in LAT$SYSTARTUP.COM. Use the Assign I/O Channel ($ASSIGN) system service to assign service channels to the ports.

3. Post a read request to the dedicated ports. When the terminal user connects to the service and presses the Return key, the application program can perform I/O to the dedicated port.

4. To break the connection, use the Deassign I/O Channel ($DASSGN) system service to deassign the channel and the Deallocate Device ($DALLOC) system service to deallocate the device. The application program must reallocate the port and reassign the channel in preparation for the next connection.

An example of the application service concept is a program that provides the time of day. For this example, the system manager includes the following lines in LAT$SYSTARTUP.COM (or enters them manually in the LATCP program):

CREATE SERVICE TIME/ID="At the tone, the time will be"/APPLICATION
CREATE PORT LTA99:/DEDICATED
SET PORT LTA99:/SERVICE=TIME

An application program then assigns a channel to device LTA99. When a terminal server user types CONNECT TIME, the user is connected to this application program, and the program prints out the time of day. The program then deassigns the channel, which disconnects the server user.

A system manager may associate more than one LAT port with the same service. In that case, the application program that offers the service should assign channels to all of the LTA devices created for that service.

The example in the docs, besides being full of errors, is for a "Forward Port" which is NOT what I am attempting to accomplish.

Have Fun,
twhjr
As one skilled in the art it should be obvious...

Re: Programming dedicated LAT application ports on Itanium

>Craig: This is a really odd construct:
>strncpy(DEV_buf[index], "\0", DEF_IN_BUF_SIZE);
>If you're trying to null terminate ASCIZ strings, this may kinda sorta work

Yes, this will work.

>but definitely looks like it was written by someone unfamiliar with C.

No, it looks like someone too familiar with C but just not enough.

>If the intent is to zero-fill the buffers then the code as written isn't doing that.

Sure it does.

>Compare the docs for strncpy and memset and use the latter.

Right. The wording in memset(3) is much simpler to understand.

>Actually, it won't. strncpy copies the source string up to but *not including* the null terminator. So these calls do precisely nothing because the source strings have nothing in them but a null terminator.

Have you read it carefully? It shows the "broken" design of strncpy(3) where it doesn't work efficiently as a secure replacement for strcpy(3). I.e. if the string is short, it pads it out to the length, not just adding one null byte.

>Hoff: strncpy(LOG_buf[index], "\0", DEF_OUT_BUF_SIZE);
>Definitely broken. Was memset intended there?

I doubt it is broken but if it confuses the two of you, it isn't good code.
Hoff
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

Per the C specs, this does fill the buffer up to the specified length. Which I did not know. And there is still no way that I'd use this C call as a buffer fill tool. The str* calls aren't classically reliable around strings that contain nulls.

Around here, strlcpy() (where available) is preferred, and which reliably terminates the target buffer. Or the use of memset(), which explicitly zero-fills the whole buffer.

From some documentation (and why I prefer the strlcpy() call): "Because strncpy() does not guarantee to NUL terminate the string itself, this must be done explicitly." and "Be aware that the dest argument might not be terminated by a null character after a call to strncpy" In this case, there is a null and the target buffer length is (probably) non-zero, so there's no non-null terminated case here. It'll work.

Ugh. A quarter-century of C coding, and I still get bagged.



Craig A Berry
Honored Contributor

Re: Programming dedicated LAT application ports on Itanium

Dennis is right. I remembered the part about not necessarily getting a null terminator but I had forgotten that strncpy() pads up to the maximum length with nulls. This is one of several reasons strlcpy() is preferred where available; these days, with folks often using very large buffers for very large strings, zeroing more memory than you have to can be expensive.

I stand by the assertions that memset() would be better and old code that has been working is not necessarily correct code.

Hoff: Ugh. A quarter-century of C coding, and I still get bagged.

My first exposure to C was in 1987, so I have one more year to reach your level of confusion :-).

Re: Programming dedicated LAT application ports on Itanium

>Craig: zeroing more memory than you have to can be expensive.

Right.

>I stand by the assertions that memset() would be better

Right, it is more efficient and doesn't have to look at a source.
twhjr
Advisor

Re: Programming dedicated LAT application ports on Itanium

Greetings,

I changed the code to make it allocate a single port per process and changed the read to a QIOW and the interface is working the same as on the Alphas. Still wondering why async mode does not work but it is time to move on...

I am now going to spend some time cleaning up some of the old coding "tricks" and hope I do not break anything in the process. Just a reminder for those who have been reading along, I posted early on that I did step through the code in the debugger and the strncpy did work just fine.

I never liked C, I would rather be herding cats. I like cats, cat starts with C. C programmers think they can be so clever but they very rarely remember that some time in the future someone may have to maintain their mess. Pascal is an elegant language that allows one to easily create memory resident file mapped control structures and unlike C it guards against you shooting yourself in the foot. The latest version of Fortran (90/95 spec) is also very nice with a lot of OO builtin and hopefully the 2kx spec will be embraced by hp.

C is not the end all to be all just because Microsoft said so... You have to learn to pick the right tool for the right job. It is foolhardy to use an adjustable wrench when the proper box end is available.

Have Fun,
twhjr
As one skilled in the art it should be obvious...
Paul Jerrom
Valued Contributor

Re: Programming dedicated LAT application ports on Itanium

Howdy,

I too had a similar problem during my port from Alpha to Itanium. I too got advise from Mr Gillings about how it couldn't have worked before, wasn't supported, was contrary to the Geneva convention and would cause my hair to fall out if it did work.

Turned out I needed to increase the MAXBUF parameter.

have fun.

PJ
Have fun,

Peejay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If it can't be done with a VT220, who needs it?
Jess Goodman
Esteemed Contributor

Re: Programming dedicated LAT application ports on Itanium

I'm a little late to this conversation but, if anyone is interested, I could package up my LATPORT utility for distribution. Ask here, or send me email to my last name at AccuWeather dot com.

Among many capabilities, it allows you to create, configure, connect, and allocate a LAT port with one command line, or step-by-step in a script. Once a port is connected and allocated, it can be passed off to another program.

Example:
$ LATPORT CREATE /LOG /TYPE=FORWARD -
/SERVICE=postoffice /CONNECT /ALLOCATE -
/LOGICAL=(NAME=mailbox,TABLE=system,mode=EXEC)

%LAT-I-NEWPORT, created port _LTA141:
%LAT-I-NEWLOGNAME, created logical name MAILBOX in table LNM$SYSTEM_TABLE
%LAT-S-CONNECTED, session to Alpha
%CLI-I-ALLOC, _LTA141: allocated

Here is a HELP extract. The full HELP library is attached to this post.

$ LATPORT HELP
LATPORT is a utility for managing LTAn: devices (LAT ports). It has
several commands, qualifiers, and features not available with LATCP.

When a command line is used for running LATPORT, it will execute the
command and immediately return to DCL. When no command line is used
it will prompt the user for a command; execute it; and prompt again.

You can get more specific help by using the command "HELP topic...".

Additional information available:

@ ALLOCATE callable CONNECT CREATE DEALLOCATE DELETE
DISCONNECT EXIT features HELP latcp_syntax REPLACE
SET SHOW SPAWN sticky_names WAIT ZERO

Topic? features

FEATURES

LATPORT has many capabilities and features that LATCP lacks:

o "sticky" default port names
o full support for forward ports
o CONNECT and DISCONNECT commands
o ALLOCATE and DEALLOCATE commands
o REPLACE and CREATE /UNKNOWN commands
o WAIT command
o a SPAWN command that supports most of DCL's SPAWN qualifiers
o error control with the EXIT ON command
o @indirect_command_file support
o a callable interface that can be integrated into applications
I have one, but it's personal.