Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jan 2007 01:52:20 +0100
From:      Rene Ladan <r.c.ladan@gmail.com>
To:        freebsd-geom@freebsd.org
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Subject:   Re: xbox360 extension for review/debug
Message-ID:  <45A04444.8010701@gmail.com>
In-Reply-To: <459D766B.9050304@gmail.com>
References:  <74225.1167686662@critter.freebsd.dk> <459D766B.9050304@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <Microsoft Corporation Memory Unit, class 0/0, rev 2.00/1.01, addr 2> 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: <MSFT Memory Unit 1.00> 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: <MSFT Memory Unit 1.00> 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: <Microsoft Corporation Memory Unit, class 0/0, rev 2.00/1.01, addr 2> 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: <MSFT Memory Unit 1.00> 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: <MSFT Memory Unit 1.00> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45A04444.8010701>