LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-27-2001, 11:25 PM   #1
wsimmons
LQ Newbie
 
Registered: Sep 2001
Posts: 10

Rep: Reputation: 0
in whst file is the main () function for the kernel?


I've been going through Linux Progamming White Papers (Coriolis Press) so that I can undrstand more about how the Linux kernel works. The best place to start is with the main () c/c++ function. The book says the initialization prcesses can be found under /usr/src/linux/init/main.c. Well I found that and searched it...I can't find the main () function! It is loaded with precopiler directives but the main () isn't there. Where is it? Also, is that good style?
 
Old 12-28-2001, 03:45 PM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
i should warn you that i don't know what i'm talking about, but i'm pretty sure there isn't one. after all the kernel has to load itself into memory (with the help of lilo or whatever) so it can't just have a simple main() function.

alex
 
Old 12-30-2001, 12:08 AM   #3
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
I think this may be what you are looking for:

/usr/src/linux/arch/i386/boot/tools/build.c

The way in which main is invoked is hardware specific hence the i386.
 
  


Reply



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
How to Override main function in C joeyBig Programming 8 03-19-2018 06:37 AM
How many prototype of function main in c? ypzhuang Programming 9 12-13-2008 07:53 AM
what's the kernel's main() function? LordOfer Linux - General 1 04-06-2005 03:02 PM
Array declaration in class or main function??? redhatrosh Programming 4 03-15-2005 02:13 PM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:19 AM.

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
Open Source Consulting | Domain Registration