Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-05-2010, 05:04 AM   #1
LQ Newbie
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
what is the starting point of the kernel

OK, I have been a lifelong windows programmer and user. I started using the Linux OS as my primary desktop OS a few months ago.

I decided it would be a good time to focus on programming more for linux than windows.
I have downloaded the source code of the Linux kernel. and to avoid me waisting time figuring this out on my own I would like someone to answer me this question.

what is the starting point of the kernel, which file(usually a main.c file)contains the very first line of code executed when the boot-loader starts Linux.

Thanks in advance for any reply.
Old 10-05-2010, 05:16 AM   #2
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,145
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
I think this should be the starting point to you.
Old 10-05-2010, 05:16 AM   #3
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
If you're looking for a main.c in the kernel, there are 31 of them (in kernel 2.6.35) but if any of them is the one you may be looking for, it's in the directory called "init", in the kernel sources:
root@reactor: find /usr/src/source/*35 -type f -name "main.c"

<-- snip -->


<-- snip -->

root@reactor: find /usr/src/source/*35 -type f -name "main.c" | wc -l
Old 10-05-2010, 05:23 AM   #4
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
I doubt finding a main.c file in the kernel tree will help you at all, though. If you want to start hacking the linux kernel you should probably first read the Linux kernel in a nutshell volume, then look around for module programming guides and go on from there:
Old 10-05-2010, 05:38 AM   #5
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,873

Rep: Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190Reputation: 2190
13 and a half million lines of code - and you want to read it all ... good luck.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
new laptop kernel starting point rob.rice Linux - Laptop and Netbook 2 07-13-2009 11:11 PM
i need a starting point :l ach1lles Linux - Newbie 3 08-29-2005 11:06 AM
Need a starting point fits666 Linux - Networking 1 10-31-2004 05:27 AM
Recompiling Kernel - starting point imitchel Linux - Newbie 1 03-01-2004 02:44 PM
Need a starting point halzg Linux - Newbie 1 08-02-2003 08:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration