-2

I am interested in developing kernel for android phones. I searched on internet about android kernel development and i got how to build kernel on linux machine means only how to use tools for create a custom kernel but i want to know how to write code to make android kernel. How to start with c programming and ALP. Please guide me.

1 Answers1

1

Android uses Linux kernel and that is why you should get familiar with Linux first.

From you post I am guessing that you don't know much of C programming language. Before you start doing any kernel work you should be able to write an application in C because if you cannot write an application you probably will not understand a kernel.

To start leaning C there are dozens of resources everywhere, I would recommend the book "C programming language" by Brian W. Kernighan. and Denis M. Ritchie (inventor of C).

Application runs in so called "User mode" and have only access to Virtual Memory that is given to them by the kernel. If the application tries to access memory that is not in its Virtual Space the kernel sends an abort signal. This prevents the system from crashing. In kernel the is not the case because the kernel runs in "Kernel mode" and thus has access to the whole address space when you do something wrong the consequences can range from halting the system to wiping permanent storage and more.

So first learn how to write applications, maybe a native applications, try to use the functionality that is provided by the kernel by learning about "System calls". For this purpose I would recommend the books "Advanced Linux Programming" by Mark Mitchel, it is freely hosted on its website http://advancedlinuxprogramming.com/. You can find some reference here https://en.wikibooks.org/wiki/The_Linux_Kernel.

If you are comfortable with both C and the Services the Linux kernel provides. Than you can start thinking about diving into the kernel. Very popular book is "Linux kernel development" by Robert Love. Although I don't think it is very up to date It should cover the major topics related to that subject,there are probably resources out there that are more up to date.

This is a long journey and you should really think about it first, depending on what you want to do you may actually be able to do it in "User Space".

Strong will
  • 556
  • 4
  • 9
  • Thank you for reply. I know c programming up to pointer structure data handling memory management file operation etc. But i don't know about services as u told. is this enough to start linux kernel development – Rajesh Dubey Jul 20 '17 at 19:02
  • If I was you I would master C and look through the links I have shown you. Write few applications and when you feel up to it get a book about the kernel and always look up things you don't understand. You should also choose a specific part of the kernel, for example do you want to write a device driver or a files system ? It is very hard to guide you because there are a lot of factors. – Strong will Jul 20 '17 at 20:25
  • First i will master C then i will go for kernel. Thank you once again – Rajesh Dubey Jul 20 '17 at 20:59