Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) ===============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) HVCS IBM "Hypervisor Virtual Console Server" Installation Guide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ===============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) for Linux Kernel 2.6.4+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) Copyright (C) 2004 IBM Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) .. ===========================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) .. NOTE:Eight space tabs are the optimum editor setting for reading this file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) .. ===========================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) Author(s): Ryan S. Arnold <rsa@us.ibm.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) Date Created: March, 02, 2004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) Last Changed: August, 24, 2004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) .. Table of contents:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	1.  Driver Introduction:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	2.  System Requirements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	3.  Build Options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 		3.1  Built-in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 		3.2  Module:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	4.  Installation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	5.  Connection:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	6.  Disconnection:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	7.  Configuration:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	8.  Questions & Answers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	9.  Reporting Bugs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 1. Driver Introduction:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) This is the device driver for the IBM Hypervisor Virtual Console Server,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) "hvcs".  The IBM hvcs provides a tty driver interface to allow Linux user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) space applications access to the system consoles of logically partitioned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) operating systems (Linux and AIX) running on the same partitioned Power5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) ppc64 system.  Physical hardware consoles per partition are not practical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) on this hardware so system consoles are accessed by this driver using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) firmware interfaces to virtual terminal devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 2. System Requirements:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) This device driver was written using 2.6.4 Linux kernel APIs and will only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) build and run on kernels of this version or later.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) This driver was written to operate solely on IBM Power5 ppc64 hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) though some care was taken to abstract the architecture dependent firmware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) calls from the driver code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) Sysfs must be mounted on the system so that the user can determine which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) major and minor numbers are associated with each vty-server.  Directions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) for sysfs mounting are outside the scope of this document.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 3. Build Options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) =================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) The hvcs driver registers itself as a tty driver.  The tty layer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) dynamically allocates a block of major and minor numbers in a quantity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) requested by the registering driver.  The hvcs driver asks the tty layer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) for 64 of these major/minor numbers by default to use for hvcs device node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) entries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) If the default number of device entries is adequate then this driver can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) built into the kernel.  If not, the default can be over-ridden by inserting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) the driver as a module with insmod parameters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 3.1 Built-in:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) The following menuconfig example demonstrates selecting to build this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) driver into the kernel::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	Device Drivers  --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		Character devices  --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			<*> IBM Hypervisor Virtual Console Server Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) Begin the kernel make process.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 3.2 Module:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) The following menuconfig example demonstrates selecting to build this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) driver as a kernel module::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	Device Drivers  --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		Character devices  --->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 			<M> IBM Hypervisor Virtual Console Server Support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) The make process will build the following kernel modules:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	- hvcs.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	- hvcserver.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) To insert the module with the default allocation execute the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) commands in the order they appear::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	insmod hvcserver.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	insmod hvcs.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) The hvcserver module contains architecture specific firmware calls and must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) be inserted first, otherwise the hvcs module will not find some of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) symbols it expects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) To override the default use an insmod parameter as follows (requesting 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) tty devices as an example)::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	insmod hvcs.ko hvcs_parm_num_devs=4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) There is a maximum number of dev entries that can be specified on insmod.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) We think that 1024 is currently a decent maximum number of server adapters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) to allow.  This can always be changed by modifying the constant in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) source file before building.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) NOTE: The length of time it takes to insmod the driver seems to be related
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) to the number of tty interfaces the registering driver requests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) In order to remove the driver module execute the following command::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	rmmod hvcs.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) The recommended method for installing hvcs as a module is to use depmod to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) build a current modules.dep file in /lib/modules/`uname -r` and then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) execute::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	modprobe hvcs hvcs_parm_num_devs=4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) The modules.dep file indicates that hvcserver.ko needs to be inserted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) before hvcs.ko and modprobe uses this file to smartly insert the modules in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) the proper order.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) The following modprobe command is used to remove hvcs and hvcserver in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) proper order::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	modprobe -r hvcs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 4. Installation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) The tty layer creates sysfs entries which contain the major and minor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) numbers allocated for the hvcs driver.  The following snippet of "tree"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) output of the sysfs directory shows where these numbers are presented::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	sys/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	|-- *other sysfs base dirs*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	|-- class
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	|   |-- *other classes of devices*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	|   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	|   `-- tty
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	|       |-- *other tty devices*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	|       |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	|       |-- hvcs0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	|       |   `-- dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	|       |-- hvcs1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	|       |   `-- dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	|       |-- hvcs2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 	|       |   `-- dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 	|       |-- hvcs3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	|       |   `-- dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	|       |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	|       |-- *other tty devices*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	|-- *other sysfs base dirs*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) For the above examples the following output is a result of cat'ing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) "dev" entry in the hvcs directory::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	Pow5:/sys/class/tty/hvcs0/ # cat dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	254:0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	Pow5:/sys/class/tty/hvcs1/ # cat dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	254:1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	Pow5:/sys/class/tty/hvcs2/ # cat dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	254:2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	Pow5:/sys/class/tty/hvcs3/ # cat dev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	254:3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) The output from reading the "dev" attribute is the char device major and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) minor numbers that the tty layer has allocated for this driver's use.  Most
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) systems running hvcs will already have the device entries created or udev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) will do it automatically.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) Given the example output above, to manually create a /dev/hvcs* node entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) mknod can be used as follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	mknod /dev/hvcs0 c 254 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	mknod /dev/hvcs1 c 254 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	mknod /dev/hvcs2 c 254 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	mknod /dev/hvcs3 c 254 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) Using mknod to manually create the device entries makes these device nodes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) persistent.  Once created they will exist prior to the driver insmod.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) Attempting to connect an application to /dev/hvcs* prior to insertion of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) the hvcs module will result in an error message similar to the following::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	"/dev/hvcs*: No such device".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) NOTE: Just because there is a device node present doesn't mean that there
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) is a vty-server device configured for that node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 5. Connection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) =============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) Since this driver controls devices that provide a tty interface a user can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) interact with the device node entries using any standard tty-interactive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) method (e.g. "cat", "dd", "echo").  The intent of this driver however, is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) to provide real time console interaction with a Linux partition's console,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) which requires the use of applications that provide bi-directional,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) interactive I/O with a tty device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) Applications (e.g. "minicom" and "screen") that act as terminal emulators
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) or perform terminal type control sequence conversion on the data being
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) passed through them are NOT acceptable for providing interactive console
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) I/O.  These programs often emulate antiquated terminal types (vt100 and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) ANSI) and expect inbound data to take the form of one of these supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) terminal types but they either do not convert, or do not _adequately_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) convert, outbound data into the terminal type of the terminal which invoked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) them (though screen makes an attempt and can apparently be configured with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) much termcap wrestling.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) For this reason kermit and cu are two of the recommended applications for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) interacting with a Linux console via an hvcs device.  These programs simply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) act as a conduit for data transfer to and from the tty device.  They do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) require inbound data to take the form of a particular terminal type, nor do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) they cook outbound data to a particular terminal type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) In order to ensure proper functioning of console applications one must make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) sure that once connected to a /dev/hvcs console that the console's $TERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) env variable is set to the exact terminal type of the terminal emulator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) used to launch the interactive I/O application.  If one is using xterm and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) kermit to connect to /dev/hvcs0 when the console prompt becomes available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) one should "export TERM=xterm" on the console.  This tells ncurses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) applications that are invoked from the console that they should output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) control sequences that xterm can understand.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) As a precautionary measure an hvcs user should always "exit" from their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) session before disconnecting an application such as kermit from the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) node.  If this is not done, the next user to connect to the console will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) continue using the previous user's logged in session which includes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) using the $TERM variable that the previous user supplied.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) Hotplug add and remove of vty-server adapters affects which /dev/hvcs* node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) is used to connect to each vty-server adapter.  In order to determine which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) vty-server adapter is associated with which /dev/hvcs* node a special sysfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) attribute has been added to each vty-server sysfs entry.  This entry is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) called "index" and showing it reveals an integer that refers to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /dev/hvcs* entry to use to connect to that device.  For instance cating the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) index attribute of vty-server adapter 30000004 shows the following::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) This index of '2' means that in order to connect to vty-server adapter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 30000004 the user should interact with /dev/hvcs2.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) It should be noted that due to the system hotplug I/O capabilities of a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) system the /dev/hvcs* entry that interacts with a particular vty-server
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) adapter is not guaranteed to remain the same across system reboots.  Look
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) in the Q & A section for more on this issue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 6. Disconnection
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) As a security feature to prevent the delivery of stale data to an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) unintended target the Power5 system firmware disables the fetching of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) and discards that data when a connection between a vty-server and a vty has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) been severed.  As an example, when a vty-server is immediately disconnected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) from a vty following output of data to the vty the vty adapter may not have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) enough time between when it received the data interrupt and when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) connection was severed to fetch the data from firmware before the fetch is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) disabled by firmware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) When hvcs is being used to serve consoles this behavior is not a huge issue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) because the adapter stays connected for large amounts of time following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) almost all data writes.  When hvcs is being used as a tty conduit to tunnel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) data between two partitions [see Q & A below] this is a huge problem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) because the standard Linux behavior when cat'ing or dd'ing data to a device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) is to open the tty, send the data, and then close the tty.  If this driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) manually terminated vty-server connections on tty close this would close
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) the vty-server and vty connection before the target vty has had a chance to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) fetch the data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) Additionally, disconnecting a vty-server and vty only on module removal or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) adapter removal is impractical because other vty-servers in other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) partitions may require the usage of the target vty at any time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) Due to this behavioral restriction disconnection of vty-servers from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) connected vty is a manual procedure using a write to a sysfs attribute
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) outlined below, on the other hand the initial vty-server connection to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) vty is established automatically by this driver.  Manual vty-server
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) connection is never required.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) In order to terminate the connection between a vty-server and vty the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) "vterm_state" sysfs attribute within each vty-server's sysfs entry is used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) Reading this attribute reveals the current connection state of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) vty-server adapter.  A zero means that the vty-server is not connected to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) vty.  A one indicates that a connection is active.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) Writing a '0' (zero) to the vterm_state attribute will disconnect the VTERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) connection between the vty-server and target vty ONLY if the vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) previously read '1'.  The write directive is ignored if the vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) read '0' or if any value other than '0' was written to the vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) attribute.  The following example will show the method used for verifying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) the vty-server connection status and disconnecting a vty-server connection::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 	1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo 0 > vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 	0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) All vty-server connections are automatically terminated when the device is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) hotplug removed and when the module is removed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 7. Configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) Each vty-server has a sysfs entry in the /sys/devices/vio directory, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) is symlinked in several other sysfs tree directories, notably under the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) hvcs driver entry, which looks like the following example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	Pow5:/sys/bus/vio/drivers/hvcs # ls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 	.  ..  30000003  30000004  rescan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) By design, firmware notifies the hvcs driver of vty-server lifetimes and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) partner vty removals but not the addition of partner vtys.  Since an HMC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) Super Admin can add partner info dynamically we have provided the hvcs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) driver sysfs directory with the "rescan" update attribute which will query
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) firmware and update the partner info for all the vty-servers that this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) driver manages.  Writing a '1' to the attribute triggers the update.  An
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) explicit example follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	Pow5:/sys/bus/vio/drivers/hvcs # echo 1 > rescan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) Reading the attribute will indicate a state of '1' or '0'.  A one indicates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) that an update is in process.  A zero indicates that an update has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) completed or was never executed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) Vty-server entries in this directory are a 32 bit partition unique unit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) address that is created by firmware.  An example vty-server sysfs entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) looks like the following::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # ls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	.   current_vty   devspec       name          partner_vtys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	..  index         partner_clcs  vterm_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) Each entry is provided, by default with a "name" attribute.  Reading the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) "name" attribute will reveal the device type as shown in the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 	Pow5:/sys/bus/vio/drivers/hvcs/30000003 # cat name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 	vty-server
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) Each entry is also provided, by default, with a "devspec" attribute which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) reveals the full device specification when read, as shown in the following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat devspec
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	/vdevice/vty-server@30000004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) Each vty-server sysfs dir is provided with two read-only attributes that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) provide lists of easily parsed partner vty data: "partner_vtys" and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) "partner_clcs"::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_vtys
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 	30000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 	30000001
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 	30000002
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 	30000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	30000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat partner_clcs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) 	U5112.428.103048A-V3-C0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) 	U5112.428.103048A-V3-C2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 	U5112.428.103048A-V3-C3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 	U5112.428.103048A-V4-C0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	U5112.428.103048A-V5-C0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) Reading partner_vtys returns a list of partner vtys.  Vty unit address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) numbering is only per-partition-unique so entries will frequently repeat.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) Reading partner_clcs returns a list of "converged location codes" which are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) composed of a system serial number followed by "-V*", where the '*' is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) target partition number, and "-C*", where the '*' is the slot of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) adapter.  The first vty partner corresponds to the first clc item, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) second vty partner to the second clc item, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) A vty-server can only be connected to a single vty at a time.  The entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) "current_vty" prints the clc of the currently selected partner vty when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) The current_vty can be changed by writing a valid partner clc to the entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) as in the following example::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # echo U5112.428.10304
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	8A-V4-C0 > current_vty
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) Changing the current_vty when a vty-server is already connected to a vty
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) does not affect the current connection.  The change takes effect when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) currently open connection is freed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) Information on the "vterm_state" attribute was covered earlier on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) chapter entitled "disconnection".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 8. Questions & Answers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) Q: What are the security concerns involving hvcs?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) A: There are three main security concerns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	1. The creator of the /dev/hvcs* nodes has the ability to restrict
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	the access of the device entries to certain users or groups.  It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 	may be best to create a special hvcs group privilege for providing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	access to system consoles.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 	2. To provide network security when grabbing the console it is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 	suggested that the user connect to the console hosting partition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	using a secure method, such as SSH or sit at a hardware console.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 	3. Make sure to exit the user session when done with a console or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 	the next vty-server connection (which may be from another
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 	partition) will experience the previously logged in session.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) Q: How do I multiplex a console that I grab through hvcs so that other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) people can see it:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) A: You can use "screen" to directly connect to the /dev/hvcs* device and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) setup a session on your machine with the console group privileges.  As
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) pointed out earlier by default screen doesn't provide the termcap settings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) for most terminal emulators to provide adequate character conversion from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) term type "screen" to others.  This means that curses based programs may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) not display properly in screen sessions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) Q: Why are the colors all messed up?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) Q: Why are the control characters acting strange or not working?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) Q: Why is the console output all strange and unintelligible?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) A: Please see the preceding section on "Connection" for a discussion of how
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) applications can affect the display of character control sequences.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) Additionally, just because you logged into the console using and xterm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) doesn't mean someone else didn't log into the console with the HMC console
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) (vt320) before you and leave the session logged in.  The best thing to do
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) is to export TERM to the terminal type of your terminal emulator when you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) get the console.  Additionally make sure to "exit" the console before you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) disconnect from the console.  This will ensure that the next user gets
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) their own TERM type set when they login.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) Q: When I try to CONNECT kermit to an hvcs device I get:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) "Sorry, can't open connection: /dev/hvcs*"What is happening?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) A: Some other Power5 console mechanism has a connection to the vty and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) isn't giving it up.  You can try to force disconnect the consoles from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) HMC by right clicking on the partition and then selecting "close terminal".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) Otherwise you have to hunt down the people who have console authority.  It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) is possible that you already have the console open using another kermit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) session and just forgot about it.  Please review the console options for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) Power5 systems to determine the many ways a system console can be held.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) A: Another user may not have a connectivity method currently attached to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) /dev/hvcs device but the vterm_state may reveal that they still have the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) vty-server connection established.  They need to free this using the method
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) outlined in the section on "Disconnection" in order for others to connect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) to the target vty.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) A: The user profile you are using to execute kermit probably doesn't have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) permissions to use the /dev/hvcs* device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) A: You probably haven't inserted the hvcs.ko module yet but the /dev/hvcs*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) entry still exists (on systems without udev).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) A: There is not a corresponding vty-server device that maps to an existing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) /dev/hvcs* entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) Q: When I try to CONNECT kermit to an hvcs device I get:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) "Sorry, write access to UUCP lockfile directory denied."
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) A: The /dev/hvcs* entry you have specified doesn't exist where you said it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) does?  Maybe you haven't inserted the module (on systems with udev).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) Q: If I already have one Linux partition installed can I use hvcs on said
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) partition to provide the console for the install of a second Linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) partition?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) A: Yes granted that your are connected to the /dev/hvcs* device using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) kermit or cu or some other program that doesn't provide terminal emulation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) Q: Can I connect to more than one partition's console at a time using this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) driver?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) A: Yes.  Of course this means that there must be more than one vty-server
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) configured for this partition and each must point to a disconnected vty.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) Q: Does the hvcs driver support dynamic (hotplug) addition of devices?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) A: Yes, if you have dlpar and hotplug enabled for your system and it has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) been built into the kernel the hvcs drivers is configured to dynamically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) handle additions of new devices and removals of unused devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) Q: For some reason /dev/hvcs* doesn't map to the same vty-server adapter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) after a reboot.  What happened?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) A: Assignment of vty-server adapters to /dev/hvcs* entries is always done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) in the order that the adapters are exposed.  Due to hotplug capabilities of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) this driver assignment of hotplug added vty-servers may be in a different
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) order than how they would be exposed on module load.  Rebooting or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) reloading the module after dynamic addition may result in the /dev/hvcs*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) and vty-server coupling changing if a vty-server adapter was added in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) slot between two other vty-server adapters.  Refer to the section above
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) on how to determine which vty-server goes with which /dev/hvcs* node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) Hint; look at the sysfs "index" attribute for the vty-server.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) Q: Can I use /dev/hvcs* as a conduit to another partition and use a tty
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) device on that partition as the other end of the pipe?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) A: Yes, on Power5 platforms the hvc_console driver provides a tty interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) for extra /dev/hvc* devices (where /dev/hvc0 is most likely the console).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) In order to get a tty conduit working between the two partitions the HMC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) Super Admin must create an additional "serial server" for the target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) partition with the HMC gui which will show up as /dev/hvc* when the target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) partition is rebooted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) The HMC Super Admin then creates an additional "serial client" for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) current partition and points this at the target partition's newly created
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) "serial server" adapter (remember the slot).  This shows up as an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) additional /dev/hvcs* device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) Now a program on the target system can be configured to read or write to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) /dev/hvc* and another program on the current partition can be configured to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) read or write to /dev/hvcs*.  Now you have a tty conduit between two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) partitions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) ---------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 9. Reporting Bugs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) ==================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) The proper channel for reporting bugs is either through the Linux OS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) distribution company that provided your OS or by posting issues to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) PowerPC development mailing list at:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) linuxppc-dev@lists.ozlabs.org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) This request is to provide a documented and searchable public exchange
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) of the problems and solutions surrounding this driver for the benefit of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) all users.