Hi Donald,

Donald Russell <[email protected]> writes:

> This Message Is From an Untrusted Sender 
> You have not previously corresponded with this sender. 
>  
> That’s great.😀 I don’t know why the code was written to act
> differently when running on vm, but it sounds like using
> the query partition in all cases simplifies the code and makes it more
> generally useable.

Well, i digged a bit in the history in linux, and the code was always
using query partition before 2005. But that had one problem with vm: if
the terminal is disconnected, the query would just fail and linux hangs
on boot. Therefore code was added to derive the geometry from the
diag210 information when running on z/VM.

I quickly added experimental diag 8c support today to the linux kernel
and that fetches the correct dimensions of the 3270 console, but fails
when i'm disconnecting and reconnecting with a different resolution.
That's expected - diag 8c only queries the terminal when it comes online
in CP.

> The IBM doc that describes this talked about using TERM=linux and you
> just mentioned TERM=ansi.

Yes, sorry for the confusion. It doesn't really matter whether it's
linux or ansi - the linux terminal type is just derived from ansi. The
important part is that it is a color terminal, while the vt220 is a
monochrome terminal.

> Other common types are vt220 and others, so I was curious why the TERM
> value wouldn’t be something like ibm3278 or
> ibm3279.

The reason is that UNIX terminals have a fundamental different way of
operation. 3270 Terminals receive a description with all the fields you
can put data in, or that should be displayed from the Mainframe. That's
all managed by the terminal, and data back to the mainframe is only
transmitted when you press enter. That's a very efficent way of doing
things, but the UNIX world has choosen the opposite approach: every key
you press gets transmitted to the server and the server responds with a
response that should be displayed on screen. Part of the response can
contain named ANSI escape sequences that change color or other attribute.

So what the 3270 driver does is translating these escape sequences to
3270 fields. That works to some extend like displaying colors, but
things like reacting to single keypresses are much more complicated if
not impossible. You probably have also noticed that the command line
is at the bottom of the screen, that's because it wouldn't work well
with fields to have it at a random location with the 3270 fields model.

> I used “linux” and the colors worked as expected, though I don’t use
> many.

I think you have 8 colors with the 3270 driver, and no background
colors.

> As for handling geometry changes due to vm cp disconnect/reconnect…
> Obviously it would be best if the kernel detected
> that, but if I have to do something like echo 1 > 
> /dev3270/tty1/query_partition
> That would be acceptable because I already have a process in Linux
> that starts a 3270/tty when reconnecting…. Maybe
> that’s where the code needs to be… when starting the Getty, read
> partition, that works for me because I also stop the
> Getty on a CP disconnect event. 

I've asked the z/VM people whether there's a way to detect a
reconnecting 3270 terminal. Lets see whether that's possible.

Regards
Sven

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www2.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to