LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-05-2010, 06:04 AM   #1
sergioIAM
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, 06:16 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
I think this should be the starting point to you.
 
Old 10-05-2010, 06:16 AM   #3
GrapefruiTgirl
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:
Code:
root@reactor: find /usr/src/source/*35 -type f -name "main.c"

<-- snip -->

/usr/src/source/linux-2.6.35/init/main.c

<-- snip -->

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

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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:

http://www.kroah.com/lkn/
http://www.linuxhq.com/lkprogram.html
 
Old 10-05-2010, 06:38 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

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


Reply


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-14-2009 12:11 AM
i need a starting point :l ach1lles Linux - Newbie 3 08-29-2005 12:06 PM
Need a starting point fits666 Linux - Networking 1 10-31-2004 06:27 AM
Recompiling Kernel - starting point imitchel Linux - Newbie 1 03-01-2004 03:44 PM
Need a starting point halzg Linux - Newbie 1 08-02-2003 09:47 PM


All times are GMT -5. The time now is 04:26 PM.

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