DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
LKP System Management

Adding a device

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.


CAUTION: Incorrect information in the space.c file can cause a system panic. This procedure is intended for use only by experienced users.

To add a new pass-through device:

  1. If a UnixWare 7 device node already exists but there is no equivalent Linux device node, you must first create a Linux node for the device. Use mknod(1M) to create the new Linux device node in /linux/dev. Be sure to specify Linux major and minor numbers for this new node.

  2. Edit /etc/conf/pack.d/lxdevfs/space.c to add the new device. Here is a partial space.c sample file with an explanation of the table format:
       #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}, . . .


    NOTE: All devices controlled by the LKP Device Kernel Interface are listed in the space.c file.

  3. Add information for the new device. For example, if you are adding a second diskette drive to the system you would add:
       {2, 1, "/dev/fd1", LXDEVFS_PASSTHRU, "/dev/fd1", NODEV},
    


    NOTE: The new diskette drive will work only in read/write mode; ioctls will not work. Therefore, formatting a diskette will not work.

  4. Recompile the lxdevfs driver.
       /etc/conf/bin/idbuild lxdevfs
    

  5. Reboot the system.

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.


Next topic: Configuring a PATH variable
Previous topic: Enabling Linux rc.d Scripts

© 2002 Caldera International, Inc. All rights reserved.
UnixWare 7 Release 7.1.3 - 17 October 2002