---- The Poqet PC --------------------------------------------------------------
 Home  FAQ  LIST  SOFTWARE  DOCUMENTATION  MUSEUM  LINKS

Poqet PC Mailing List Digest
Volume 002, Number 032, 28 Dec 1997

Table of Contents


 <
Previous (Vol. 002, No. 031)

UP (to archive list)
 >
Next (Vol. 002, No. 033)

  1. How to use SRAM cards with Linux by ahm@xxxxxxxx (Andreas Meyer)

Digest Articles

How to use SRAM cards with Linux by ahm@xxxxxxxx (Andreas Meyer)


From: ahm@xxxxxxxx (Andreas Meyer)
Subject: How to use SRAM cards with Linux
Date: Sat, 27 Dec 1997 15:49:43 -0800 (PST)
Content-Type: text

I'm happy to report that I can now read and write (certain) SRAM cards
on my Linux system!

As previously reported, I bought an ActionTec PC300 PCMCIA Card Reader
from Primary Simulation, Inc. (http://www.psism.com/reader.htm)
It has two PCMCIA slots that mount in any half-height 3.5" floppy bay
and comes with an ISA interface card, cables, and software for Windows 95.

While I have the ability to boot my system into Win95, I was keen to
get this working under Linux, since that's where I spend most of my time.
Basically, I only needed to recompile my kernel (2.0.0) with PCMCIA
support, edit a few key files, and then reboot. BTW, I'm running the
Slackware distribution, but this should work for other distributions
as well.

(Note: you still need to use your PoqetPC to format your SRAM cards).

FILES TO EDIT
-------------
/etc/rc.d/rc.pcmcia:
PCIC=tcic

/etc/pcmcia/pcmem.opts:
I adjusted the case statements so that there is one for each card slot.
Remember to create the directories for mount points.
(I used /d and /e because they were short and easy to remember):

case "$ADDRESS" in
*,0)
    DO_FSTAB="n" ; DO_MOUNT="y"
    FSTYPE="msdos"
    OPTS=""
    MOUNTPT="/d"
    ;;

*,1)
    DO_FSTAB="n" ; DO_MOUNT="y"
    FSTYPE="msdos"
    OPTS=""
    MOUNTPT="/e"
    ;;
esac

/etc/fstab:
Added the following lines:
/dev/pcmem0b    /d       msdos       noauto,user,unhide   0  0
/dev/pcmem1b    /e       msdos       noauto,user,unhide   0  0

HOW IT WORKS
------------
When a card is inserted, it is detected by the "cardmgr" daemon and
the required device files are created.  
You need to mount the card by hand:
$ mount /d
or:
$ mount /dev/pcmem0b -t msdos /d

(You can add lines to /etc/pcmcia/pcmem to have the card mounted
automatically, but the mount is done as root which means you won't
be able to write to it unless you are logged in as root).

Once the card is mounted, you should be able to see manipulate
what's on it using normal Unix commands:

$ ls -l /d
total 72
drwxr-xr-x   2 ahm      users        1024 Sep 19 02:34 an3
-rw-r--r--   1 ahm      users         758 Nov 12 15:15 autoexec.ahm
drwxr-xr-x   2 ahm      users        1536 Oct  9 15:31 bin
-rw-r--r--   1 ahm      users          71 Jan  1  1980 config.ahm
-rw-r--r--   1 ahm      users         142 Nov 25 08:39 notes
-rw-r--r--   1 ahm      users        5833 Sep 24 11:25 people
-rw-r--r--   1 ahm      users         265 Nov  4 14:10 setup.bat
drwxr-xr-x   2 ahm      users         512 Aug 24 17:16 tmp
drwxr-xr-x   2 ahm      users        1536 Aug 24 17:16 util
drwxr-xr-x   2 ahm      users         512 Aug 24 17:16 vi

$ cat /d/autoexec.ahm
@ECHO OFF
PATH=C:\
PROMPT $P$G 
A:
echo.|date|find "Current" > tmp$$$.bat
echo set date=%%4> current.bat
echo set day=%%3>> current.bat
call tmp$$$
if not "%date%"=="1-01-1980" goto rest
date
time
call tmp$$$
:rest
if "%day%"=="Mon" echo Just another manic Monday.
REM if "%day%"=="Tue" echo.
if "%day%"=="Wed" echo The week is half over!
REM if "%day%"=="Thu" echo.
if "%day%"=="Fri" echo Thank God it's Friday!
if "%day%"=="Sat" echo It's the weekend!
if "%day%"=="Sun" echo The weekend's almost over.
if exist tmp$$$.bat del tmp$$$.bat
if exist current.bat del current.bat
set date=
set day=
PATH=A:\BIN;A:\UTIL;C:\
SET LIB=A:\VI
PATH=A:\VI;%PATH%


WEIRDNESS
---------
My main SRAM cards are Panasonic SRAM BN-01MHMC in both 1Mb and 2Mb sizes
and I've had no trouble reading and writing them in this way.  I've also 
been able to use an Apple Newton 1Mb Storage Card.

However, for some reason, I'm unable to get the system to see an Epson 1Mb 
card I've been able to use in the PoqetPC.  
The error in /var/adm/messages is this:

Dec 11 12:17:46 dossier cardmgr[36]: initializing socket 0
Dec 11 12:17:46 dossier cardmgr[36]: unsupported card in socket 0
Dec 11 12:17:47 dossier cardmgr[36]: version info: "SEIKO EPSON", "WWB101EN20"

I think the PCMCIA driver doesn't know how to handle the Epson card.
My other cards come up like this:

Dec 11 12:13:29 dossier cardmgr[36]: socket 0: Anonymous Memory Card
Dec 11 12:13:29 dossier kernel: pcmem_cs: loading 64k memory card 'pcmem0'
Dec 11 12:13:29 dossier cardmgr[36]: executing: '/sbin/insmod /lib/modules/2.0.0/pcmcia/pcmem_cs.o'

Anyway, I hope this is useful to someone. YMMV.

Cheers,
Andy



Filename: PoqetPC/mailing-list/cgi/show-digest.htmt
Date Created: 30 Nov 1996, Last Modified: 13 May 2009
Created by Bryan Mason - E-Mail: poqetpc<at>bmason<dot>com