From owner-freebsd-usb@FreeBSD.ORG Sun Jan 7 20:25:54 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56E1B16A47B for ; Sun, 7 Jan 2007 20:25:54 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id C6FC013C4A9 for ; Sun, 7 Jan 2007 20:25:52 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so8608143nfc for ; Sun, 07 Jan 2007 12:25:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:x-enigmail-version:content-type:content-transfer-encoding; b=FldYiVf4f/MYkT9ZXN5f1aK5nG4g4vwhzNZmaOTU4a+/k5efpcSD5AOxw2doSLXHT6l8FjOLFq1PzkZEDb+g/qzWPHrH+lMF5eYDgQcjGzwaMBD1GTCY2TiCtvTVdrUC91TExma3NUkrV5cnosYz2YU0ePF5pcwdQP3yYEi0Nbs= Received: by 10.48.230.20 with SMTP id c20mr28002488nfh.1168199963909; Sun, 07 Jan 2007 11:59:23 -0800 (PST) Received: from ?192.168.123.201? ( [195.241.221.201]) by mx.google.com with ESMTP id r33sm104625486nfc.2007.01.07.11.59.22; Sun, 07 Jan 2007 11:59:23 -0800 (PST) Message-ID: <45A15119.8060008@gmail.com> Date: Sun, 07 Jan 2007 20:59:21 +0100 From: Rene Ladan User-Agent: Thunderbird 1.5.0.9 (X11/20061224) MIME-Version: 1.0 To: freebsd-usb@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Fwd: pp->mediasize == 0 when reattaching physical medium ?] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 20:25:54 -0000 -------- Originele bericht -------- Onderwerp: pp->mediasize == 0 when reattaching physical medium ? Datum: Sun, 07 Jan 2007 15:30:12 +0100 Van: Rene Ladan Aan: freebsd-geom@freebsd.org CC: Poul-Henning Kamp Referenties: <74225.1167686662@critter.freebsd.dk> <459D766B.9050304@gmail.com> <45A04444.8010701@gmail.com> Rene Ladan schreef: > Rene Ladan schreef: >> Poul-Henning Kamp schreef: >>> In message <45996C4F.8070700@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