|
|
For information about how the Device Kernel Interface works, and information about supported devices, see ``The Device Kernel Interface (lxdevfs)''.
You can add a new device so that it will be accessible from Linux mode only if it is a pass-through device. In some cases, you can add a device and enable its pass-through (read/write) capability, but not features that require a driver to provide control information. For example, you can add a diskette drive and read or write to it using dd(1M), but you cannot format a diskette on this device.
To add a new pass-through device:
#ident "%W%" #ident "$Header: /c/atlas_lx/LKC/UW7/usr/src/uts/fs/lxdevfs/lxdevfs.cf/Space.c, v 1.21 2000/12/01 22:26:48 Exp $"#include <sys/lxdevfs.h>
/* * Please do not modify this table unless you have read the documentation * and understood what changing this tables means. * * The format of this table is as follows: * {LinuxMajor, LinuxMinor, Linux_Name, DeviceClass, UnixWare 7_Name, NODEV} * * LinuxMajor(int) is the major number of the device in Linux. * LinuxMinor(int) is the minor number of the device in Linux. * LinuxName(char *) is the absolute path of the Linux device. * DeviceClass(int) is the type of device. Allowed classes are: * LXDEVFS_UNKNOWN Class not created for this device yet * LXDEVFS_PASSTHRU No behavior mapping * LXDEVFS_TTY TTY behavior * LXDEVFS_PTY Pseudo-terminal behavior * LXDEVFS_PTMX SysV style master pty device * LXDEVFS_PS2MOUSE PS/2 mouse * LXDEVFS_AUDIO Audio devices * LXDEVFS_MIXER * LXDEVFS_DSP * LXDEVFS_SEQ * UnixWare 7_Name(char *) is the absolute path of the equivalent UnixWare 7 * device. * The last field should always be NODEV. * * Note that we map Linux block devices to the UNIX character device /dev/null */ lxdevfs_dev_t lxdevfs_chr_devices[] = { /* /dev/null must be first */ {1, 3, "/dev/null", LXDEVFS_PASSTHRU, "/dev/null", NODEV}, {1, 1, "/dev/mem", LXDEVFS_PASSTHRU, "/dev/mem", NODEV}, {1, 2, "/dev/kmem", LXDEVFS_PASSTHRU, "/dev/kmem", NODEV}, {1, 4, "/dev/port", LXDEVFS_UNKNOWN, "/dev/null", NODEV}, {1, 5, "/dev/zero", LXDEVFS_PASSTHRU, "/dev/zero", NODEV}, {1, 6, "/dev/core", LXDEVFS_UNKNOWN, "/dev/null", NODEV}, . . .
{2, 1, "/dev/fd1", LXDEVFS_PASSTHRU, "/dev/fd1", NODEV},
/etc/conf/bin/idbuild lxdevfs
A device node always has the permissions shown in the UnixWare 7 /dev directory, but you can use the chmod(1) command from either Linux or UNIX mode to change the permissions. Likewise, from either mode you can use chown(1) to change ownership, or chgrp(1) to change the group.