3270.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. ===============================
  2. IBM 3270 Display System support
  3. ===============================
  4. This file describes the driver that supports local channel attachment
  5. of IBM 3270 devices. It consists of three sections:
  6. * Introduction
  7. * Installation
  8. * Operation
  9. Introduction
  10. ============
  11. This paper describes installing and operating 3270 devices under
  12. Linux/390. A 3270 device is a block-mode rows-and-columns terminal of
  13. which I'm sure hundreds of millions were sold by IBM and clonemakers
  14. twenty and thirty years ago.
  15. You may have 3270s in-house and not know it. If you're using the
  16. VM-ESA operating system, define a 3270 to your virtual machine by using
  17. the command "DEF GRAF <hex-address>" This paper presumes you will be
  18. defining four 3270s with the CP/CMS commands:
  19. - DEF GRAF 620
  20. - DEF GRAF 621
  21. - DEF GRAF 622
  22. - DEF GRAF 623
  23. Your network connection from VM-ESA allows you to use x3270, tn3270, or
  24. another 3270 emulator, started from an xterm window on your PC or
  25. workstation. With the DEF GRAF command, an application such as xterm,
  26. and this Linux-390 3270 driver, you have another way of talking to your
  27. Linux box.
  28. This paper covers installation of the driver and operation of a
  29. dialed-in x3270.
  30. Installation
  31. ============
  32. You install the driver by installing a patch, doing a kernel build, and
  33. running the configuration script (config3270.sh, in this directory).
  34. WARNING: If you are using 3270 console support, you must rerun the
  35. configuration script every time you change the console's address (perhaps
  36. by using the condev= parameter in silo's /boot/parmfile). More precisely,
  37. you should rerun the configuration script every time your set of 3270s,
  38. including the console 3270, changes subchannel identifier relative to
  39. one another. ReIPL as soon as possible after running the configuration
  40. script and the resulting /tmp/mkdev3270.
  41. If you have chosen to make tub3270 a module, you add a line to a
  42. configuration file under /etc/modprobe.d/. If you are working on a VM
  43. virtual machine, you can use DEF GRAF to define virtual 3270 devices.
  44. You may generate both 3270 and 3215 console support, or one or the
  45. other, or neither. If you generate both, the console type under VM is
  46. not changed. Use #CP Q TERM to see what the current console type is.
  47. Use #CP TERM CONMODE 3270 to change it to 3270. If you generate only
  48. 3270 console support, then the driver automatically converts your console
  49. at boot time to a 3270 if it is a 3215.
  50. In brief, these are the steps:
  51. 1. Install the tub3270 patch
  52. 2. (If a module) add a line to a file in `/etc/modprobe.d/*.conf`
  53. 3. (If VM) define devices with DEF GRAF
  54. 4. Reboot
  55. 5. Configure
  56. To test that everything works, assuming VM and x3270,
  57. 1. Bring up an x3270 window.
  58. 2. Use the DIAL command in that window.
  59. 3. You should immediately see a Linux login screen.
  60. Here are the installation steps in detail:
  61. 1. The 3270 driver is a part of the official Linux kernel
  62. source. Build a tree with the kernel source and any necessary
  63. patches. Then do::
  64. make oldconfig
  65. (If you wish to disable 3215 console support, edit
  66. .config; change CONFIG_TN3215's value to "n";
  67. and rerun "make oldconfig".)
  68. make image
  69. make modules
  70. make modules_install
  71. 2. (Perform this step only if you have configured tub3270 as a
  72. module.) Add a line to a file `/etc/modprobe.d/*.conf` to automatically
  73. load the driver when it's needed. With this line added, you will see
  74. login prompts appear on your 3270s as soon as boot is complete (or
  75. with emulated 3270s, as soon as you dial into your vm guest using the
  76. command "DIAL <vmguestname>"). Since the line-mode major number is
  77. 227, the line to add should be::
  78. alias char-major-227 tub3270
  79. 3. Define graphic devices to your vm guest machine, if you
  80. haven't already. Define them before you reboot (reipl):
  81. - DEFINE GRAF 620
  82. - DEFINE GRAF 621
  83. - DEFINE GRAF 622
  84. - DEFINE GRAF 623
  85. 4. Reboot. The reboot process scans hardware devices, including
  86. 3270s, and this enables the tub3270 driver once loaded to respond
  87. correctly to the configuration requests of the next step. If
  88. you have chosen 3270 console support, your console now behaves
  89. as a 3270, not a 3215.
  90. 5. Run the 3270 configuration script config3270. It is
  91. distributed in this same directory, Documentation/s390, as
  92. config3270.sh. Inspect the output script it produces,
  93. /tmp/mkdev3270, and then run that script. This will create the
  94. necessary character special device files and make the necessary
  95. changes to /etc/inittab.
  96. Then notify /sbin/init that /etc/inittab has changed, by issuing
  97. the telinit command with the q operand::
  98. cd Documentation/s390
  99. sh config3270.sh
  100. sh /tmp/mkdev3270
  101. telinit q
  102. This should be sufficient for your first time. If your 3270
  103. configuration has changed and you're reusing config3270, you
  104. should follow these steps::
  105. Change 3270 configuration
  106. Reboot
  107. Run config3270 and /tmp/mkdev3270
  108. Reboot
  109. Here are the testing steps in detail:
  110. 1. Bring up an x3270 window, or use an actual hardware 3278 or
  111. 3279, or use the 3270 emulator of your choice. You would be
  112. running the emulator on your PC or workstation. You would use
  113. the command, for example::
  114. x3270 vm-esa-domain-name &
  115. if you wanted a 3278 Model 4 with 43 rows of 80 columns, the
  116. default model number. The driver does not take advantage of
  117. extended attributes.
  118. The screen you should now see contains a VM logo with input
  119. lines near the bottom. Use TAB to move to the bottom line,
  120. probably labeled "COMMAND ===>".
  121. 2. Use the DIAL command instead of the LOGIN command to connect
  122. to one of the virtual 3270s you defined with the DEF GRAF
  123. commands::
  124. dial my-vm-guest-name
  125. 3. You should immediately see a login prompt from your
  126. Linux-390 operating system. If that does not happen, you would
  127. see instead the line "DIALED TO my-vm-guest-name 0620".
  128. To troubleshoot: do these things.
  129. A. Is the driver loaded? Use the lsmod command (no operands)
  130. to find out. Probably it isn't. Try loading it manually, with
  131. the command "insmod tub3270". Does that command give error
  132. messages? Ha! There's your problem.
  133. B. Is the /etc/inittab file modified as in installation step 3
  134. above? Use the grep command to find out; for instance, issue
  135. "grep 3270 /etc/inittab". Nothing found? There's your
  136. problem!
  137. C. Are the device special files created, as in installation
  138. step 2 above? Use the ls -l command to find out; for instance,
  139. issue "ls -l /dev/3270/tty620". The output should start with the
  140. letter "c" meaning character device and should contain "227, 1"
  141. just to the left of the device name. No such file? no "c"?
  142. Wrong major number? Wrong minor number? There's your
  143. problem!
  144. D. Do you get the message::
  145. "HCPDIA047E my-vm-guest-name 0620 does not exist"?
  146. If so, you must issue the command "DEF GRAF 620" from your VM
  147. 3215 console and then reboot the system.
  148. OPERATION.
  149. ==========
  150. The driver defines three areas on the 3270 screen: the log area, the
  151. input area, and the status area.
  152. The log area takes up all but the bottom two lines of the screen. The
  153. driver writes terminal output to it, starting at the top line and going
  154. down. When it fills, the status area changes from "Linux Running" to
  155. "Linux More...". After a scrolling timeout of (default) 5 sec, the
  156. screen clears and more output is written, from the top down.
  157. The input area extends from the beginning of the second-to-last screen
  158. line to the start of the status area. You type commands in this area
  159. and hit ENTER to execute them.
  160. The status area initializes to "Linux Running" to give you a warm
  161. fuzzy feeling. When the log area fills up and output awaits, it
  162. changes to "Linux More...". At this time you can do several things or
  163. nothing. If you do nothing, the screen will clear in (default) 5 sec
  164. and more output will appear. You may hit ENTER with nothing typed in
  165. the input area to toggle between "Linux More..." and "Linux Holding",
  166. which indicates no scrolling will occur. (If you hit ENTER with "Linux
  167. Running" and nothing typed, the application receives a newline.)
  168. You may change the scrolling timeout value. For example, the following
  169. command line::
  170. echo scrolltime=60 > /proc/tty/driver/tty3270
  171. changes the scrolling timeout value to 60 sec. Set scrolltime to 0 if
  172. you wish to prevent scrolling entirely.
  173. Other things you may do when the log area fills up are: hit PA2 to
  174. clear the log area and write more output to it, or hit CLEAR to clear
  175. the log area and the input area and write more output to the log area.
  176. Some of the Program Function (PF) and Program Attention (PA) keys are
  177. preassigned special functions. The ones that are not yield an alarm
  178. when pressed.
  179. PA1 causes a SIGINT to the currently running application. You may do
  180. the same thing from the input area, by typing "^C" and hitting ENTER.
  181. PA2 causes the log area to be cleared. If output awaits, it is then
  182. written to the log area.
  183. PF3 causes an EOF to be received as input by the application. You may
  184. cause an EOF also by typing "^D" and hitting ENTER.
  185. No PF key is preassigned to cause a job suspension, but you may cause a
  186. job suspension by typing "^Z" and hitting ENTER. You may wish to
  187. assign this function to a PF key. To make PF7 cause job suspension,
  188. execute the command::
  189. echo pf7=^z > /proc/tty/driver/tty3270
  190. If the input you type does not end with the two characters "^n", the
  191. driver appends a newline character and sends it to the tty driver;
  192. otherwise the driver strips the "^n" and does not append a newline.
  193. The IBM 3215 driver behaves similarly.
  194. Pf10 causes the most recent command to be retrieved from the tube's
  195. command stack (default depth 20) and displayed in the input area. You
  196. may hit PF10 again for the next-most-recent command, and so on. A
  197. command is entered into the stack only when the input area is not made
  198. invisible (such as for password entry) and it is not identical to the
  199. current top entry. PF10 rotates backward through the command stack;
  200. PF11 rotates forward. You may assign the backward function to any PF
  201. key (or PA key, for that matter), say, PA3, with the command::
  202. echo -e pa3=\\033k > /proc/tty/driver/tty3270
  203. This assigns the string ESC-k to PA3. Similarly, the string ESC-j
  204. performs the forward function. (Rationale: In bash with vi-mode line
  205. editing, ESC-k and ESC-j retrieve backward and forward history.
  206. Suggestions welcome.)
  207. Is a stack size of twenty commands not to your liking? Change it on
  208. the fly. To change to saving the last 100 commands, execute the
  209. command::
  210. echo recallsize=100 > /proc/tty/driver/tty3270
  211. Have a command you issue frequently? Assign it to a PF or PA key! Use
  212. the command::
  213. echo pf24="mkdir foobar; cd foobar" > /proc/tty/driver/tty3270
  214. to execute the commands mkdir foobar and cd foobar immediately when you
  215. hit PF24. Want to see the command line first, before you execute it?
  216. Use the -n option of the echo command::
  217. echo -n pf24="mkdir foo; cd foo" > /proc/tty/driver/tty3270
  218. Happy testing! I welcome any and all comments about this document, the
  219. driver, etc etc.
  220. Dick Hitt <rbh00@utsglobal.com>