You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
ChangeLog for the UTS Global 3270-support patch
|
||||
|
||||
Sep 2002: Get bootup colors right on 3270 console
|
||||
* In tubttybld.c, substantially revise ESC processing so that
|
||||
ESC sequences (especially coloring ones) and the strings
|
||||
they affect work as right as 3270 can get them. Also, set
|
||||
screen height to omit the two rows used for input area, in
|
||||
tty3270_open() in tubtty.c.
|
||||
|
||||
Sep 2002: Dynamically get 3270 input buffer
|
||||
* Oversize 3270 screen widths may exceed GEOM_MAXINPLEN columns,
|
||||
so get input-area buffer dynamically when sizing the device in
|
||||
tubmakemin() in tuball.c (if it's the console) or tty3270_open()
|
||||
in tubtty.c (if needed). Change tubp->tty_input to be a
|
||||
pointer rather than an array, in tubio.h.
|
||||
|
||||
Sep 2002: Fix tubfs kmalloc()s
|
||||
* Do read and write lengths correctly in fs3270_read()
|
||||
and fs3270_write(), whilst never asking kmalloc()
|
||||
for more than 0x800 bytes. Affects tubfs.c and tubio.h.
|
||||
|
||||
Sep 2002: Recognize 3270 control unit type 3174
|
||||
* Recognize control-unit type 0x3174 as well as 0x327?.
|
||||
The IBM 2047 device emulates a 3174 control unit.
|
||||
Modularize control-unit recognition in tuball.c by
|
||||
adding and invoking new tub3270_is_ours().
|
||||
|
||||
Apr 2002: Fix 3270 console reboot loop
|
||||
* (Belated log entry) Fixed reboot loop if 3270 console,
|
||||
in tubtty.c:ttu3270_bh().
|
||||
|
||||
Feb 6, 2001:
|
||||
* This changelog is new
|
||||
* tub3270 now supports 3270 console:
|
||||
Specify y for CONFIG_3270 and y for CONFIG_3270_CONSOLE.
|
||||
Support for 3215 will not appear if 3270 console support
|
||||
is chosen.
|
||||
NOTE: The default is 3270 console support, NOT 3215.
|
||||
* the components are remodularized: added source modules are
|
||||
tubttybld.c and tubttyscl.c, for screen-building code and
|
||||
scroll-timeout code.
|
||||
* tub3270 source for this (2.4.0) version is #ifdeffed to
|
||||
build with both 2.4.0 and 2.2.16.2.
|
||||
* color support and minimal other ESC-sequence support is added.
|
||||
@@ -0,0 +1,274 @@
|
||||
IBM 3270 Display System support
|
||||
|
||||
This file describes the driver that supports local channel attachment
|
||||
of IBM 3270 devices. It consists of three sections:
|
||||
* Introduction
|
||||
* Installation
|
||||
* Operation
|
||||
|
||||
|
||||
INTRODUCTION.
|
||||
|
||||
This paper describes installing and operating 3270 devices under
|
||||
Linux/390. A 3270 device is a block-mode rows-and-columns terminal of
|
||||
which I'm sure hundreds of millions were sold by IBM and clonemakers
|
||||
twenty and thirty years ago.
|
||||
|
||||
You may have 3270s in-house and not know it. If you're using the
|
||||
VM-ESA operating system, define a 3270 to your virtual machine by using
|
||||
the command "DEF GRAF <hex-address>" This paper presumes you will be
|
||||
defining four 3270s with the CP/CMS commands
|
||||
|
||||
DEF GRAF 620
|
||||
DEF GRAF 621
|
||||
DEF GRAF 622
|
||||
DEF GRAF 623
|
||||
|
||||
Your network connection from VM-ESA allows you to use x3270, tn3270, or
|
||||
another 3270 emulator, started from an xterm window on your PC or
|
||||
workstation. With the DEF GRAF command, an application such as xterm,
|
||||
and this Linux-390 3270 driver, you have another way of talking to your
|
||||
Linux box.
|
||||
|
||||
This paper covers installation of the driver and operation of a
|
||||
dialed-in x3270.
|
||||
|
||||
|
||||
INSTALLATION.
|
||||
|
||||
You install the driver by installing a patch, doing a kernel build, and
|
||||
running the configuration script (config3270.sh, in this directory).
|
||||
|
||||
WARNING: If you are using 3270 console support, you must rerun the
|
||||
configuration script every time you change the console's address (perhaps
|
||||
by using the condev= parameter in silo's /boot/parmfile). More precisely,
|
||||
you should rerun the configuration script every time your set of 3270s,
|
||||
including the console 3270, changes subchannel identifier relative to
|
||||
one another. ReIPL as soon as possible after running the configuration
|
||||
script and the resulting /tmp/mkdev3270.
|
||||
|
||||
If you have chosen to make tub3270 a module, you add a line to
|
||||
/etc/modprobe.conf. If you are working on a VM virtual machine, you
|
||||
can use DEF GRAF to define virtual 3270 devices.
|
||||
|
||||
You may generate both 3270 and 3215 console support, or one or the
|
||||
other, or neither. If you generate both, the console type under VM is
|
||||
not changed. Use #CP Q TERM to see what the current console type is.
|
||||
Use #CP TERM CONMODE 3270 to change it to 3270. If you generate only
|
||||
3270 console support, then the driver automatically converts your console
|
||||
at boot time to a 3270 if it is a 3215.
|
||||
|
||||
In brief, these are the steps:
|
||||
1. Install the tub3270 patch
|
||||
2. (If a module) add a line to /etc/modprobe.conf
|
||||
3. (If VM) define devices with DEF GRAF
|
||||
4. Reboot
|
||||
5. Configure
|
||||
|
||||
To test that everything works, assuming VM and x3270,
|
||||
1. Bring up an x3270 window.
|
||||
2. Use the DIAL command in that window.
|
||||
3. You should immediately see a Linux login screen.
|
||||
|
||||
Here are the installation steps in detail:
|
||||
|
||||
1. The 3270 driver is a part of the official Linux kernel
|
||||
source. Build a tree with the kernel source and any necessary
|
||||
patches. Then do
|
||||
make oldconfig
|
||||
(If you wish to disable 3215 console support, edit
|
||||
.config; change CONFIG_TN3215's value to "n";
|
||||
and rerun "make oldconfig".)
|
||||
make image
|
||||
make modules
|
||||
make modules_install
|
||||
|
||||
2. (Perform this step only if you have configured tub3270 as a
|
||||
module.) Add a line to /etc/modprobe.conf to automatically
|
||||
load the driver when it's needed. With this line added,
|
||||
you will see login prompts appear on your 3270s as soon as
|
||||
boot is complete (or with emulated 3270s, as soon as you dial
|
||||
into your vm guest using the command "DIAL <vmguestname>").
|
||||
Since the line-mode major number is 227, the line to add to
|
||||
/etc/modprobe.conf should be:
|
||||
alias char-major-227 tub3270
|
||||
|
||||
3. Define graphic devices to your vm guest machine, if you
|
||||
haven't already. Define them before you reboot (reipl):
|
||||
DEFINE GRAF 620
|
||||
DEFINE GRAF 621
|
||||
DEFINE GRAF 622
|
||||
DEFINE GRAF 623
|
||||
|
||||
4. Reboot. The reboot process scans hardware devices, including
|
||||
3270s, and this enables the tub3270 driver once loaded to respond
|
||||
correctly to the configuration requests of the next step. If
|
||||
you have chosen 3270 console support, your console now behaves
|
||||
as a 3270, not a 3215.
|
||||
|
||||
5. Run the 3270 configuration script config3270. It is
|
||||
distributed in this same directory, Documentation/s390, as
|
||||
config3270.sh. Inspect the output script it produces,
|
||||
/tmp/mkdev3270, and then run that script. This will create the
|
||||
necessary character special device files and make the necessary
|
||||
changes to /etc/inittab. If you have selected DEVFS, the driver
|
||||
itself creates the device files, and /tmp/mkdev3270 only changes
|
||||
/etc/inittab.
|
||||
|
||||
Then notify /sbin/init that /etc/inittab has changed, by issuing
|
||||
the telinit command with the q operand:
|
||||
cd Documentation/s390
|
||||
sh config3270.sh
|
||||
sh /tmp/mkdev3270
|
||||
telinit q
|
||||
|
||||
This should be sufficient for your first time. If your 3270
|
||||
configuration has changed and you're reusing config3270, you
|
||||
should follow these steps:
|
||||
Change 3270 configuration
|
||||
Reboot
|
||||
Run config3270 and /tmp/mkdev3270
|
||||
Reboot
|
||||
|
||||
Here are the testing steps in detail:
|
||||
|
||||
1. Bring up an x3270 window, or use an actual hardware 3278 or
|
||||
3279, or use the 3270 emulator of your choice. You would be
|
||||
running the emulator on your PC or workstation. You would use
|
||||
the command, for example,
|
||||
x3270 vm-esa-domain-name &
|
||||
if you wanted a 3278 Model 4 with 43 rows of 80 columns, the
|
||||
default model number. The driver does not take advantage of
|
||||
extended attributes.
|
||||
|
||||
The screen you should now see contains a VM logo with input
|
||||
lines near the bottom. Use TAB to move to the bottom line,
|
||||
probably labeled "COMMAND ===>".
|
||||
|
||||
2. Use the DIAL command instead of the LOGIN command to connect
|
||||
to one of the virtual 3270s you defined with the DEF GRAF
|
||||
commands:
|
||||
dial my-vm-guest-name
|
||||
|
||||
3. You should immediately see a login prompt from your
|
||||
Linux-390 operating system. If that does not happen, you would
|
||||
see instead the line "DIALED TO my-vm-guest-name 0620".
|
||||
|
||||
To troubleshoot: do these things.
|
||||
|
||||
A. Is the driver loaded? Use the lsmod command (no operands)
|
||||
to find out. Probably it isn't. Try loading it manually, with
|
||||
the command "insmod tub3270". Does that command give error
|
||||
messages? Ha! There's your problem.
|
||||
|
||||
B. Is the /etc/inittab file modified as in installation step 3
|
||||
above? Use the grep command to find out; for instance, issue
|
||||
"grep 3270 /etc/inittab". Nothing found? There's your
|
||||
problem!
|
||||
|
||||
C. Are the device special files created, as in installation
|
||||
step 2 above? Use the ls -l command to find out; for instance,
|
||||
issue "ls -l /dev/3270/tty620". The output should start with the
|
||||
letter "c" meaning character device and should contain "227, 1"
|
||||
just to the left of the device name. No such file? no "c"?
|
||||
Wrong major number? Wrong minor number? There's your
|
||||
problem!
|
||||
|
||||
D. Do you get the message
|
||||
"HCPDIA047E my-vm-guest-name 0620 does not exist"?
|
||||
If so, you must issue the command "DEF GRAF 620" from your VM
|
||||
3215 console and then reboot the system.
|
||||
|
||||
|
||||
|
||||
OPERATION.
|
||||
|
||||
The driver defines three areas on the 3270 screen: the log area, the
|
||||
input area, and the status area.
|
||||
|
||||
The log area takes up all but the bottom two lines of the screen. The
|
||||
driver writes terminal output to it, starting at the top line and going
|
||||
down. When it fills, the status area changes from "Linux Running" to
|
||||
"Linux More...". After a scrolling timeout of (default) 5 sec, the
|
||||
screen clears and more output is written, from the top down.
|
||||
|
||||
The input area extends from the beginning of the second-to-last screen
|
||||
line to the start of the status area. You type commands in this area
|
||||
and hit ENTER to execute them.
|
||||
|
||||
The status area initializes to "Linux Running" to give you a warm
|
||||
fuzzy feeling. When the log area fills up and output awaits, it
|
||||
changes to "Linux More...". At this time you can do several things or
|
||||
nothing. If you do nothing, the screen will clear in (default) 5 sec
|
||||
and more output will appear. You may hit ENTER with nothing typed in
|
||||
the input area to toggle between "Linux More..." and "Linux Holding",
|
||||
which indicates no scrolling will occur. (If you hit ENTER with "Linux
|
||||
Running" and nothing typed, the application receives a newline.)
|
||||
|
||||
You may change the scrolling timeout value. For example, the following
|
||||
command line:
|
||||
echo scrolltime=60 > /proc/tty/driver/tty3270
|
||||
changes the scrolling timeout value to 60 sec. Set scrolltime to 0 if
|
||||
you wish to prevent scrolling entirely.
|
||||
|
||||
Other things you may do when the log area fills up are: hit PA2 to
|
||||
clear the log area and write more output to it, or hit CLEAR to clear
|
||||
the log area and the input area and write more output to the log area.
|
||||
|
||||
Some of the Program Function (PF) and Program Attention (PA) keys are
|
||||
preassigned special functions. The ones that are not yield an alarm
|
||||
when pressed.
|
||||
|
||||
PA1 causes a SIGINT to the currently running application. You may do
|
||||
the same thing from the input area, by typing "^C" and hitting ENTER.
|
||||
|
||||
PA2 causes the log area to be cleared. If output awaits, it is then
|
||||
written to the log area.
|
||||
|
||||
PF3 causes an EOF to be received as input by the application. You may
|
||||
cause an EOF also by typing "^D" and hitting ENTER.
|
||||
|
||||
No PF key is preassigned to cause a job suspension, but you may cause a
|
||||
job suspension by typing "^Z" and hitting ENTER. You may wish to
|
||||
assign this function to a PF key. To make PF7 cause job suspension,
|
||||
execute the command:
|
||||
echo pf7=^z > /proc/tty/driver/tty3270
|
||||
|
||||
If the input you type does not end with the two characters "^n", the
|
||||
driver appends a newline character and sends it to the tty driver;
|
||||
otherwise the driver strips the "^n" and does not append a newline.
|
||||
The IBM 3215 driver behaves similarly.
|
||||
|
||||
Pf10 causes the most recent command to be retrieved from the tube's
|
||||
command stack (default depth 20) and displayed in the input area. You
|
||||
may hit PF10 again for the next-most-recent command, and so on. A
|
||||
command is entered into the stack only when the input area is not made
|
||||
invisible (such as for password entry) and it is not identical to the
|
||||
current top entry. PF10 rotates backward through the command stack;
|
||||
PF11 rotates forward. You may assign the backward function to any PF
|
||||
key (or PA key, for that matter), say, PA3, with the command:
|
||||
echo -e pa3=\\033k > /proc/tty/driver/tty3270
|
||||
This assigns the string ESC-k to PA3. Similarly, the string ESC-j
|
||||
performs the forward function. (Rationale: In bash with vi-mode line
|
||||
editing, ESC-k and ESC-j retrieve backward and forward history.
|
||||
Suggestions welcome.)
|
||||
|
||||
Is a stack size of twenty commands not to your liking? Change it on
|
||||
the fly. To change to saving the last 100 commands, execute the
|
||||
command:
|
||||
echo recallsize=100 > /proc/tty/driver/tty3270
|
||||
|
||||
Have a command you issue frequently? Assign it to a PF or PA key! Use
|
||||
the command
|
||||
echo pf24="mkdir foobar; cd foobar" > /proc/tty/driver/tty3270
|
||||
to execute the commands mkdir foobar and cd foobar immediately when you
|
||||
hit PF24. Want to see the command line first, before you execute it?
|
||||
Use the -n option of the echo command:
|
||||
echo -n pf24="mkdir foo; cd foo" > /proc/tty/driver/tty3270
|
||||
|
||||
|
||||
|
||||
Happy testing! I welcome any and all comments about this document, the
|
||||
driver, etc etc.
|
||||
|
||||
Dick Hitt <rbh00@utsglobal.com>
|
||||
@@ -0,0 +1,109 @@
|
||||
S/390 common I/O-Layer - command line parameters and /proc entries
|
||||
==================================================================
|
||||
|
||||
Command line parameters
|
||||
-----------------------
|
||||
|
||||
* cio_msg = yes | no
|
||||
|
||||
Determines whether information on found devices and sensed device
|
||||
characteristics should be shown during startup, i. e. messages of the types
|
||||
"Detected device 0.0.4711 on subchannel 0.0.0042" and "SenseID: Device
|
||||
0.0.4711 reports: ...".
|
||||
|
||||
Default is off.
|
||||
|
||||
|
||||
* cio_ignore = {all} |
|
||||
{<device> | <range of devices>} |
|
||||
{!<device> | !<range of devices>}
|
||||
|
||||
The given devices will be ignored by the common I/O-layer; no detection
|
||||
and device sensing will be done on any of those devices. The subchannel to
|
||||
which the device in question is attached will be treated as if no device was
|
||||
attached.
|
||||
|
||||
An ignored device can be un-ignored later; see the "/proc entries"-section for
|
||||
details.
|
||||
|
||||
The devices must be given either as bus ids (0.0.abcd) or as hexadecimal
|
||||
device numbers (0xabcd or abcd, for 2.4 backward compatibility).
|
||||
You can use the 'all' keyword to ignore all devices.
|
||||
The '!' operator will cause the I/O-layer to _not_ ignore a device.
|
||||
The order on the command line is not important.
|
||||
|
||||
For example,
|
||||
cio_ignore=0.0.0023-0.0.0042,0.0.4711
|
||||
will ignore all devices ranging from 0.0.0023 to 0.0.0042 and the device
|
||||
0.0.4711, if detected.
|
||||
As another example,
|
||||
cio_ignore=all,!0.0.4711,!0.0.fd00-0.0.fd02
|
||||
will ignore all devices but 0.0.4711, 0.0.fd00, 0.0.fd01, 0.0.fd02.
|
||||
|
||||
By default, no devices are ignored.
|
||||
|
||||
|
||||
/proc entries
|
||||
-------------
|
||||
|
||||
* /proc/cio_ignore
|
||||
|
||||
Lists the ranges of devices (by bus id) which are ignored by common I/O.
|
||||
|
||||
You can un-ignore certain or all devices by piping to /proc/cio_ignore.
|
||||
"free all" will un-ignore all ignored devices,
|
||||
"free <device range>, <device range>, ..." will un-ignore the specified
|
||||
devices.
|
||||
|
||||
For example, if devices 0.0.0023 to 0.0.0042 and 0.0.4711 are ignored,
|
||||
- echo free 0.0.0030-0.0.0032 > /proc/cio_ignore
|
||||
will un-ignore devices 0.0.0030 to 0.0.0032 and will leave devices 0.0.0023
|
||||
to 0.0.002f, 0.0.0033 to 0.0.0042 and 0.0.4711 ignored;
|
||||
- echo free 0.0.0041 > /proc/cio_ignore will furthermore un-ignore device
|
||||
0.0.0041;
|
||||
- echo free all > /proc/cio_ignore will un-ignore all remaining ignored
|
||||
devices.
|
||||
|
||||
When a device is un-ignored, device recognition and sensing is performed and
|
||||
the device driver will be notified if possible, so the device will become
|
||||
available to the system.
|
||||
|
||||
You can also add ranges of devices to be ignored by piping to
|
||||
/proc/cio_ignore; "add <device range>, <device range>, ..." will ignore the
|
||||
specified devices.
|
||||
|
||||
Note: Already known devices cannot be ignored.
|
||||
|
||||
For example, if device 0.0.abcd is already known and all other devices
|
||||
0.0.a000-0.0.afff are not known,
|
||||
"echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore"
|
||||
will add 0.0.a000-0.0.abcc, 0.0.abce-0.0.accc and 0.0.af00-0.0.afff to the
|
||||
list of ignored devices and skip 0.0.abcd.
|
||||
|
||||
The devices can be specified either by bus id (0.0.abcd) or, for 2.4 backward
|
||||
compatibilty, by the device number in hexadecimal (0xabcd or abcd).
|
||||
|
||||
|
||||
* /proc/s390dbf/cio_*/ (S/390 debug feature)
|
||||
|
||||
Some views generated by the debug feature to hold various debug outputs.
|
||||
|
||||
- /proc/s390dbf/cio_crw/sprintf
|
||||
Messages from the processing of pending channel report words (machine check
|
||||
handling), which will also show when CONFIG_DEBUG_CRW is defined.
|
||||
|
||||
- /proc/s390dbf/cio_msg/sprintf
|
||||
Various debug messages from the common I/O-layer; generally, messages which
|
||||
will also show when CONFIG_DEBUG_IO is defined.
|
||||
|
||||
- /proc/s390dbf/cio_trace/hex_ascii
|
||||
Logs the calling of functions in the common I/O-layer and, if applicable,
|
||||
which subchannel they were called for.
|
||||
|
||||
The level of logging can be changed to be more or less verbose by piping to
|
||||
/proc/s390dbf/cio_*/level a number between 0 and 6; see the documentation on
|
||||
the S/390 debug feature (Documentation/s390/s390dbf.txt) for details.
|
||||
|
||||
* For some of the information present in the /proc filesystem in 2.4 (namely,
|
||||
/proc/subchannels and /proc/chpids), see driver-model.txt.
|
||||
Information formerly in /proc/irq_count is now in /proc/interrupts.
|
||||
@@ -0,0 +1,73 @@
|
||||
DASD device driver
|
||||
|
||||
S/390's disk devices (DASDs) are managed by Linux via the DASD device
|
||||
driver. It is valid for all types of DASDs and represents them to
|
||||
Linux as block devices, namely "dd". Currently the DASD driver uses a
|
||||
single major number (254) and 4 minor numbers per volume (1 for the
|
||||
physical volume and 3 for partitions). With respect to partitions see
|
||||
below. Thus you may have up to 64 DASD devices in your system.
|
||||
|
||||
The kernel parameter 'dasd=from-to,...' may be issued arbitrary times
|
||||
in the kernel's parameter line or not at all. The 'from' and 'to'
|
||||
parameters are to be given in hexadecimal notation without a leading
|
||||
0x.
|
||||
If you supply kernel parameters the different instances are processed
|
||||
in order of appearance and a minor number is reserved for any device
|
||||
covered by the supplied range up to 64 volumes. Additional DASDs are
|
||||
ignored. If you do not supply the 'dasd=' kernel parameter at all, the
|
||||
DASD driver registers all supported DASDs of your system to a minor
|
||||
number in ascending order of the subchannel number.
|
||||
|
||||
The driver currently supports ECKD-devices and there are stubs for
|
||||
support of the FBA and CKD architectures. For the FBA architecture
|
||||
only some smart data structures are missing to make the support
|
||||
complete.
|
||||
We performed our testing on 3380 and 3390 type disks of different
|
||||
sizes, under VM and on the bare hardware (LPAR), using internal disks
|
||||
of the multiprise as well as a RAMAC virtual array. Disks exported by
|
||||
an Enterprise Storage Server (Seascape) should work fine as well.
|
||||
|
||||
We currently implement one partition per volume, which is the whole
|
||||
volume, skipping the first blocks up to the volume label. These are
|
||||
reserved for IPL records and IBM's volume label to assure
|
||||
accessibility of the DASD from other OSs. In a later stage we will
|
||||
provide support of partitions, maybe VTOC oriented or using a kind of
|
||||
partition table in the label record.
|
||||
|
||||
USAGE
|
||||
|
||||
-Low-level format (?CKD only)
|
||||
For using an ECKD-DASD as a Linux harddisk you have to low-level
|
||||
format the tracks by issuing the BLKDASDFORMAT-ioctl on that
|
||||
device. This will erase any data on that volume including IBM volume
|
||||
labels, VTOCs etc. The ioctl may take a 'struct format_data *' or
|
||||
'NULL' as an argument.
|
||||
typedef struct {
|
||||
int start_unit;
|
||||
int stop_unit;
|
||||
int blksize;
|
||||
} format_data_t;
|
||||
When a NULL argument is passed to the BLKDASDFORMAT ioctl the whole
|
||||
disk is formatted to a blocksize of 1024 bytes. Otherwise start_unit
|
||||
and stop_unit are the first and last track to be formatted. If
|
||||
stop_unit is -1 it implies that the DASD is formatted from start_unit
|
||||
up to the last track. blksize can be any power of two between 512 and
|
||||
4096. We recommend no blksize lower than 1024 because the ext2fs uses
|
||||
1kB blocks anyway and you gain approx. 50% of capacity increasing your
|
||||
blksize from 512 byte to 1kB.
|
||||
|
||||
-Make a filesystem
|
||||
Then you can mk??fs the filesystem of your choice on that volume or
|
||||
partition. For reasons of sanity you should build your filesystem on
|
||||
the partition /dev/dd?1 instead of the whole volume. You only lose 3kB
|
||||
but may be sure that you can reuse your data after introduction of a
|
||||
real partition table.
|
||||
|
||||
BUGS:
|
||||
- Performance sometimes is rather low because we don't fully exploit clustering
|
||||
|
||||
TODO-List:
|
||||
- Add IBM'S Disk layout to genhd
|
||||
- Enhance driver to use more than one major number
|
||||
- Enable usage as a module
|
||||
- Support Cache fast write and DASD fast write (ECKD)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
Channel attached Tape device driver
|
||||
|
||||
-----------------------------WARNING-----------------------------------------
|
||||
This driver is considered to be EXPERIMENTAL. Do NOT use it in
|
||||
production environments. Feel free to test it and report problems back to us.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
The LINUX for zSeries tape device driver manages channel attached tape drives
|
||||
which are compatible to IBM 3480 or IBM 3490 magnetic tape subsystems. This
|
||||
includes various models of these devices (for example the 3490E).
|
||||
|
||||
|
||||
Tape driver features
|
||||
|
||||
The device driver supports a maximum of 128 tape devices.
|
||||
No official LINUX device major number is assigned to the zSeries tape device
|
||||
driver. It allocates major numbers dynamically and reports them on system
|
||||
startup.
|
||||
Typically it will get major number 254 for both the character device front-end
|
||||
and the block device front-end.
|
||||
|
||||
The tape device driver needs no kernel parameters. All supported devices
|
||||
present are detected on driver initialization at system startup or module load.
|
||||
The devices detected are ordered by their subchannel numbers. The device with
|
||||
the lowest subchannel number becomes device 0, the next one will be device 1
|
||||
and so on.
|
||||
|
||||
|
||||
Tape character device front-end
|
||||
|
||||
The usual way to read or write to the tape device is through the character
|
||||
device front-end. The zSeries tape device driver provides two character devices
|
||||
for each physical device -- the first of these will rewind automatically when
|
||||
it is closed, the second will not rewind automatically.
|
||||
|
||||
The character device nodes are named /dev/rtibm0 (rewinding) and /dev/ntibm0
|
||||
(non-rewinding) for the first device, /dev/rtibm1 and /dev/ntibm1 for the
|
||||
second, and so on.
|
||||
|
||||
The character device front-end can be used as any other LINUX tape device. You
|
||||
can write to it and read from it using LINUX facilities such as GNU tar. The
|
||||
tool mt can be used to perform control operations, such as rewinding the tape
|
||||
or skipping a file.
|
||||
|
||||
Most LINUX tape software should work with either tape character device.
|
||||
|
||||
|
||||
Tape block device front-end
|
||||
|
||||
The tape device may also be accessed as a block device in read-only mode.
|
||||
This could be used for software installation in the same way as it is used with
|
||||
other operation systems on the zSeries platform (and most LINUX
|
||||
distributions are shipped on compact disk using ISO9660 filesystems).
|
||||
|
||||
One block device node is provided for each physical device. These are named
|
||||
/dev/btibm0 for the first device, /dev/btibm1 for the second and so on.
|
||||
You should only use the ISO9660 filesystem on LINUX for zSeries tapes because
|
||||
the physical tape devices cannot perform fast seeks and the ISO9660 system is
|
||||
optimized for this situation.
|
||||
|
||||
|
||||
Tape block device example
|
||||
|
||||
In this example a tape with an ISO9660 filesystem is created using the first
|
||||
tape device. ISO9660 filesystem support must be built into your system kernel
|
||||
for this.
|
||||
The mt command is used to issue tape commands and the mkisofs command to
|
||||
create an ISO9660 filesystem:
|
||||
|
||||
- create a LINUX directory (somedir) with the contents of the filesystem
|
||||
mkdir somedir
|
||||
cp contents somedir
|
||||
|
||||
- insert a tape
|
||||
|
||||
- ensure the tape is at the beginning
|
||||
mt -f /dev/ntibm0 rewind
|
||||
|
||||
- set the blocksize of the character driver. The blocksize 2048 bytes
|
||||
is commonly used on ISO9660 CD-Roms
|
||||
mt -f /dev/ntibm0 setblk 2048
|
||||
|
||||
- write the filesystem to the character device driver
|
||||
mkisofs -o /dev/ntibm0 somedir
|
||||
|
||||
- rewind the tape again
|
||||
mt -f /dev/ntibm0 rewind
|
||||
|
||||
- Now you can mount your new filesystem as a block device:
|
||||
mount -t iso9660 -o ro,block=2048 /dev/btibm0 /mnt
|
||||
|
||||
TODO List
|
||||
|
||||
- Driver has to be stabilized still
|
||||
|
||||
BUGS
|
||||
|
||||
This driver is considered BETA, which means some weaknesses may still
|
||||
be in it.
|
||||
If an error occurs which cannot be handled by the code you will get a
|
||||
sense-data dump.In that case please do the following:
|
||||
|
||||
1. set the tape driver debug level to maximum:
|
||||
echo 6 >/proc/s390dbf/tape/level
|
||||
|
||||
2. re-perform the actions which produced the bug. (Hopefully the bug will
|
||||
reappear.)
|
||||
|
||||
3. get a snapshot from the debug-feature:
|
||||
cat /proc/s390dbf/tape/hex_ascii >somefile
|
||||
|
||||
4. Now put the snapshot together with a detailed description of the situation
|
||||
that led to the bug:
|
||||
- Which tool did you use?
|
||||
- Which hardware do you have?
|
||||
- Was your tape unit online?
|
||||
- Is it a shared tape unit?
|
||||
|
||||
5. Send an email with your bug report to:
|
||||
mailto:Linux390@de.ibm.com
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# config3270 -- Autoconfigure /dev/3270/* and /etc/inittab
|
||||
#
|
||||
# Usage:
|
||||
# config3270
|
||||
#
|
||||
# Output:
|
||||
# /tmp/mkdev3270
|
||||
#
|
||||
# Operation:
|
||||
# 1. Run this script
|
||||
# 2. Run the script it produces: /tmp/mkdev3270
|
||||
# 3. Issue "telinit q" or reboot, as appropriate.
|
||||
#
|
||||
P=/proc/tty/driver/tty3270
|
||||
ROOT=
|
||||
D=$ROOT/dev
|
||||
SUBD=3270
|
||||
TTY=$SUBD/tty
|
||||
TUB=$SUBD/tub
|
||||
SCR=$ROOT/tmp/mkdev3270
|
||||
SCRTMP=$SCR.a
|
||||
GETTYLINE=:2345:respawn:/sbin/mingetty
|
||||
INITTAB=$ROOT/etc/inittab
|
||||
NINITTAB=$ROOT/etc/NEWinittab
|
||||
OINITTAB=$ROOT/etc/OLDinittab
|
||||
ADDNOTE=\\"# Additional mingettys for the 3270/tty* driver, tub3270 ---\\"
|
||||
|
||||
if ! ls $P > /dev/null 2>&1; then
|
||||
modprobe tub3270 > /dev/null 2>&1
|
||||
fi
|
||||
ls $P > /dev/null 2>&1 || exit 1
|
||||
|
||||
# Initialize two files, one for /dev/3270 commands and one
|
||||
# to replace the /etc/inittab file (old one saved in OLDinittab)
|
||||
echo "#!/bin/sh" > $SCR || exit 1
|
||||
echo " " >> $SCR
|
||||
echo "# Script built by /sbin/config3270" >> $SCR
|
||||
if [ ! -d /dev/dasd ]; then
|
||||
echo rm -rf "$D/$SUBD/*" >> $SCR
|
||||
fi
|
||||
echo "grep -v $TTY $INITTAB > $NINITTAB" > $SCRTMP || exit 1
|
||||
echo "echo $ADDNOTE >> $NINITTAB" >> $SCRTMP
|
||||
if [ ! -d /dev/dasd ]; then
|
||||
echo mkdir -p $D/$SUBD >> $SCR
|
||||
fi
|
||||
|
||||
# Now query the tub3270 driver for 3270 device information
|
||||
# and add appropriate mknod and mingetty lines to our files
|
||||
echo what=config > $P
|
||||
while read devno maj min;do
|
||||
if [ $min = 0 ]; then
|
||||
fsmaj=$maj
|
||||
if [ ! -d /dev/dasd ]; then
|
||||
echo mknod $D/$TUB c $fsmaj 0 >> $SCR
|
||||
echo chmod 666 $D/$TUB >> $SCR
|
||||
fi
|
||||
elif [ $maj = CONSOLE ]; then
|
||||
if [ ! -d /dev/dasd ]; then
|
||||
echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
|
||||
fi
|
||||
else
|
||||
if [ ! -d /dev/dasd ]; then
|
||||
echo mknod $D/$TTY$devno c $maj $min >>$SCR
|
||||
echo mknod $D/$TUB$devno c $fsmaj $min >> $SCR
|
||||
fi
|
||||
echo "echo t$min$GETTYLINE $TTY$devno >> $NINITTAB" >> $SCRTMP
|
||||
fi
|
||||
done < $P
|
||||
|
||||
echo mv $INITTAB $OINITTAB >> $SCRTMP || exit 1
|
||||
echo mv $NINITTAB $INITTAB >> $SCRTMP
|
||||
cat $SCRTMP >> $SCR
|
||||
rm $SCRTMP
|
||||
exit 0
|
||||
@@ -0,0 +1,83 @@
|
||||
crypto-API support for z990 Message Security Assist (MSA) instructions
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
AUTHOR: Thomas Spatzier (tspat@de.ibm.com)
|
||||
|
||||
|
||||
1. Introduction crypto-API
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
See Documentation/crypto/api-intro.txt for an introduction/description of the
|
||||
kernel crypto API.
|
||||
According to api-intro.txt support for z990 crypto instructions has been added
|
||||
in the algorithm api layer of the crypto API. Several files containing z990
|
||||
optimized implementations of crypto algorithms are placed in the
|
||||
arch/s390/crypto directory.
|
||||
|
||||
|
||||
2. Probing for availability of MSA
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
It should be possible to use Kernels with the z990 crypto implementations both
|
||||
on machines with MSA available an on those without MSA (pre z990 or z990
|
||||
without MSA). Therefore a simple probing mechanisms has been implemented:
|
||||
In the init function of each crypto module the availability of MSA and of the
|
||||
respective crypto algorithm in particular will be tested. If the algorithm is
|
||||
available the module will load and register its algorithm with the crypto API.
|
||||
|
||||
If the respective crypto algorithm is not available, the init function will
|
||||
return -ENOSYS. In that case a fallback to the standard software implementation
|
||||
of the crypto algorithm must be taken ( -> the standard crypto modules are
|
||||
also build when compiling the kernel).
|
||||
|
||||
|
||||
3. Ensuring z990 crypto module preference
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
If z990 crypto instructions are available the optimized modules should be
|
||||
preferred instead of standard modules.
|
||||
|
||||
3.1. compiled-in modules
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
For compiled-in modules it has to be ensured that the z990 modules are linked
|
||||
before the standard crypto modules. Then, on system startup the init functions
|
||||
of z990 crypto modules will be called first and query for availability of z990
|
||||
crypto instructions. If instruction is available, the z990 module will register
|
||||
its crypto algorithm implementation -> the load of the standard module will fail
|
||||
since the algorithm is already registered.
|
||||
If z990 crypto instruction is not available the load of the z990 module will
|
||||
fail -> the standard module will load and register its algorithm.
|
||||
|
||||
3.2. dynamic modules
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
A system administrator has to take care of giving preference to z990 crypto
|
||||
modules. If MSA is available appropriate lines have to be added to
|
||||
/etc/modprobe.conf.
|
||||
|
||||
Example: z990 crypto instruction for SHA1 algorithm is available
|
||||
|
||||
add the following line to /etc/modprobe.conf (assuming the
|
||||
z990 crypto modules for SHA1 is called sha1_z990):
|
||||
|
||||
alias sha1 sha1_z990
|
||||
|
||||
-> when the sha1 algorithm is requested through the crypto API
|
||||
(which has a module autoloader) the z990 module will be loaded.
|
||||
|
||||
TBD: a userspace module probin mechanism
|
||||
something like 'probe sha1 sha1_z990 sha1' in modprobe.conf
|
||||
-> try module sha1_z990, if it fails to load load standard module sha1
|
||||
the 'probe' statement is currently not supported in modprobe.conf
|
||||
|
||||
|
||||
4. Currently implemented z990 crypto algorithms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The following crypto algorithms with z990 MSA support are currently implemented.
|
||||
The name of each algorithm under which it is registered in crypto API and the
|
||||
name of the respective module is given in square brackets.
|
||||
|
||||
- SHA1 Digest Algorithm [sha1 -> sha1_z990]
|
||||
- DES Encrypt/Decrypt Algorithm (64bit key) [des -> des_z990]
|
||||
- Tripple DES Encrypt/Decrypt Algorithm (128bit key) [des3_ede128 -> des_z990]
|
||||
- Tripple DES Encrypt/Decrypt Algorithm (192bit key) [des3_ede -> des_z990]
|
||||
|
||||
In order to load, for example, the sha1_z990 module when the sha1 algorithm is
|
||||
requested (see 3.2.) add 'alias sha1 sha1_z990' to /etc/modprobe.conf.
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
S/390 driver model interfaces
|
||||
-----------------------------
|
||||
|
||||
1. CCW devices
|
||||
--------------
|
||||
|
||||
All devices which can be addressed by means of ccws are called 'CCW devices' -
|
||||
even if they aren't actually driven by ccws.
|
||||
|
||||
All ccw devices are accessed via a subchannel, this is reflected in the
|
||||
structures under root/:
|
||||
|
||||
root/
|
||||
- sys
|
||||
- legacy
|
||||
- css0/
|
||||
- 0.0.0000/0.0.0815/
|
||||
- 0.0.0001/0.0.4711/
|
||||
- 0.0.0002/
|
||||
...
|
||||
|
||||
In this example, device 0815 is accessed via subchannel 0, device 4711 via
|
||||
subchannel 1, and subchannel 2 is a non-I/O subchannel.
|
||||
|
||||
You should address a ccw device via its bus id (e.g. 0.0.4711); the device can
|
||||
be found under bus/ccw/devices/.
|
||||
|
||||
All ccw devices export some data via sysfs.
|
||||
|
||||
cutype: The control unit type / model.
|
||||
|
||||
devtype: The device type / model, if applicable.
|
||||
|
||||
availability: Can be 'good' or 'boxed'; 'no path' or 'no device' for
|
||||
disconnected devices.
|
||||
|
||||
online: An interface to set the device online and offline.
|
||||
In the special case of the device being disconnected (see the
|
||||
notify function under 1.2), piping 0 to online will focibly delete
|
||||
the device.
|
||||
|
||||
The device drivers can add entries to export per-device data and interfaces.
|
||||
|
||||
There is also some data exported on a per-subchannel basis (see under
|
||||
bus/css/devices/):
|
||||
|
||||
chpids: Via which chpids the device is connected.
|
||||
|
||||
pimpampom: The path installed, path available and path operational masks.
|
||||
|
||||
There also might be additional data, for example for block devices.
|
||||
|
||||
|
||||
1.1 Bringing up a ccw device
|
||||
----------------------------
|
||||
|
||||
This is done in several steps.
|
||||
|
||||
a. Each driver can provide one or more parameter interfaces where parameters can
|
||||
be specified. These interfaces are also in the driver's responsibility.
|
||||
b. After a. has been performed, if necessary, the device is finally brought up
|
||||
via the 'online' interface.
|
||||
|
||||
|
||||
1.2 Writing a driver for ccw devices
|
||||
------------------------------------
|
||||
|
||||
The basic struct ccw_device and struct ccw_driver data structures can be found
|
||||
under include/asm/ccwdev.h.
|
||||
|
||||
struct ccw_device {
|
||||
spinlock_t *ccwlock;
|
||||
struct ccw_device_private *private;
|
||||
struct ccw_device_id id;
|
||||
|
||||
struct ccw_driver *drv;
|
||||
struct device dev;
|
||||
int online;
|
||||
|
||||
void (*handler) (struct ccw_device *dev, unsigned long intparm,
|
||||
struct irb *irb);
|
||||
};
|
||||
|
||||
struct ccw_driver {
|
||||
struct module *owner;
|
||||
struct ccw_device_id *ids;
|
||||
int (*probe) (struct ccw_device *);
|
||||
int (*remove) (struct ccw_device *);
|
||||
int (*set_online) (struct ccw_device *);
|
||||
int (*set_offline) (struct ccw_device *);
|
||||
int (*notify) (struct ccw_device *, int);
|
||||
struct device_driver driver;
|
||||
char *name;
|
||||
};
|
||||
|
||||
The 'private' field contains data needed for internal i/o operation only, and
|
||||
is not available to the device driver.
|
||||
|
||||
Each driver should declare in a MODULE_DEVICE_TABLE into which CU types/models
|
||||
and/or device types/models it is interested. This information can later be found
|
||||
found in the struct ccw_device_id fields:
|
||||
|
||||
struct ccw_device_id {
|
||||
__u16 match_flags;
|
||||
|
||||
__u16 cu_type;
|
||||
__u16 dev_type;
|
||||
__u8 cu_model;
|
||||
__u8 dev_model;
|
||||
|
||||
unsigned long driver_info;
|
||||
};
|
||||
|
||||
The functions in ccw_driver should be used in the following way:
|
||||
probe: This function is called by the device layer for each device the driver
|
||||
is interested in. The driver should only allocate private structures
|
||||
to put in dev->driver_data and create attributes (if needed). Also,
|
||||
the interrupt handler (see below) should be set here.
|
||||
|
||||
int (*probe) (struct ccw_device *cdev);
|
||||
|
||||
Parameters: cdev - the device to be probed.
|
||||
|
||||
|
||||
remove: This function is called by the device layer upon removal of the driver,
|
||||
the device or the module. The driver should perform cleanups here.
|
||||
|
||||
int (*remove) (struct ccw_device *cdev);
|
||||
|
||||
Parameters: cdev - the device to be removed.
|
||||
|
||||
|
||||
set_online: This function is called by the common I/O layer when the device is
|
||||
activated via the 'online' attribute. The driver should finally
|
||||
setup and activate the device here.
|
||||
|
||||
int (*set_online) (struct ccw_device *);
|
||||
|
||||
Parameters: cdev - the device to be activated. The common layer has
|
||||
verified that the device is not already online.
|
||||
|
||||
|
||||
set_offline: This function is called by the common I/O layer when the device is
|
||||
de-activated via the 'online' attribute. The driver should shut
|
||||
down the device, but not de-allocate its private data.
|
||||
|
||||
int (*set_offline) (struct ccw_device *);
|
||||
|
||||
Parameters: cdev - the device to be deactivated. The common layer has
|
||||
verified that the device is online.
|
||||
|
||||
|
||||
notify: This function is called by the common I/O layer for some state changes
|
||||
of the device.
|
||||
Signalled to the driver are:
|
||||
* In online state, device detached (CIO_GONE) or last path gone
|
||||
(CIO_NO_PATH). The driver must return !0 to keep the device; for
|
||||
return code 0, the device will be deleted as usual (also when no
|
||||
notify function is registerd). If the driver wants to keep the
|
||||
device, it is moved into disconnected state.
|
||||
* In disconnected state, device operational again (CIO_OPER). The
|
||||
common I/O layer performs some sanity checks on device number and
|
||||
Device / CU to be reasonably sure if it is still the same device.
|
||||
If not, the old device is removed and a new one registered. By the
|
||||
return code of the notify function the device driver signals if it
|
||||
wants the device back: !0 for keeping, 0 to make the device being
|
||||
removed and re-registered.
|
||||
|
||||
int (*notify) (struct ccw_device *, int);
|
||||
|
||||
Parameters: cdev - the device whose state changed.
|
||||
event - the event that happened. This can be one of CIO_GONE,
|
||||
CIO_NO_PATH or CIO_OPER.
|
||||
|
||||
The handler field of the struct ccw_device is meant to be set to the interrupt
|
||||
handler for the device. In order to accommodate drivers which use several
|
||||
distinct handlers (e.g. multi subchannel devices), this is a member of ccw_device
|
||||
instead of ccw_driver.
|
||||
The handler is registered with the common layer during set_online() processing
|
||||
before the driver is called, and is deregistered during set_offline() after the
|
||||
driver has been called. Also, after registering / before deregistering, path
|
||||
grouping resp. disbanding of the path group (if applicable) are performed.
|
||||
|
||||
void (*handler) (struct ccw_device *dev, unsigned long intparm, struct irb *irb);
|
||||
|
||||
Parameters: dev - the device the handler is called for
|
||||
intparm - the intparm which allows the device driver to identify
|
||||
the i/o the interrupt is associated with, or to recognize
|
||||
the interrupt as unsolicited.
|
||||
irb - interruption response block which contains the accumulated
|
||||
status.
|
||||
|
||||
The device driver is called from the common ccw_device layer and can retrieve
|
||||
information about the interrupt from the irb parameter.
|
||||
|
||||
|
||||
1.3 ccwgroup devices
|
||||
--------------------
|
||||
|
||||
The ccwgroup mechanism is designed to handle devices consisting of multiple ccw
|
||||
devices, like lcs or ctc.
|
||||
|
||||
The ccw driver provides a 'group' attribute. Piping bus ids of ccw devices to
|
||||
this attributes creates a ccwgroup device consisting of these ccw devices (if
|
||||
possible). This ccwgroup device can be set online or offline just like a normal
|
||||
ccw device.
|
||||
|
||||
Each ccwgroup device also provides an 'ungroup' attribute to destroy the device
|
||||
again (only when offline). This is a generic ccwgroup mechanism (the driver does
|
||||
not need to implement anything beyond normal removal routines).
|
||||
|
||||
To implement a ccwgroup driver, please refer to include/asm/ccwgroup.h. Keep in
|
||||
mind that most drivers will need to implement both a ccwgroup and a ccw driver
|
||||
(unless you have a meta ccw driver, like cu3088 for lcs and ctc).
|
||||
|
||||
|
||||
2. Channel paths
|
||||
-----------------
|
||||
|
||||
Channel paths show up, like subchannels, under the channel subsystem root (css0)
|
||||
and are called 'chp0.<chpid>'. They have no driver and do not belong to any bus.
|
||||
Please note, that unlike /proc/chpids in 2.4, the channel path objects reflect
|
||||
only the logical state and not the physical state, since we cannot track the
|
||||
latter consistently due to lacking machine support (we don't need to be aware
|
||||
of anyway).
|
||||
|
||||
status - Can be 'online' or 'offline'.
|
||||
Piping 'on' or 'off' sets the chpid logically online/offline.
|
||||
Piping 'on' to an online chpid triggers path reprobing for all devices
|
||||
the chpid connects to. This can be used to force the kernel to re-use
|
||||
a channel path the user knows to be online, but the machine hasn't
|
||||
created a machine check for.
|
||||
|
||||
|
||||
3. System devices
|
||||
-----------------
|
||||
|
||||
Note: cpus may yet be added here.
|
||||
|
||||
3.1 xpram
|
||||
---------
|
||||
|
||||
xpram shows up under sys/ as 'xpram'.
|
||||
|
||||
|
||||
4. Other devices
|
||||
----------------
|
||||
|
||||
4.1 Netiucv
|
||||
-----------
|
||||
|
||||
The netiucv driver creates an attribute 'connection' under
|
||||
bus/iucv/drivers/netiucv. Piping to this attibute creates a new netiucv
|
||||
connection to the specified host.
|
||||
|
||||
Netiucv connections show up under devices/iucv/ as "netiucv<ifnum>". The interface
|
||||
number is assigned sequentially to the connections defined via the 'connection'
|
||||
attribute.
|
||||
|
||||
user - shows the connection partner.
|
||||
|
||||
buffer - maximum buffer size.
|
||||
Pipe to it to change buffer size.
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
|
||||
Date : 2004-Nov-26
|
||||
Author: Gerald Schaefer (geraldsc@de.ibm.com)
|
||||
|
||||
|
||||
Linux API for read access to z/VM Monitor Records
|
||||
=================================================
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
This item delivers a new Linux API in the form of a misc char device that is
|
||||
useable from user space and allows read access to the z/VM Monitor Records
|
||||
collected by the *MONITOR System Service of z/VM.
|
||||
|
||||
|
||||
User Requirements
|
||||
=================
|
||||
The z/VM guest on which you want to access this API needs to be configured in
|
||||
order to allow IUCV connections to the *MONITOR service, i.e. it needs the
|
||||
IUCV *MONITOR statement in its user entry. If the monitor DCSS to be used is
|
||||
restricted (likely), you also need the NAMESAVE <DCSS NAME> statement.
|
||||
This item will use the IUCV device driver to access the z/VM services, so you
|
||||
need a kernel with IUCV support. You also need z/VM version 4.4 or 5.1.
|
||||
|
||||
There are two options for being able to load the monitor DCSS (examples assume
|
||||
that the monitor DCSS begins at 144 MB and ends at 152 MB). You can query the
|
||||
location of the monitor DCSS with the Class E privileged CP command Q NSS MAP
|
||||
(the values BEGPAG and ENDPAG are given in units of 4K pages).
|
||||
|
||||
See also "CP Command and Utility Reference" (SC24-6081-00) for more information
|
||||
on the DEF STOR and Q NSS MAP commands, as well as "Saved Segments Planning
|
||||
and Administration" (SC24-6116-00) for more information on DCSSes.
|
||||
|
||||
1st option:
|
||||
-----------
|
||||
You can use the CP command DEF STOR CONFIG to define a "memory hole" in your
|
||||
guest virtual storage around the address range of the DCSS.
|
||||
|
||||
Example: DEF STOR CONFIG 0.140M 200M.200M
|
||||
|
||||
This defines two blocks of storage, the first is 140MB in size an begins at
|
||||
address 0MB, the second is 200MB in size and begins at address 200MB,
|
||||
resulting in a total storage of 340MB. Note that the first block should
|
||||
always start at 0 and be at least 64MB in size.
|
||||
|
||||
2nd option:
|
||||
-----------
|
||||
Your guest virtual storage has to end below the starting address of the DCSS
|
||||
and you have to specify the "mem=" kernel parameter in your parmfile with a
|
||||
value greater than the ending address of the DCSS.
|
||||
|
||||
Example: DEF STOR 140M
|
||||
|
||||
This defines 140MB storage size for your guest, the parameter "mem=160M" is
|
||||
added to the parmfile.
|
||||
|
||||
|
||||
User Interface
|
||||
==============
|
||||
The char device is implemented as a kernel module named "monreader",
|
||||
which can be loaded via the modprobe command, or it can be compiled into the
|
||||
kernel instead. There is one optional module (or kernel) parameter, "mondcss",
|
||||
to specify the name of the monitor DCSS. If the module is compiled into the
|
||||
kernel, the kernel parameter "monreader.mondcss=<DCSS NAME>" can be specified
|
||||
in the parmfile.
|
||||
|
||||
The default name for the DCSS is "MONDCSS" if none is specified. In case that
|
||||
there are other users already connected to the *MONITOR service (e.g.
|
||||
Performance Toolkit), the monitor DCSS is already defined and you have to use
|
||||
the same DCSS. The CP command Q MONITOR (Class E privileged) shows the name
|
||||
of the monitor DCSS, if already defined, and the users connected to the
|
||||
*MONITOR service.
|
||||
Refer to the "z/VM Performance" book (SC24-6109-00) on how to create a monitor
|
||||
DCSS if your z/VM doesn't have one already, you need Class E privileges to
|
||||
define and save a DCSS.
|
||||
|
||||
Example:
|
||||
--------
|
||||
modprobe monreader mondcss=MYDCSS
|
||||
|
||||
This loads the module and sets the DCSS name to "MYDCSS".
|
||||
|
||||
NOTE:
|
||||
-----
|
||||
This API provides no interface to control the *MONITOR service, e.g. specifiy
|
||||
which data should be collected. This can be done by the CP command MONITOR
|
||||
(Class E privileged), see "CP Command and Utility Reference".
|
||||
|
||||
Device nodes with udev:
|
||||
-----------------------
|
||||
After loading the module, a char device will be created along with the device
|
||||
node /<udev directory>/monreader.
|
||||
|
||||
Device nodes without udev:
|
||||
--------------------------
|
||||
If your distribution does not support udev, a device node will not be created
|
||||
automatically and you have to create it manually after loading the module.
|
||||
Therefore you need to know the major and minor numbers of the device. These
|
||||
numbers can be found in /sys/class/misc/monreader/dev.
|
||||
Typing cat /sys/class/misc/monreader/dev will give an output of the form
|
||||
<major>:<minor>. The device node can be created via the mknod command, enter
|
||||
mknod <name> c <major> <minor>, where <name> is the name of the device node
|
||||
to be created.
|
||||
|
||||
Example:
|
||||
--------
|
||||
# modprobe monreader
|
||||
# cat /sys/class/misc/monreader/dev
|
||||
10:63
|
||||
# mknod /dev/monreader c 10 63
|
||||
|
||||
This loads the module with the default monitor DCSS (MONDCSS) and creates a
|
||||
device node.
|
||||
|
||||
File operations:
|
||||
----------------
|
||||
The following file operations are supported: open, release, read, poll.
|
||||
There are two alternative methods for reading: either non-blocking read in
|
||||
conjunction with polling, or blocking read without polling. IOCTLs are not
|
||||
supported.
|
||||
|
||||
Read:
|
||||
-----
|
||||
Reading from the device provides a 12 Byte monitor control element (MCE),
|
||||
followed by a set of one or more contiguous monitor records (similar to the
|
||||
output of the CMS utility MONWRITE without the 4K control blocks). The MCE
|
||||
contains information on the type of the following record set (sample/event
|
||||
data), the monitor domains contained within it and the start and end address
|
||||
of the record set in the monitor DCSS. The start and end address can be used
|
||||
to determine the size of the record set, the end address is the address of the
|
||||
last byte of data. The start address is needed to handle "end-of-frame" records
|
||||
correctly (domain 1, record 13), i.e. it can be used to determine the record
|
||||
start offset relative to a 4K page (frame) boundary.
|
||||
|
||||
See "Appendix A: *MONITOR" in the "z/VM Performance" document for a description
|
||||
of the monitor control element layout. The layout of the monitor records can
|
||||
be found here (z/VM 5.1): http://www.vm.ibm.com/pubs/mon510/index.html
|
||||
|
||||
The layout of the data stream provided by the monreader device is as follows:
|
||||
...
|
||||
<0 byte read>
|
||||
<first MCE> \
|
||||
<first set of records> |
|
||||
... |- data set
|
||||
<last MCE> |
|
||||
<last set of records> /
|
||||
<0 byte read>
|
||||
...
|
||||
|
||||
There may be more than one combination of MCE and corresponding record set
|
||||
within one data set and the end of each data set is indicated by a successful
|
||||
read with a return value of 0 (0 byte read).
|
||||
Any received data must be considered invalid until a complete set was
|
||||
read successfully, including the closing 0 byte read. Therefore you should
|
||||
always read the complete set into a buffer before processing the data.
|
||||
|
||||
The maximum size of a data set can be as large as the size of the
|
||||
monitor DCSS, so design the buffer adequately or use dynamic memory allocation.
|
||||
The size of the monitor DCSS will be printed into syslog after loading the
|
||||
module. You can also use the (Class E privileged) CP command Q NSS MAP to
|
||||
list all available segments and information about them.
|
||||
|
||||
As with most char devices, error conditions are indicated by returning a
|
||||
negative value for the number of bytes read. In this case, the errno variable
|
||||
indicates the error condition:
|
||||
|
||||
EIO: reply failed, read data is invalid and the application
|
||||
should discard the data read since the last successful read with 0 size.
|
||||
EFAULT: copy_to_user failed, read data is invalid and the application should
|
||||
discard the data read since the last successful read with 0 size.
|
||||
EAGAIN: occurs on a non-blocking read if there is no data available at the
|
||||
moment. There is no data missing or corrupted, just try again or rather
|
||||
use polling for non-blocking reads.
|
||||
EOVERFLOW: message limit reached, the data read since the last successful
|
||||
read with 0 size is valid but subsequent records may be missing.
|
||||
|
||||
In the last case (EOVERFLOW) there may be missing data, in the first two cases
|
||||
(EIO, EFAULT) there will be missing data. It's up to the application if it will
|
||||
continue reading subsequent data or rather exit.
|
||||
|
||||
Open:
|
||||
-----
|
||||
Only one user is allowed to open the char device. If it is already in use, the
|
||||
open function will fail (return a negative value) and set errno to EBUSY.
|
||||
The open function may also fail if an IUCV connection to the *MONITOR service
|
||||
cannot be established. In this case errno will be set to EIO and an error
|
||||
message with an IPUSER SEVER code will be printed into syslog. The IPUSER SEVER
|
||||
codes are described in the "z/VM Performance" book, Appendix A.
|
||||
|
||||
NOTE:
|
||||
-----
|
||||
As soon as the device is opened, incoming messages will be accepted and they
|
||||
will account for the message limit, i.e. opening the device without reading
|
||||
from it will provoke the "message limit reached" error (EOVERFLOW error code)
|
||||
eventually.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user