⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hvcs.txt

📁 linux 内核源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
===========================================================================				   HVCS	IBM "Hypervisor Virtual Console Server" Installation Guide			  for Linux Kernel 2.6.4+		    Copyright (C) 2004 IBM Corporation===========================================================================NOTE:Eight space tabs are the optimum editor setting for reading this file.===========================================================================	       Author(s) :  Ryan S. Arnold <rsa@us.ibm.com>		       Date Created: March, 02, 2004		       Last Changed: August, 24, 2004---------------------------------------------------------------------------Table of contents:	1.  Driver Introduction:	2.  System Requirements	3.  Build Options:		3.1  Built-in:		3.2  Module:	4.  Installation:	5.  Connection:	6.  Disconnection:	7.  Configuration:	8.  Questions & Answers:	9.  Reporting Bugs:---------------------------------------------------------------------------1. Driver Introduction:This is the device driver for the IBM Hypervisor Virtual Console Server,"hvcs".  The IBM hvcs provides a tty driver interface to allow Linux userspace applications access to the system consoles of logically partitionedoperating systems (Linux and AIX) running on the same partitioned Power5ppc64 system.  Physical hardware consoles per partition are not practicalon this hardware so system consoles are accessed by this driver usingfirmware interfaces to virtual terminal devices.---------------------------------------------------------------------------2. System Requirements:This device driver was written using 2.6.4 Linux kernel APIs and will onlybuild and run on kernels of this version or later.This driver was written to operate solely on IBM Power5 ppc64 hardwarethough some care was taken to abstract the architecture dependent firmwarecalls from the driver code.Sysfs must be mounted on the system so that the user can determine whichmajor and minor numbers are associated with each vty-server.  Directionsfor sysfs mounting are outside the scope of this document.---------------------------------------------------------------------------3. Build Options:The hvcs driver registers itself as a tty driver.  The tty layerdynamically allocates a block of major and minor numbers in a quantityrequested by the registering driver.  The hvcs driver asks the tty layerfor 64 of these major/minor numbers by default to use for hvcs device nodeentries.If the default number of device entries is adequate then this driver can bebuilt into the kernel.  If not, the default can be over-ridden by insertingthe driver as a module with insmod parameters.---------------------------------------------------------------------------3.1 Built-in:The following menuconfig example demonstrates selecting to build thisdriver into the kernel.	Device Drivers  --->		Character devices  --->			<*> IBM Hypervisor Virtual Console Server SupportBegin the kernel make process.---------------------------------------------------------------------------3.2 Module:The following menuconfig example demonstrates selecting to build thisdriver as a kernel module.	Device Drivers  --->		Character devices  --->			<M> IBM Hypervisor Virtual Console Server SupportThe make process will build the following kernel modules:	hvcs.ko	hvcserver.koTo insert the module with the default allocation execute the followingcommands in the order they appear:	insmod hvcserver.ko	insmod hvcs.koThe hvcserver module contains architecture specific firmware calls and mustbe inserted first, otherwise the hvcs module will not find some of thesymbols it expects.To override the default use an insmod parameter as follows (requesting 4tty devices as an example):	insmod hvcs.ko hvcs_parm_num_devs=4There is a maximum number of dev entries that can be specified on insmod.We think that 1024 is currently a decent maximum number of server adaptersto allow.  This can always be changed by modifying the constant in thesource file before building.NOTE: The length of time it takes to insmod the driver seems to be relatedto the number of tty interfaces the registering driver requests.In order to remove the driver module execute the following command:	rmmod hvcs.koThe recommended method for installing hvcs as a module is to use depmod tobuild a current modules.dep file in /lib/modules/`uname -r` and thenexecute:modprobe hvcs hvcs_parm_num_devs=4The modules.dep file indicates that hvcserver.ko needs to be insertedbefore hvcs.ko and modprobe uses this file to smartly insert the modules inthe proper order.The following modprobe command is used to remove hvcs and hvcserver in theproper order:modprobe -r hvcs---------------------------------------------------------------------------4. Installation:The tty layer creates sysfs entries which contain the major and minornumbers allocated for the hvcs driver.  The following snippet of "tree"output of the sysfs directory shows where these numbers are presented:	sys/	|-- *other sysfs base dirs*	|	|-- class	|   |-- *other classes of devices*	|   |	|   `-- tty	|       |-- *other tty devices*	|       |	|       |-- hvcs0	|       |   `-- dev	|       |-- hvcs1	|       |   `-- dev	|       |-- hvcs2	|       |   `-- dev	|       |-- hvcs3	|       |   `-- dev	|       |	|       |-- *other tty devices*	|	|-- *other sysfs base dirs*For the above examples the following output is a result of cat'ing the"dev" entry in the hvcs directory:	Pow5:/sys/class/tty/hvcs0/ # cat dev	254:0	Pow5:/sys/class/tty/hvcs1/ # cat dev	254:1	Pow5:/sys/class/tty/hvcs2/ # cat dev	254:2	Pow5:/sys/class/tty/hvcs3/ # cat dev	254:3The output from reading the "dev" attribute is the char device major andminor numbers that the tty layer has allocated for this driver's use.  Mostsystems running hvcs will already have the device entries created or udevwill do it automatically.Given the example output above, to manually create a /dev/hvcs* node entrymknod can be used as follows:	mknod /dev/hvcs0 c 254 0	mknod /dev/hvcs1 c 254 1	mknod /dev/hvcs2 c 254 2	mknod /dev/hvcs3 c 254 3Using mknod to manually create the device entries makes these device nodespersistent.  Once created they will exist prior to the driver insmod.Attempting to connect an application to /dev/hvcs* prior to insertion ofthe hvcs module will result in an error message similar to the following:	"/dev/hvcs*: No such device".NOTE: Just because there is a device node present doesn't mean that thereis a vty-server device configured for that node.---------------------------------------------------------------------------5. ConnectionSince this driver controls devices that provide a tty interface a user caninteract with the device node entries using any standard tty-interactivemethod (e.g. "cat", "dd", "echo").  The intent of this driver however, isto provide real time console interaction with a Linux partition's console,which requires the use of applications that provide bi-directional,interactive I/O with a tty device.Applications (e.g. "minicom" and "screen") that act as terminal emulatorsor perform terminal type control sequence conversion on the data beingpassed through them are NOT acceptable for providing interactive consoleI/O.  These programs often emulate antiquated terminal types (vt100 andANSI) and expect inbound data to take the form of one of these supportedterminal types but they either do not convert, or do not _adequately_convert, outbound data into the terminal type of the terminal which invokedthem (though screen makes an attempt and can apparently be configured withmuch termcap wrestling.)For this reason kermit and cu are two of the recommended applications forinteracting with a Linux console via an hvcs device.  These programs simplyact as a conduit for data transfer to and from the tty device.  They do notrequire inbound data to take the form of a particular terminal type, nor dothey cook outbound data to a particular terminal type.In order to ensure proper functioning of console applications one must makesure that once connected to a /dev/hvcs console that the console's $TERMenv variable is set to the exact terminal type of the terminal emulatorused to launch the interactive I/O application.  If one is using xterm andkermit to connect to /dev/hvcs0 when the console prompt becomes availableone should "export TERM=xterm" on the console.  This tells ncursesapplications that are invoked from the console that they should outputcontrol sequences that xterm can understand.As a precautionary measure an hvcs user should always "exit" from theirsession before disconnecting an application such as kermit from the devicenode.  If this is not done, the next user to connect to the console willcontinue using the previous user's logged in session which includesusing the $TERM variable that the previous user supplied.Hotplug add and remove of vty-server adapters affects which /dev/hvcs* nodeis used to connect to each vty-server adapter.  In order to determine whichvty-server adapter is associated with which /dev/hvcs* node a special sysfsattribute has been added to each vty-server sysfs entry.  This entry iscalled "index" and showing it reveals an integer that refers to the/dev/hvcs* entry to use to connect to that device.  For instance cating theindex attribute of vty-server adapter 30000004 shows the following.	Pow5:/sys/bus/vio/drivers/hvcs/30000004 # cat index	2This index of '2' means that in order to connect to vty-server adapter30000004 the user should interact with /dev/hvcs2.It should be noted that due to the system hotplug I/O capabilities of asystem the /dev/hvcs* entry that interacts with a particular vty-serveradapter is not guaranteed to remain the same across system reboots.  Lookin the Q & A section for more on this issue.---------------------------------------------------------------------------6. DisconnectionAs a security feature to prevent the delivery of stale data to anunintended target the Power5 system firmware disables the fetching of dataand discards that data when a connection between a vty-server and a vty hasbeen severed.  As an example, when a vty-server is immediately disconnectedfrom a vty following output of data to the vty the vty adapter may not haveenough time between when it received the data interrupt and when theconnection was severed to fetch the data from firmware before the fetch isdisabled by firmware.When hvcs is being used to serve consoles this behavior is not a huge issuebecause the adapter stays connected for large amounts of time followingalmost all data writes.  When hvcs is being used as a tty conduit to tunneldata between two partitions [see Q & A below] this is a huge problembecause the standard Linux behavior when cat'ing or dd'ing data to a deviceis to open the tty, send the data, and then close the tty.  If this drivermanually terminated vty-server connections on tty close this would closethe vty-server and vty connection before the target vty has had a chance to

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -