OpenWindows Advanced User's Guide

Appendix G Using PCMCIA Cards

G.1 Introduction

Personal Computer Memory Card International Association (PCMCIA) cards are rugged, credit card-sized, user-installable devices.

You can use PCMCIA memory cards in the same way as a diskette, but you can store much larger amounts of data on a PCMCIA memory card.

PCMCIA serial and modem cards provide a convienient way to add an RS-232 interface or data/fax modem functionality to your workstation.

PCMCIA cards are available from many vendors. Check with your SunServiceSM provider or the PCMCIA card vendor to determine if a device is compatible with your workstation.

This appendix contains the following sections:

G.1.1 Support Requirements

PCMCIA memory and PCMCIA serial/modem cards must be compliant with PCMCIA release 2.1 or higher.

This Solaris release supports SRAM (Non-Volatile Static Random Acess Memory), DRAM (Dynamic Random Access Memory, and MROM (Memory Read-Only Memory) PCMCIA memory cards.


Note -

This release does not support PCMCIA FLASH, EEPROM, and OTP (One-Time Programmable) PROM cards.


Specifically, this software release supports PCMCIA memory cards that have:

G.1.2 Other Information Sources

Refer to the Hardware Platform Guide and other documents that accompanied the Solaris software for your system to determine if there are any special installation instructions for the PCMCIA device you want to use.

G.2 Using a PCMCIA Memory Card

This section describes general use of PCMCIA Memory Cards, such as protecting any data on them from being accidentally deleted by enabling the write-protect mode, as described in the section titled "G.2.2.1 Enabling Write-Protect Mode".

G.2.1 File Copying Methods

The three sections that follow describe how to format and copy files from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card by the three available methods:

G.2.2 Write-Protect Mode

You can protect data on a PCMCIA memory card from being accidentally deleted by enabling the write-protect mode. As soon as you enable the write-protect mode on a PCMCIA memory card, you are no longer able to copy any data until you disable the write-protect mode.

G.2.2.1 Enabling Write-Protect Mode

    Using a fine-tipped tool (such as a screwdriver), slide the write-protect switch toward the edge of the PCMCIA memory card, as shown in Figure G-1 to enable the write-protect mode.

    Figure G-1 Enabling Write-Protect Mode

    Graphic

G.2.2.2 Disabling Write-Protect Mode

    Using a fine-tipped tool (such as a screwdriver), slide the write-protect switch away from the edge of the PCMCIA memory card, to disable the write-protect mode.

G.2.3 PCMCIA Memory Cards and Power Management's Resume/Suspend Feature

This section provides additional information for systems that have PCMCIA cards and the Power Management software installed. For more information on Power Management, refer to the Using Power Management.


Caution - Caution -

Do not insert or remove a PCMCIA card while your system is suspending or resuming. The PCMCIA card will not be recognized after the resume operation.


If a PCMCIA memory card is managed by Volume Management and the system is suspended, the PCMCIA memory card is automatically unmounted. When the system is resumed, any PCMCIA memory card with a valid file system that is managed by Volume Management is automatically remounted.

If Volume Management is disabled and a PCMCIA card is manually mounted when the system is suspended, the PCMCIA memory card is automatically unmounted. When the system resumes, the PCMCIA memory card is not automatically remounted. If you want to have the PCMCIA memory card mounted again, you must manually remount.

G.3 Copying Files with the tar Command

This is the first of three sections that describe how to format and copy files from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card.


Note -

See the man pages for further information on how to use the cpio or the dump/restore commands.


This section describes the following tasks:

G.3.1 Formatting a PCMCIA Memory Card

Before you can use a PCMCIA memory card, you may need to format it. The fdformat utility allows you to format both diskettes and PCMCIA memory cards.


Caution - Caution -

Formatting deletes any data that may already be resident on a PCMCIA memory card.


To format a PCMCIA memory card:

    Type:

    % fdformat option device_name


    Note -

    The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.


Table G-1 lists the available options for the fdformat utility.

Table G-1 fdformat Utility Options

Option 

Description 

-U

Unmounts the PCMCIA memory card 

-d

Installs an MS-DOS file system (UNIX file system is the default) 

-f

Does not display confirmation messages before starting to format 

-q

Disables print status messages 

-x

Installs a Solaris label or an MS-DOS file system; it does not format the PCMCIA memory card 

-blabel

Specifies a UNIX or MS-DOS label on a PCMCIA memory card 

-t dos

Installs an MS-DOS file system (UNIX file system is the default) 

-B filename

Installs a special boot loader 


Note -

There is no option in the fdformat utility for installing a NEC-DOS file system on a PCMCIA memory card.


If you want to format a PCMCIA memory card, you must specify a device name for the PCMCIA memory card. Otherwise, the fdformat utility automatically specifies the diskette drive as the default device.

The format for a device name of a PCMCIA memory card is

/dev/rdsk/cntndnsn

or

/dev/dsk/cntndnsn.

For example, the device name /dev/dsk/c1t6d0s2 represents a PCMCIA SRAM memory card with a logical socket controller number 1, a technology number 6, and a slice number 2.

Table G-2 list the available device name options for the fdformat utility.

Table G-2 fdformat Utility Device Name Options

Device Name Option 

Description  

-n

Represents a decimal number 

-cn

Represents controller n

-tn

Represents technology region n

0x1 ROM, 0x2 OTPROM, 0x3 EPROM, 

0x4 EEPROM, 0x5 FLASH, 0x6 SRAM, 0x7 DRAM 

-dn

Represents technology region in type n

-sn

Represents slice n (This release supports only one partition on the PCMCIA memory card. Therefore, the partition number sn for the device name must be s2.)

G.3.2 Displaying File Names with the tar Command

You may want to display the file names that are resident on a PCMCIA memory card.

    Type:

    % tar tvf device_name
    

Table G-3 tar Command Options to Display Filenames

Option 

Description 

-t

lists or displays files that are resident on the PCMCIA memory card 

-v

specifies a verbose listing 

-f

specifies an input device name

G.3.3 Copying Files

To copy a file or directory from a PCMCIA memory card to a hard disk or from a hard disk to a PCMCIA memory card, you must have already formatted the PCMCIA memory card (see "G.3.1 Formatting a PCMCIA Memory Card"). In addition, you must have write permission for the destination directory on the hard disk.

If you use the following procedure to copy a file or directory, you preserve the owner, permissions, group, and modification time of the file or directory.


Note -

If you use the tar command to copy files to a PCMCIA memory card, you must use the tar command to extract or copy files from the PCMCIA memory card.


G.3.3.1 Copying Files from a Hard Disk to a PCMCIA Memory Card

  1. Type:

    % cd directory
    

    where directory is the name of the directory in which the files that you want to copy are located.

    For example, to copy the file /home/samples/design, type:

    % cd /home/samples
    

  2. Type:

    % tar cvf device_name filename

    Table G-4 tar Command Options to Copy Files to a PCMCIA Memory Card

    Option 

    Description 

    -c

    creates a backup archive 

    -v

    displays a verbose listing 

    -f

    specifies an input device name 

    For example, to copy the file ./design located on your hard disk to a PCMCIA memory card that has the device name /dev/rdsk/c1t6d0s2, type:

    % tar cvf /dev/rdsk/c1t6d0s2 ./design
    

G.3.3.2 Copying Files from a PCMCIA Memory Card to a Hard Disk

  1. Type:

    % cd directory
    

    where directory is the name of the directory in which the files that you want to copy are located. In this case, the directory is located on the PCMCIA memory card.

    For example, to copy the file /home/samples/design, type:

    % cd /home/samples
    

  2. Type:

    % tar xvfp device_name filename

    Table G-5 tar Command Options to Copy Files from a PCMCIA Memory Card

    Option 

    Description 

    -x

    extracts a backup archive 

    -v

    displays a verbose listing 

    -f

    specifies an input device name 

    -p

    preserves the original modes of the file 


    Caution - Caution -

    If a file or directory with the same name as the one being copied already exists in the working directory, it is automatically overwritten.


    For example, to copy the file ./design from a PCMCIA memory card with an address /dev/rdsk/c1t6d0s2 to the working directory on your hard disk, type:

    % 	
    tar xvfp /dev/rdsk/c1t6d0s2 ./design
    

G.4 Copying Files with Volume Management Enabled

This is the second of three sections that describe different methods for formatting a PCMCIA memory card and to copy files between it and a hard disk. This section describes the way to do such tasks when Volume Management is enabled on your system.


Note -

The PCMCIA memory card is automatically managed by Volume Management. You do not have to become superuser to copy files from your system to the PCMCIA memory card.



Caution - Caution -

After just having removed a PCMCIA memory card from a socket, you should wait for a minimum of two to three seconds before attempting to insert it into another socket. Otherwise, Volume Management may not be able to mount the PCMCIA memory card properly. Should Volume Management be unable to mount the PCMCIA memory card properly, restart the vold daemon or reboot your system, if necessary. Also, if you insert a PCMCIA memory card into a socket and then immediately remove it, Volume Management might no longer recognize that socket. You can solve this problem in the same way--restart the vold daemon or reboot your system, if necessary.


Familiarize yourself with the following:

This section describes the following tasks:

G.4.1 Formatting an Unlabeled PCMCIA Memory Card


Note -

The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.


  1. Insert the PCMCIA memory card into a PCMCIA socket.

  2. Enter a command to format the memory card with the desired file system (UNIX or MS-DOS).

    To format a memory card with an UNIX file system, type the following commands:

    % fdformat vol_alias_device_name
    % newfs /vol/dev/aliases/vol_alias_device_name

    For example, to format a PCMCIA memory card in PCMCIA socket number 0 with a UNIX file system, type the following commands

    % fdformat pcmem0
    % newfs /vol/dev/aliases/pcmem0

    Or, to format a memory card with an MS-DOS file system, type one of the following commands:

    % fdformat -t dos vol_alias_device_name

    or

    % fdformat -d vol_alias_device_name

    For example, to format a PCMCIA memory card in PCMCIA socket number 0 with an MS-DOS file system, type either of the following commands

    % fdformat -d pcmem0
    

    or

    % fdformat -t dos pcmem0
    

  3. Remove and insert the PCMCIA memory card.

    This step is necessary so that the Volume Manager can remount the mounting directory /pcmem/pcmem0.

    Or you can perform the following steps without removing the PCMCIA memory card. Type:

    % eject pcmem0
    % volcheck
    

    The Volume Manager automatically remounts the PCMCIA memory card.

G.4.2 Reformatting a PCMCIA Memory Card

If you have already formatted your PCMCIA memory card, skip this section.

  1. Insert the PCMCIA memory card in the PCMCIA socket.

  2. Enter a command to reformat the memory card with the desired file system (UNIX or MS-DOS).

    To reformat a memory card with an UNIX file system, type the following commands:

    % fdformat -U vol_alias_device_name
    % newfs /vol/dev/aliases/vol_alias_device_name

    For example, to format a PCMCIA memory card in PCMCIA socket number 1with a UNIX file system, type the following commands

    % fdformat pcmem1
    % newfs /vol/dev/aliases/pcmem1

    Or, to reformat a memory card with an MS-DOS file system, type one of the following commands:

    % fdformat -U -t dos vol_alias_device_name

    or

    % fdformat -Ud vol_alias_device_name

    For example, to reformat a PCMCIA memory card in PCMCIA socket number 1 with an MS-DOS file system, type either of the following commands

    % fdformat -d pcmem1
    

    or

    % fdformat -t dos pcmem1
    

  3. Remove and insert the PCMCIA memory card.

    This step is necessary so that the Volume Manager can remount the mounting directory /pcmem/pcmem0.

    Or you can perform the following steps without removing the PCMCIA memory card. Type:

    % eject pcmem0
    % volcheck
    

    The Volume Manager automatically remounts the PCMCIA memory card.

    The following table is a summary of options for the fdformat utility.

    Table G-6 fdformat Utility Options

    Option 

    Description 

    -U

    Unmounts the PCMCIA memory card 

    -d

    Installs an MS-DOS file system (UNIX is the default) 

    -t dos

    Installs an MS-DOS file system (UNIX is the default)

G.4.3 Copying Files

You can use commands such as cp, rm, diff, and ls to copy, remove, compare, and list the directory names for files on a PCMCIA memory card.

G.4.3.1 Copying Files from a Hard Disk to a PCMCIA Memory Card

    Type:

    example% cp filename /pcmem/pcmem0/filename
    

G.4.3.2 Copying Files from a PCMCIA Memory Card to a Hard Disk

    Type:

    example% cp /pcmem/pcmem0/filename /pathname/filename
    

G.4.3.3 Ejecting a PCMCIA Memory Card Using the eject(1) Command

If you want to remove a PCMCIA memory cards while a file system is mounted, you must use the eject(1) command.


Caution - Caution -

Removing a PCMCIA memory card while mounted results in a system panic.


  1. Type:

    % eject vol_alias_device_name

    or type:

    % eject pcmem0

    A Removable Media Manager pop-up is displayed.

  2. Click on the OK button.

  3. Remove the PCMCIA memory card.


    Note -

    If you want to continue using the PCMCIA memory card, leave it in the PCMCIA socket. Use the volcheck(1) command so Volume Manager can remount the PCMCIA memory card. To run this command, type volcheck.


G.5 Copying Files with Volume Management Disabled

This is the third of three sections that describe different methods for formatting a PCMCIA memory card and for copying files between it and a hard disk. This section describes the way to do such tasks when Volume Management is disabled on your system.

This section describes the following tasks:

G.5.1 Disabling Volume Management

  1. Choose Programs » Command Tools from your Workspace menu.

  2. Become superuser by typing:

    example% su
    Password: root_password
    example#

  3. Disable Volume Management by typing:

    # /etc/init.d/volmgt stop
    

G.5.2 Formatting a PCMCIA Memory Card

If you have already formatted your PCMCIA memory card, skip this section.

  1. Insert the PCMCIA memory card in the PCMCIA socket.

  2. Enter a command to format the memory card with the desired file system (UNIX or MS-DOS).


    Note -

    The format utility cannot be used with PCMCIA memory cards. Only the fdformat utility will work.


    To format a memory card with a UNIX file system, type the following commands:

    % fdformat device_name
    % newfs device_name

    For example, to format a PCMCIA memory card in a disk drive with an assigned device name of /dev/dsk/c1t6d0s2, type:

    % fdformat /dev/dsk/c1t6d0s2
    % newfs /dev/dsk/c1t6d0s2
    

    To format a memory card with an MS-DOS file system, type one of the following commands:

    % fdformat -d device_name

    or

    % fdformat -t dos device_name

    For example, to format a PCMCIA memory card in a disk drive with an assigned device name of /dev/dsk/c1t6d0s2, type:

    % fdformat -d /dev/dsk/c1t6d0s2
    

    or

    % fdformat -t dos /dev/dsk/c1t6d0s2
    


    Caution - Caution -

    Removing a PCMCIA memory card while mounted results in a system panic.


G.5.3 Mounting a PCMCIA Memory Card

    Mount a PCMCIA memory card with a UNIX file system by typing:

    # mount mount_directory device_name
    

    If there is no /mnt directory, type:

    example# mkdir /mnt
    

    For example, to mount a UNIX file system in the /mnt directory on a disk drive with an assigned address of c1t6d0s2, type:

    example# mount /dev/dsk/c1t6d0s2  /mnt
    

    Mount a PCMCIA memory card with a MS-DOS file system by typing:

    # mount -F pcfs mount_directory device_name
    

    If there is no /pcfs directory, type:

    example# mkdir /pcfs
    

    For example, to mount an MS-DOS file system in the /pcfs directory on a disk drive with an assigned address of c1t6d0s2, type:

    example# mount -F pcfs  /dev/dsk/c1t6d0s2  /pcfs
    

G.5.4 Copying Files

You can use commands such as cp, rm, diff, and ls, to copy, remove, compare, and list the directory names of files on a PCMCIA memory card.

G.5.4.1 Copying Files from a Hard Disk to a PCMCIA Memory Card

    Type:

    example# cp filename    /pcfs/filename
    

G.5.4.2 From a PCMCIA Memory Card to a Hard Disk

  1. Type:

    example# cp /pcfs/filename    /pathname/filename
    

    If you accidentally remove the PCMCIA memory card while mounted, unmount the mount directory.

  2. Insert the memory card to the PCMCIA socket to unmount the mount directory by typing:

    # umount mount_directory
    

    For example:

    example# umount /pcfs
    

G.5.4.3 Enabling Volume Management

    Enable Volume Management by typing:

    # /etc/init.d/volmgt start
    

G.6 Using a PCMCIA Serial/ModemCard

Refer to the product manual provided with your PCMCIA modem or serial interface card for information about operation of that device.

G.6.1 PCMCIA Serial/Modem Card Device Names

The device names for the PCMCIA serial devices are created in the /dev/term and /dev/cua directories.

The device names are pcN

where N is a PCMCIA socket number.

Eight entries are created in the /etc/remote directory that correspond to the first eight PCMCIA sockets.

G.6.2 PCMCIA Serial/Modem Cards and Power Management's Resume/Suspend Feature

This section provides additional information for systems that have PCMCIA cards and the Power Management software installed. For more information on Power Management, refer to the Using Power Management.


Caution - Caution -

Do not insert or remove a PCMCIA card while your system is suspending or resuming. The PCMCIA card will not be recognized after the resume operation.


If an application is accessing a PCMCIA serial/modem card while the system is being suspended, a HANGUP condition may occur which may cause the application to terminate.

For example, if you used the tip command to access a PCMCIA serial/modem card while trying to suspend your system, the tip command automatically exits when your system resumes. Other applications, such as UUCP or PPP, may try to automatically access the PCMCIA serial or modem card.