Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Feb 2010 23:28:27 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org, Polytropon <freebsd@edvax.de>
Subject:   Re: Detecting cards in USB card reader
Message-ID:  <201002062328.27744.jmc-freebsd2@milibyte.co.uk>
In-Reply-To: <20100206192540.bb4ce11b.freebsd@edvax.de>
References:  <201002061511.11639.jmc-freebsd2@milibyte.co.uk> <20100206192540.bb4ce11b.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 06 February 2010, Polytropon wrote:

> I can understand this. Maybe accessing the "SCSI layer" of
> the card reader can help? If
>
> =A0=A0=A0=A0=A0=A0=A0=A0% camcontrol reset all
>
> will cause the same effect (of creating the correct nodes in
> /dev), you can be more precise (e. g. just reset da0); see
>
> =A0=A0=A0=A0=A0=A0=A0=A0% man camcontrol
>
> for further (and maybe more elegant) details.

Neither reset nor rescan have any effect with camcontrol. Without a=20
suitable incantation like 'cat /dev/null > /dev/da0' I just=20
have /dev/da0 but no /dev/da0s1 after inserting a card. The system=20
knows that the media is there, "fdisk /dev/da0" can see the slice even,=20
but there's no device node for it.

This is what happens after inserting a 16MB card in the reader:

curlew:/root# ls -l /dev/da0*
crw-r-----  1 root  operator    0, 176  6 Feb 23:15 /dev/da0
curlew:/root# fdisk /dev/da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=3D15 heads=3D64 sectors/track=3D32 (2048 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=3D15 heads=3D64 sectors/track=3D32 (2048 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 1 (0x01),(Primary DOS with 12 bit FAT)
    start 32, size 31264 (15 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 488/ head 1/ sector 32
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
curlew:/root# ls -l /dev/da0*
crw-r-----  1 root  operator    0, 176  6 Feb 23:15 /dev/da0

Still no device for slice 1 until after I attempt to open da0 for=20
writing:

curlew:/root# cat /dev/null > /dev/da0
curlew:/root# ls -l /dev/da0*
crw-r-----  1 root  operator    0, 176  6 Feb 23:15 /dev/da0
crw-r-----  1 root  operator    0, 129  6 Feb 23:18 /dev/da0s1

I can use this to initialise the card reader but I'd feel more=20
comfortable with something a bit less dangerous looking.

=2D-=20
Mike Clarke



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002062328.27744.jmc-freebsd2>