From owner-freebsd-geom@FreeBSD.ORG Sun Jan 7 00:52:56 2007 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB51C16A412 for ; Sun, 7 Jan 2007 00:52:56 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by mx1.freebsd.org (Postfix) with ESMTP id 7698F13C441 for ; Sun, 7 Jan 2007 00:52:56 +0000 (UTC) (envelope-from r.c.ladan@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so5329882uge for ; Sat, 06 Jan 2007 16:52:55 -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:cc:subject:references:in-reply-to:x-enigmail-version:content-type; b=kg5kwOjVreWT5l/C5vUVtm5lzt8/dLX0cph6/1nOFccXN76kA2hJ95XyNapsM6uE42HFzwpymU1hs1jjH8V02sFoyRCjkiwd+S50MDPM2yFxeBvY7xzlnhQeEmXpUPXiSAbq2MJMsPKyEC4JakE9IJO5jx0+Mt7lk1IQTyBzOqA= Received: by 10.67.89.5 with SMTP id r5mr31603882ugl.1168131143354; Sat, 06 Jan 2007 16:52:23 -0800 (PST) Received: from ?192.168.123.201? ( [195.241.221.201]) by mx.google.com with ESMTP id s1sm31335775uge.2007.01.06.16.52.21; Sat, 06 Jan 2007 16:52:22 -0800 (PST) Message-ID: <45A04444.8010701@gmail.com> Date: Sun, 07 Jan 2007 01:52:20 +0100 From: Rene Ladan User-Agent: Thunderbird 1.5.0.9 (X11/20061224) MIME-Version: 1.0 To: freebsd-geom@freebsd.org References: <74225.1167686662@critter.freebsd.dk> <459D766B.9050304@gmail.com> In-Reply-To: <459D766B.9050304@gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/mixed; boundary="------------010606090005080908030301" Cc: Poul-Henning Kamp Subject: Re: xbox360 extension for review/debug X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jan 2007 00:52:56 -0000 This is a multi-part message in MIME format. --------------010606090005080908030301 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. 2) Trying to kldunload the class before removing the (physical) medium results in g_event going haywire. But this might be on design according to Google. > 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 --------------010606090005080908030301 Content-Type: text/plain; name="xbox360-dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xbox360-dmesg.txt" umass0: on uhub4 umass0:0:0:-1: Attached to scbus0 (probe0:umass-sim0:0:0:0): Down reving Protocol Version from 2 to 0? (probe0:umass-sim0:0:0:0): Uninitialized Transport 5:26? pass0 at umass-sim0 bus 0 target 0 lun 0 pass0: Removable Simplified Direct Access SCSI-0 device pass0: Serial Number \M-{ pass0: 40.000MB/s transfers GEOM: new disk da0 da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Simplified Direct Access SCSI-0 device da0: Serial Number \M-{ da0: 40.000MB/s transfers da0: 62MB (127232 512 byte sectors: 64H 32S/T 62C) # kldload geom_xbox360 mp=0xc5606d60 pp=0xc500c980 mp->name=XBOX360, pp->name=acd0 classname=ACD g_xbox360_taste: size = 8796093020160 mp=0xc5606d60 pp=0xc500cc00 mp->name=XBOX360, pp->name=ad0s2 classname=MBR g_xbox360_taste: size = 79135418880 mp=0xc5606d60 pp=0xc500cd00 mp->name=XBOX360, pp->name=ad0s1 classname=MBR g_xbox360_taste: size = 40896059904 mp=0xc5606d60 pp=0xc500c700 mp->name=XBOX360, pp->name=ad0s2f classname=BSD g_xbox360_taste: size = 70598388224 mp=0xc5606d60 pp=0xc500c200 mp->name=XBOX360, pp->name=ad0s2e classname=BSD g_xbox360_taste: size = 536870912 mp=0xc5606d60 pp=0xc500c300 mp->name=XBOX360, pp->name=ad0s2d classname=BSD g_xbox360_taste: size = 3203399680 mp=0xc5606d60 pp=0xc500c400 mp->name=XBOX360, pp->name=ad0s2c classname=BSD g_xbox360_taste: size = 79135418880 mp=0xc5606d60 pp=0xc500c500 mp->name=XBOX360, pp->name=ad0s2b classname=BSD g_xbox360_taste: size = 4259889152 mp=0xc5606d60 pp=0xc500c600 mp->name=XBOX360, pp->name=ad0s2a classname=BSD g_xbox360_taste: size = 536870912 mp=0xc5606d60 pp=0xc5147580 mp->name=XBOX360, pp->name=da0 classname=DISK g_xbox360_taste: size = 65142784 sectorsize = 512 mp=0xc5606d60 pp=0xc5081c80 mp->name=XBOX360, pp->name=cd0 classname=DISK g_xbox360_taste: size = 0 mp=0xc5606d60 pp=0xc5044500 mp->name=XBOX360, pp->name=ad0 classname=DISK g_xbox360_taste: size = 120034123776 mp=0xc5606d60 pp=0xc5653b00 mp->name=XBOX360, pp->name=da0s1 classname=XBOX360 mp=0xc5606d60 pp=0xc5082100 mp->name=XBOX360, pp->name=da0s2 classname=XBOX360 umass0: at uhub4 port 2 (addr 2) disconnected (da0:umass-sim0:0:0:0): lost device (da0:umass-sim0:0:0:0): removing device entry (pass0:umass-sim0:0:0:0): lost device (pass0:umass-sim0:0:0:0): removing device entry umass0: detached # reattach device with geom_xbox360 still loaded umass0: on uhub4 umass0:0:0:-1: Attached to scbus0 (probe0:umass-sim0:0:0:0): Down reving Protocol Version from 2 to 0? (probe0:umass-sim0:0:0:0): Uninitialized Transport 5:26? pass0 at umass-sim0 bus 0 target 0 lun 0 pass0: Removable Simplified Direct Access SCSI-0 device pass0: Serial Number \M-{ pass0: 40.000MB/s transfers GEOM: new disk da0 mp=0xc5606d60 pp=0xc5bbd380 mp->name=XBOX360, pp->name=da0 classname=DISK g_xbox360_taste: size = 0 <-- should be 65142784 ? da0 at umass-sim0 bus 0 target 0 lun 0 da0: Removable Simplified Direct Access SCSI-0 device da0: Serial Number \M-{ da0: 40.000MB/s transfers da0: 62MB (127232 512 byte sectors: 64H 32S/T 62C) # mdconfig -a -t vnode -f mc360.img , geom_xbox360 still loaded mp=0xc5606d60 pp=0xc5df3280 mp->name=XBOX360, pp->name=md0 classname=MD g_xbox360_taste: size = 65142784 sectorsize = 512 mp=0xc5606d60 pp=0xc534a880 mp->name=XBOX360, pp->name=md0s1 classname=XBOX360 mp=0xc5606d60 pp=0xc5df3a80 mp->name=XBOX360, pp->name=md0s2 classname=XBOX360 --------------010606090005080908030301--