How can the vold detect the SD card insert/remove?

240 views
Skip to first unread message

chungae9ri

unread,
Dec 29, 2009, 3:57:20 AM12/29/09
to android-porting
Hi all.
I am studying the android and now looking into the vold and
MountService/MountListener.
I have a question that how can the vold detect SD card insert/remove?
I can trace that the interrupt handler mmc_rescan(..) in kernel/
drivers/mmc/core/core.c call device_add() but what is the next? How
can the vold daemon know there is an SD card insert/remove interrupt?
I am lost in the relationship between vold daemon and SD insert/remove
intr.

any helps will be appreciated.
thanks in advance.

dmitriy moskvitin

unread,
Dec 30, 2009, 1:33:39 AM12/30/09
to android-porting
Vold use socket(PF_NETLINK, SOCK_DGRAM,NETLINK_KOBJECT_UEVENT)
(vold.c) to receive messages from kernel about add/change/remove
modules. When user insert sd-card, kernel create device object with
name /sys/devices/platform/.../mmcblk0 and send broadcast message to
user space...

이광도

unread,
Dec 31, 2009, 12:43:19 AM12/31/09
to android...@googlegroups.com
thank you. I figured out the communication between user space and kernel with your help.

2009/12/30 dmitriy moskvitin <juffin...@gmail.com>

Reply all
Reply to author
Forward
0 new messages