Hi, Jerry Juan~

well, let's rock:
1. kernel mmc/sd driver -> I have better assign with eMMC different
major number. That's just for debug + you remove some side effects in
vold.
2. system level: vold
    2.1 which vold do you use? I'll told about /platform/system/core/
vold.
    2.2 focus on "volume_t" structure. it's the main structure of the
vold.
        so, multi devices -> multi objects of the volume_t
structure.
    2.3  media_type of your eMMC should be "media_mmc". check
uevent.c::handle_block_event().
    2.4 Think how to application level, such as
com.android.providers.media and com.android.settings.deviceinfo will
use your resources. I mean, you have to modify notification/command
system, which linked system and framework level . You can see the part
of this system in cmd_dispatch.c.
3. I explain determination/mount mechanism:
    1. user insert sd card;
    2. mmc/sd driver recognize it, make device object for every
partitions with unique combination of MAJOR:MINOR numbers and generate
uevent.
    3. uevent come to user-level via kernel socket
NETLINK_KOBJECT_UEVENT
    4. vold handle this uevent in uevent.c::handle_block_event()
    5. vold read boot-sector to determine, how many partitions remains
on the storage.
    6. if all partitions founded, vold will start "mount" procedure
    7. if mount succesfully finished, vold send "volume_mounted:/
sdcard" message to com.android.server.MountListener.
    8. com.android.server.MountListener provide socket connection for
the vold from framework side.
    9. com.android.server.MountListener dispatch mesage to
com.android.server.MountService by handleEvent() method.
    10. com.android.server.MountService provide to framework logical
interpetation of vold actions, such as update icon notifications and
forward command from user to the vold.
    11. So, in our case, MountService::notifyMediaMounted () will
generate Intent.ACTION_MEDIA_MOUNTED.
    12 By this intent, will started
com.android.providers.media.MediaScanner, which will searching media
content and make database. And com.android.settings.deviceinfo.Memory
will update memory status.
4. also, I suggest to you port or develop solution based on fs/
innotify. to watching for android os activity. as additional, you can
use the next patch to determine wich process make an action.
http://lwn.net/Articles/307536/  "Use pid in inotify events."

    Best regards, Dmitriy.

On 12 апр, 11:00, Jerry Juan <[email protected]> wrote:
> Hi Dmitry,
>
> Thanks for your clarification. It help us a lot to know about the
> problems.
> For vold patch, could you help to point out where need to be patched?
> As I know, the state(add/remove/change...) is only one variable, any
> other parts need to be patched?
> Thanks for your kindly help.
>
> On 4月9日, 下午11時16分, dmitriy moskvitin <[email protected]> wrote:
>
>
>
> > Hi, Jerry Juan~
> > Very intresting task....
> > Well, to manage 2 sd-card at the same time:
> > 1. patchvoldin several places, to allow it manage multi-devices at
> > same time. But,voldis just "tip of the iceberg"
> > 2. patch/add a loooot of component on framework level. As there are
> > located the main concept of sd-card usage in Android OS.
> > 3. and as last, you have to read the next thread. 
> > ;)http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > Best regards,
> > Dmitry.
>
> > On 9 апр, 12:26, Jerry Juan <[email protected]> wrote:
>
> > > Really? It seems the source code only support one MMC device in the
> > > same time.
> > > And the state follow first MMC device, that should bethe reason of why
> > > the eMMC can't be mounted when SD card is inserted.
>
> > > I am still finding the solution for this case.
> > > I can't let eMMC work withVOLDwhen SD card is inserted.
>
> > > On 4月8日, 下午10時21分, Deva R <[email protected]> wrote:
>
> > > > Hi,
> > > > I was also told that, android cant dynamically support two MMC/SD
> > > > cards.,  and android always treats boot device as single flash device
> > > > (assumes nand).
> > > > Curious to know why/how its like this..
> > > > -Deva
>
> > > > On Thu, Apr 8, 2010 at 11:34 AM, Jerry Juan <[email protected]> wrote:
> > > > > Hello all,
>
> > > > > My device got two MMCdevice, one is eMMC the other is for SD card.
> > > > > It seemsvoldcan't mount eMMC when SD card is exist.
> > > > > Myvold.conf want to use eMMC to replace SD card.  SD card will be
> > > > > used for other purpose
>
> > > > > When the SD card is exist, eMMC can't be mounted automatically. It
> > > > > shows below log.
> > > > > D/MountListener(   59): handleEvent volume_nomedia:/sdcard
> > > > > D/MountListener(   59): handleEvent ums_disabled
> > > > > D/MountListener(   59): handleEvent ums_disconnected
>
> > > > > When SD card is not exist, thevoldmount eMMC successfully.
> > > > > Does anyone met this problem?
>
> > > > > BTW, it seems the MountListener.java only can handle one device,
> > > > > right?
> > > > > Anyone have experience to handle above two MMC device viavold?
>
> > > > > --
> > > > > unsubscribe: [email protected]
> > > > > website:http://groups.google.com/group/android-porting
>
> > > > > To unsubscribe, reply using "remove me" as the subject.

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to