[Fwd: pp->mediasize == 0 when reattaching physical medium ?]

Rene Ladan r.c.ladan at gmail.com
Sun Jan 7 12:25:54 PST 2007



-------- Originele bericht --------
Onderwerp: pp->mediasize == 0 when reattaching physical medium ?
Datum: Sun, 07 Jan 2007 15:30:12 +0100
Van: Rene Ladan <r.c.ladan at gmail.com>
Aan: freebsd-geom at freebsd.org
CC: Poul-Henning Kamp <phk at phk.freebsd.dk>
Referenties: <74225.1167686662 at critter.freebsd.dk>
<459D766B.9050304 at gmail.com> <45A04444.8010701 at gmail.com>

Rene Ladan schreef:
> Rene Ladan schreef:
>> Poul-Henning Kamp schreef:
>>> In message <45996C4F.8070700 at gmail.com>, Rene Ladan writes:
>>>> Hi,
>>>>
>>>> I've written an extension to /sys/geom/geom_mbr.c to slice up xbox360
>>>> hard disks and memory units.  The patch for revision 1.68 (i.e. CURRENT)
>>>> is at http://home.tisali.nl/rladan/freebsd/geom_mbr.c.diff
>>> This is wrong, you should make a geom_xbox360 class instead.
>>>
>> Ok, I made a geom_xbox360 class and restored geom_mbr.c
>>
>> The new class consists of three files at the above website.
>>
>> geom_xbox360.c : the class, put it in /sys/geom
>> geom_xbox360::Makefile : Makefile for /sys/modules/geom/geom_xbox360/
>> Makefile.diff : patch for /sys/modules/geom/Makefile
>>
>>
> I've uploaded a new version of geom_xbox360.c.  The class now works
> correctly except for:
> 
> 1) If you kldload the class and plug in a physical medium afterwards,
> then pp->mediasize == 0 so the taste function fails.  This does not
> happen if the medium is plugged in before the kldload or when using dd
> images using mdconfig.  I think that the taste function is called before
> the physical medium (here da0) is properly initialized.  MBR media don't
> suffer from this because mbr_taste() doesn't check pp->mediasize.  A
> dmesg is attached.
> 
I am able to reproduce this with a standard USB 1 memory stick.  The
medium is
correctly tasted when kldloading after the medium is plugged in, or when the
class is kldloaded and you finish making the stick look like an xbox360
medium.

I've uploaded a new version of the class, which enables experimenting
with a normal USB stick. See the note at lines 53-56 of geom_xbox360.c
Note that this extra experimenting code really doesn't belong in the
class, so I'll remove it sooner or later.

It might be related to usb/80361, usb/89954 (the 'size 0' part of the
description), and usb/97175.  This suggests that someone(tm) needs to
take a look at umass(4).

Regards,
Rene
-- 
GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6
(subkeys.pgp.net)

"It won't fit on the line."
		-- me, 2001



-- 
GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6
(subkeys.pgp.net)

"It won't fit on the line."
		-- me, 2001



More information about the freebsd-usb mailing list