xref: /openbmc/qemu/docs/system/s390x/3270.rst (revision 07dbfdd290cea5d75d3e21948dc54fdb6f5174ac)
161a3d5edSCornelia Huck3270 devices
261a3d5edSCornelia Huck============
361a3d5edSCornelia Huck
42a84f48cSThomas HuthThe 3270 is the classic 'green-screen' console of the mainframes (see the
52a84f48cSThomas Huth`IBM 3270 Wikipedia article <https://en.wikipedia.org/wiki/IBM_3270>`__).
62a84f48cSThomas Huth
72a84f48cSThomas HuthThe 3270 data stream is not implemented within QEMU; the device only provides
82a84f48cSThomas HuthTN3270 (a telnet extension; see `RFC 854 <https://tools.ietf.org/html/rfc854>`__
92a84f48cSThomas Huthand `RFC 1576 <https://tools.ietf.org/html/rfc1576>`__) and leaves the heavy
102a84f48cSThomas Huthlifting to an external 3270 terminal emulator (such as ``x3270``) to make a
112a84f48cSThomas Huthsingle 3270 device available to a guest. Note that this supports basic
122a84f48cSThomas Huthfeatures only.
1361a3d5edSCornelia Huck
1461a3d5edSCornelia HuckTo provide a 3270 device to a guest, create a ``x-terminal3270`` linked to
1561a3d5edSCornelia Hucka ``tn3270`` chardev. The guest will see a 3270 channel device. In order
1661a3d5edSCornelia Huckto actually be able to use it, attach the ``x3270`` emulator to the chardev.
1761a3d5edSCornelia Huck
1861a3d5edSCornelia HuckExample configuration
1961a3d5edSCornelia Huck---------------------
2061a3d5edSCornelia Huck
212a84f48cSThomas Huth* Make sure that 3270 support is enabled in the guest's Linux kernel. You need
222a84f48cSThomas Huth  ``CONFIG_TN3270`` and at least one of ``CONFIG_TN3270_TTY`` (for additional
232a84f48cSThomas Huth  ttys) or ``CONFIG_TN3270_CONSOLE`` (for a 3270 console).
242a84f48cSThomas Huth
2561a3d5edSCornelia Huck* Add a ``tn3270`` chardev and a ``x-terminal3270`` to the QEMU command line::
2661a3d5edSCornelia Huck
27*c2387413SDaniel P. Berrangé   -chardev socket,id=ch0,host=0.0.0.0,port=2300,wait=off,server=on,tn3270=on
282a84f48cSThomas Huth   -device x-terminal3270,chardev=ch0,devno=fe.0.000a,id=terminal0
2961a3d5edSCornelia Huck
3061a3d5edSCornelia Huck* Start the guest. In the guest, use ``chccwdev -e 0.0.000a`` to enable
3161a3d5edSCornelia Huck  the device.
3261a3d5edSCornelia Huck
3361a3d5edSCornelia Huck* On the host, start the ``x3270`` emulator::
3461a3d5edSCornelia Huck
3561a3d5edSCornelia Huck    x3270 <host>:2300
3661a3d5edSCornelia Huck
3761a3d5edSCornelia Huck* In the guest, locate the 3270 device node under ``/dev/3270/`` (say,
3861a3d5edSCornelia Huck  ``tty1``) and start a getty on it::
3961a3d5edSCornelia Huck
4061a3d5edSCornelia Huck    systemctl start serial-getty@3270-tty1.service
4161a3d5edSCornelia Huck
422a84f48cSThomas Huth  This should get you an additional tty for logging into the guest.
432a84f48cSThomas Huth
442a84f48cSThomas Huth* If you want to use the 3270 device as the Linux kernel console instead of
452a84f48cSThomas Huth  an additional tty, you can also append ``conmode=3270 condev=000a`` to
462a84f48cSThomas Huth  the guest's kernel command line. The kernel then should use the 3270 as
472a84f48cSThomas Huth  console after the next boot.
482a84f48cSThomas Huth
492a84f48cSThomas HuthRestrictions
502a84f48cSThomas Huth------------
512a84f48cSThomas Huth
522a84f48cSThomas Huth3270 support is very basic. In particular:
532a84f48cSThomas Huth
542a84f48cSThomas Huth* Only one 3270 device is supported.
552a84f48cSThomas Huth
562a84f48cSThomas Huth* It has only been tested with Linux guests and the x3270 emulator.
572a84f48cSThomas Huth
582a84f48cSThomas Huth* TLS/SSL is not supported.
592a84f48cSThomas Huth
602a84f48cSThomas Huth* Resizing on reattach is not supported.
612a84f48cSThomas Huth
622a84f48cSThomas Huth* Multiple commands in one inbound buffer (for example, when the reset key
632a84f48cSThomas Huth  is pressed while the network is slow) are not supported.
64