* From which point onwards the kernel execution starts
@ 2011-03-05 5:42 AQ Tast
2011-03-05 8:26 ` Mulyadi Santosa
0 siblings, 1 reply; 7+ messages in thread
From: AQ Tast @ 2011-03-05 5:42 UTC (permalink / raw)
To: kernelnewbies
Hello Everyone,
I am studying bootloaders and wanted to know which function exactly the
kernel starts from , i.e. where is the main function?
I been through the init/main.c file and I think most likely this is the
file. Could someone please explain how the kernel initializes, i.e. I
want to know how does kernel starts from main function
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-05 5:42 From which point onwards the kernel execution starts AQ Tast
@ 2011-03-05 8:26 ` Mulyadi Santosa
2011-03-05 10:41 ` Andrzej Kardas
0 siblings, 1 reply; 7+ messages in thread
From: Mulyadi Santosa @ 2011-03-05 8:26 UTC (permalink / raw)
To: kernelnewbies
On Sat, Mar 5, 2011 at 12:42, AQ Tast <tasteaq@gmail.com> wrote:
> Could someone please explain how the kernel initializes, i.e. I
> want to know how does kernel starts from main function
http://www.ibm.com/developerworks/linux/library/l-linuxboot/
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-05 8:26 ` Mulyadi Santosa
@ 2011-03-05 10:41 ` Andrzej Kardas
2011-03-06 8:01 ` Mulyadi Santosa
0 siblings, 1 reply; 7+ messages in thread
From: Andrzej Kardas @ 2011-03-05 10:41 UTC (permalink / raw)
To: kernelnewbies
On Sat, Mar 5, 2011 at 12:42, AQ Tast <tasteaq@gmail.com> wrote:
>> Could someone please explain how the kernel initializes, i.e. I
>> want to know how does kernel starts from main function
> http://www.ibm.com/developerworks/linux/library/l-linuxboot/
>
It's quite good article at start, but it is a bit old and doesn't cover
the newest kernel. If you want to get the details i suggest read great
post on Gustawo Duarte blog:
http://duartes.org/gustavo/blog/post/kernel-boot-process
Very useful is Makefile
http://lxr.linux.no/#linux+v2.6.37.2/Makefile
you can trace kernel building process step by step and see what files
are linking into kernel in which order.
On the other hand, you have always up to date documentation of Kernel
Boot Process in documentation directory in kernel sources:
http://lxr.linux.no/#linux+v2.6.37.2/Documentation/x86/boot.txt
If you want to trace linux boot process in source code, you probably
want to start at line:
_start:
# Explicitly enter this as bytes, or the assembler
# tries to generate a 3-byte jump here, which causes
# everything else to push off to the wrong offset.
.byte 0xeb # short (2-byte) jump
.byte start_of_setup-1f
in arch/x86/boot/header.S
(http://lxr.linux.no/#linux+v2.6.37.2/arch/x86/boot/header.S#L108_) for
x86 architecture.
Have fun in exploring :)
--
regards,
Andrzej Kardas
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-05 10:41 ` Andrzej Kardas
@ 2011-03-06 8:01 ` Mulyadi Santosa
2011-03-06 10:26 ` Andrzej Kardas
0 siblings, 1 reply; 7+ messages in thread
From: Mulyadi Santosa @ 2011-03-06 8:01 UTC (permalink / raw)
To: kernelnewbies
Hi :)
On Sat, Mar 5, 2011 at 17:41, Andrzej Kardas <andrzej-kardas@o2.pl> wrote:
> It's quite good article at start, but it is a bit old and doesn't cover
> the newest kernel. If you want to get the details i suggest read great
> post on Gustawo Duarte blog:
>
> http://duartes.org/gustavo/blog/post/kernel-boot-process
Wow!!!! great blog post there... a must read for me and possibly the
rest of all newbies here....
Oh and I forgot my usual tips in such case: use qemu...attach gdb to
qemu's gdb stub.... use -s and -S options...it will stop the guest
invocation right from the initial startup. Assuming you compile guest
kernel with frame pointer and sufficient debug symbols, it would be
easy for you to explore the kernel code :)
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-06 8:01 ` Mulyadi Santosa
@ 2011-03-06 10:26 ` Andrzej Kardas
2011-03-07 16:18 ` Mulyadi Santosa
0 siblings, 1 reply; 7+ messages in thread
From: Andrzej Kardas @ 2011-03-06 10:26 UTC (permalink / raw)
To: kernelnewbies
On 06.03.2011 09:01, Mulyadi Santosa wrote:
>
> Oh and I forgot my usual tips in such case: use qemu...attach gdb to
> qemu's gdb stub.... use -s and -S options...it will stop the guest
> invocation right from the initial startup. Assuming you compile guest
> kernel with frame pointer and sufficient debug symbols, it would be
> easy for you to explore the kernel code :)
>
Let me add some stuff to Your tips :). If we talking about qemu and gdb,
if somebody doesn't like console-oriented tools (who doesn't ?? :) ),
anyway there is possibility to use qemu and gdb with very popular IDE -
Eclipse and trace execution of kernel code with "magnificent graphical
interface".
The recipe how configure Eclipse + qemu + gdb :
http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html
--
regards
Andrzej Kardas
http://www.linux.mynotes.pl
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-06 10:26 ` Andrzej Kardas
@ 2011-03-07 16:18 ` Mulyadi Santosa
2011-03-08 8:13 ` Ashwath
0 siblings, 1 reply; 7+ messages in thread
From: Mulyadi Santosa @ 2011-03-07 16:18 UTC (permalink / raw)
To: kernelnewbies
On Sun, Mar 6, 2011 at 17:26, Andrzej Kardas <andrzej-kardas@o2.pl> wrote:
> The recipe how configure Eclipse + qemu + gdb :
>
> http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html
oh my gooodnesss ! that's great...thanks for sharing.... :)
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* From which point onwards the kernel execution starts
2011-03-07 16:18 ` Mulyadi Santosa
@ 2011-03-08 8:13 ` Ashwath
0 siblings, 0 replies; 7+ messages in thread
From: Ashwath @ 2011-03-08 8:13 UTC (permalink / raw)
To: kernelnewbies
Thanks a lot :) had been looking for a long time...
On Mon, Mar 7, 2011 at 9:48 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:
> On Sun, Mar 6, 2011 at 17:26, Andrzej Kardas <andrzej-kardas@o2.pl> wrote:
> > The recipe how configure Eclipse + qemu + gdb :
> >
> >
> http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html
>
> oh my gooodnesss ! that's great...thanks for sharing.... :)
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110308/088e9e6d/attachment.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-08 8:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 5:42 From which point onwards the kernel execution starts AQ Tast
2011-03-05 8:26 ` Mulyadi Santosa
2011-03-05 10:41 ` Andrzej Kardas
2011-03-06 8:01 ` Mulyadi Santosa
2011-03-06 10:26 ` Andrzej Kardas
2011-03-07 16:18 ` Mulyadi Santosa
2011-03-08 8:13 ` Ashwath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).