How to hook up Linux Device Driver in Android Framework?

1,991 views
Skip to first unread message

parth shah

unread,
Jan 26, 2011, 4:01:50 AM1/26/11
to android...@googlegroups.com
Hello Guys,

I'm new to android but i know how to develop device driver in Linux.

Can anybody guide me on how android middle ware basically call driver?

where i have to make the change if i want to make the link between Linux Device Driver and android middle ware?

Regards,
Parth

Chris Stratton

unread,
Jan 28, 2011, 12:53:24 AM1/28/11
to Android Linux Kernel Development
There are tons of different ways you could potentially do this and
make it work, several of which are used for different features
already. The challenge is more that if you hope to get the result of
your project through google CTS testing to become a google experience
device, you'll have to find a way that's compatible with the
applicable rules there, and so will probably need to spend more time
researching those rules than actually writing code.

Otherwise, find some already supported feature that seems like it
shares some key characteristics with what you want to add, look into
how that works, and see if you can do yours in a similar fashion.

parth shah

unread,
Jan 28, 2011, 2:35:17 PM1/28/11
to android...@googlegroups.com
Hi Chris,

Thanks for your reply. I'm not worry about google CTS now.

Can you point me some reference material or website where i can find this detail?

Thanks,
Parth


Chris Stratton

unread,
Jan 28, 2011, 8:22:28 PM1/28/11
to Android Linux Kernel Development
android.git.kernel.org both for the kernel side and the android
userland halves of the interface.

You'll have better luck if you pick a specific existing feature and
research how that works. If you have some familiarity with linux in
general, just browsing around on an android device's filesystem, it's /
dev files, its kernel config, etc will give you some idea of some
interesting places to look.

On Jan 28, 2:35 pm, parth shah <parthmshah2...@gmail.com> wrote:
> Hi Chris,
>
> Thanks for your reply. I'm not worry about google CTS now.
>
> Can you point me some reference material or website where i can find this
> detail?
>
> Thanks,
> Parth
>
> On Thu, Jan 27, 2011 at 9:53 PM, Chris Stratton <cs07...@gmail.com> wrote:
> > There are tons of different ways you could potentially do this and
> > make it work, several of which are used for different features
> > already.  The challenge is more that if you hope to get the result of
> > your project through google CTS testing to become a google experience
> > device, you'll have to find a way that's compatible with the
> > applicable rules there, and so will probably need to spend more time
> > researching those rules than actually writing code.
>
> > Otherwise, find some already supported feature that seems like it
> > shares some key characteristics with what you want to add, look into
> > how that works, and see if you can do yours in a similar fashion.
>
> > On Jan 26, 4:01 am, parth shah <parthmshah2...@gmail.com> wrote:
> > > Hello Guys,
>
> > > I'm new to android but i know how to develop device driver in Linux.
>
> > > Can anybody guide me on how android middle ware basically call driver?
>
> > > where i have to make the change if i want to make the link between Linux
> > > Device Driver and android middle ware?
>
> > > Regards,
> > > Parth
>
> > --
> > unsubscribe: android-kerne...@googlegroups.com<android-kernel%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-kernel
>
>

raja pavan

unread,
Jan 31, 2011, 5:30:30 AM1/31/11
to android...@googlegroups.com
Hi Parth
 
Drivers added by android to the vanila linux kernel can be downloaded, from android kernel.git. (snapshot mode)
 
Download android linux kernel , cd drivers/staging/android and you will see all the android drivers in the folder. (binder, ashmem, alarm, power, apanic,  etc)
 
Also download android sdk source code. source.android.com
 
grep "open_binder", "/dev/ashmem" in the android source code . This will provide you clue on how android utilizes the drivers.
 
Also see this ....
 
Android Java Code -> JNI Calls -> C Code (This will call open, close on the android driver nodes /dev/ashmem, /dev/binder etc)
 
Hope this helps you.
 
Wishes
Raja
 
 


 

--

Chris Stratton

unread,
Jan 31, 2011, 10:32:18 AM1/31/11
to Android Linux Kernel Development
> grep "open_binder", "/dev/ashmem" in the android source code . This will
> provide you clue on how android utilizes the drivers.

While binder is a kernel driver, it's used primarily for communication
between userspace components, not between the userspace components and
functionality in the kernel.

But most functionality in the kernel that is android specific rather
than generic *nix (and even some that is standard but semi privileged)
likely uses binder to connect the application to an android service in
userspace, which in turn uses one of a variety of interface into the
kernel.

raja pavan

unread,
Jan 31, 2011, 12:28:21 PM1/31/11
to android...@googlegroups.com
So please specify your requirement.

What do you want in the android kernel about drivers. 

Android drivers is the common thing, so what else do you want?

Aditya

unread,
Jan 31, 2011, 4:44:07 PM1/31/11
to android...@googlegroups.com
Can you give me some reference materials on writing drivers for video capture devices. I am fairly new to writing drivers. All i know is c, C++ and some very basic file systems hacking on minx from school.
Thanks in Advance

-Aditya
--
Aditya Mukherjee
Rutgers University
Department Of Computer Science

Greg KH

unread,
Jan 31, 2011, 5:11:34 PM1/31/11
to android...@googlegroups.com
On Mon, Jan 31, 2011 at 1:44 PM, Aditya <aditya.s....@gmail.com> wrote:
> Can you give me some reference materials on writing drivers for video
> capture devices. I am fairly new to writing drivers. All i know is c, C++
> and some very basic file systems hacking on minx from school.

Please see the linux-media mailing lists and documentation for how to do this.
Have you tried that first?
All of your questions should be able to be answered by the developers on that
list.

good luck,

greg k-h

Aditya

unread,
Feb 4, 2011, 3:47:42 PM2/4/11
to android...@googlegroups.com
thanks for that ...  sorry didnt reply sooner... was busy at work... i'll try that out.


--

Durgadoss Ramanathan

unread,
Oct 30, 2012, 7:19:05 AM10/30/12
to android...@googlegroups.com
Hi Parth,

Have a look at the system services, and the corresponding JNI's.

To be more specific, (for example,) for battery related information and linking,
look at BatteryService.java and com_android_server_BatteryService.cpp

Thanks,
Durga

On Thu, Oct 25, 2012 at 3:31 AM, Prerna Gupta <prernag...@gmail.com> wrote:
Hi Parth,
 
I do have one rek if you are comfortable kindly send me your resume on pre...@net2source.com

--



--
Regards
Durgadoss
Reply all
Reply to author
Forward
0 new messages