LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Study about Kernel bootup.. (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/study-about-kernel-bootup-4175415521/)

manoj7410 07-08-2012 04:20 AM

Study about Kernel bootup..
 
hi..
I want to know the complete boot process of linux kernel after the step of bringing the kernel image into the RAM.
.
.
I mean, I have studied about first stage/middilestage and second stage boot loaders... but what happens inside the RAM with kernel image.. who starts the kernel??
I came to know that init/main.c is the source for it..
.
.
Can I get some links to study about it... ??

Thanks

Maddy

pixellany 07-08-2012 05:45 AM

Google is your friend:
http://www.google.com/search?q=linux...ient=firefox-a

short answer: kernel is loaded into RAM and de-compressed, then the boot loader transfers control to the kernel. The kernel then calls "init"

manoj7410 07-08-2012 06:43 AM

Quote:

Originally Posted by pixellany (Post 4722065)
Google is your friend:
http://www.google.com/search?q=linux...ient=firefox-a

short answer: kernel is loaded into RAM and de-compressed, then the boot loader transfers control to the kernel. The kernel then calls "init"

Thanks but I already know that... I want to know how exactly init started..??

pixellany 07-08-2012 06:46 AM

???
the kernel issues the "init" command, and the init program starts running. It uses /etc/inittab to set specific configurations.

Or maybe I don't understand your question.......

manoj7410 07-08-2012 06:53 AM

Quote:

Originally Posted by pixellany (Post 4722091)
???
the kernel issues the "init" command, and the init program starts running. It uses /etc/inittab to set specific configurations.

Or maybe I don't understand your question.......

My question is:
my second stage boot loadar fetches the kernel and put it into RAM, Now very first task that happens is start_kernel(). That is available in kernel/init/main.c .... I want to understand the working of the start_kernel()... I think it will be clear to you now..
.

pixellany 07-08-2012 07:02 AM

OK---it seems that you are reading the source code. (You have more patience than I do....)

I will GUESS that the function "start_kernel()" will either call "init"--or it will call some other function which in turn calls init.

Have you read any of the links that Google found? If the answer is not there, then your options include:
---read the source code
---buy a book on the kernel---eg this one: http://www.google.com/url?sa=t&rct=j...PTDaEA&cad=rja

manoj7410 07-08-2012 07:12 AM

Quote:

Originally Posted by pixellany (Post 4722101)
OK---it seems that you are reading the source code. (You have more patience than I do....)

I will GUESS that the function "start_kernel()" will either call "init"--or it will call some other function which in turn calls init.

Have you read any of the links that Google found? If the answer is not there, then your options include:
---read the source code
---buy a book on the kernel---eg this one: http://www.google.com/url?sa=t&rct=j...PTDaEA&cad=rja

thanks..
you are right about involking init through start_kernel().. but starting init is the last step of start_kernel().. What happens before that..??
No one is helping me...
.
.
Even books are not defining it. every place is providing the code of internal functions but not the theortical functionality of those functions. well,
thanks again.

pixellany 07-08-2012 10:44 AM

If it's not in the books, then you may just have to hunker down and read the code. Without really knowing anything about the kernel, I'll guess that the early stages are all about detecting hardware, setting up drivers, and initializing data structures in RAM. I would be surprised if a good book on the kernel did not give some flow charts to show what is happening.


All times are GMT -5. The time now is 01:20 PM.