Re: About partition scheme.
Re: About partition scheme.
- Subject: Re: About partition scheme.
- From: "Li Flost.Dexiong" <email@hidden>
- Date: Wed, 04 Jul 2012 20:54:12 +0800
在 2012-7-4,下午8:34, Phil Jordan 写道:
> On Wed, Jul 4, 2012 at 2:17 PM, Li Flost.Dexiong <email@hidden> wrote:
>> [Flost]: I had once try to init my newMedia using true as the "isWhole" argument. but this will cause the system panic.
>
> I've successfully written drivers which pass true for the isWhole
> argument. It works.
[Flost] Does your device match your driver still show that #0 and #1 on one disk?
> Your panic is probably caused by multiple
> instances of your partition scheme stacking on top of each other:
>
> - disk1 is inserted and starts matching
> - your partition scheme matches on disk1
> - the condition in your probe() is fulfilled by disk1
> - your partition scheme start()s and creates a new "whole" IOMedia object, disk2
> - disk2 appears and starts matching
> - your partition scheme matches on disk2
> - the condition in your probe() is fulfilled by disk2
> - your partition scheme start()s and creates a new "whole" IOMedia object, disk3
>
> etc. etc.
>
> Until you run out of some resource.
>
> Basically, your probe() shouldn't succeed for disk2, but it does.
> That's where your bug is (one of them anyway).
>
>> on line 565, if i set the false to true, the system got panic when my disk was insert into the system.
>
> The panic probably doesn't happen on line 565 itself. I suggest using
> 2-machine debugging and synchronous kprintf logging. It really helps.
[Flost]: Does this 2-mahines debugging method enable a runtime debugging?
If yes, what can I refer to?
>
>> or some way to prevent the #0 to be created?
>
> Let's assume the disk you are inserting is a USB stick. When you
> insert it, the USB storage driver creates a new storage object, which
> generates a IOMedia object named "disk1". This is the "#0" you are
> seeing. Your driver hasn't even loaded at this point. When your filter
> scheme matches on disk1, you have 2 options for creating IOMedia
> objects:
>
> isWhole = true: your IOMedia objects will be named "disk2", "disk3",
> etc. and look like "whole" physical devices.
> isWhole = false: your IOMedia objects will be named "disk1s1",
> "disk1s2", etc. and look like partitions.
>
> You can't just "get rid of" disk1 as that's not generated in your
> code, and is in fact the provider to your filter scheme. You NEED it
> to exist.
[Flost]: yes, I'd think about this before. but a saw that the disk labeled by Xsan was shown as below:
/dev/disk9
#: TYPE NAME SIZE IDENTIFIER
0: Apple_Xsan_Component *5.4 GB disk9
It didn't show the two # . how does this to be understood?
>
> HTH
> phil
Best regards,
Flost.D.Li
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden