LinuxQuestions.org
Help answer threads with 0 replies.
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 04-05-2005, 10:54 AM   #1
LordOfer
LQ Newbie
 
Registered: Jul 2004
Location: Israel
Distribution: Fedora 2
Posts: 21

Rep: Reputation: 0
What is the Kernel?


Is the kernel itself an executable file? I mean, you can compile it with gcc, so whats the diffrence between a kernel file and a normal C compiled program?
 
Old 04-05-2005, 11:10 AM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 122Reputation: 122
The kernel is, technically, an executable file. Notably, though, it contains no external links (to libc or otherwise) and uses no system calls (since it provides it itself). User-mode-linux is a good example of how it is just an executable.
 
Old 04-05-2005, 01:58 PM   #3
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
kernel is compressed file containing compiled code .
this code is the kernel souce file and we can set the options to compile the kernel accordnig to our needs

regards
 
Old 04-05-2005, 03:36 PM   #4
LordOfer
LQ Newbie
 
Registered: Jul 2004
Location: Israel
Distribution: Fedora 2
Posts: 21

Original Poster
Rep: Reputation: 0
I understand that, but I dont get how you can use gcc to create an operating system file. can every C compiler create a file that can operate a computer directly? I always thought that compilers create excutable files that can be used BY an operating system and not AS an operating system...
 
Old 04-05-2005, 03:59 PM   #5
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
the kernel is not the whole operating the operating systen
the operating systen has proper structure to work with
now the work that it does like(it requires all the libraries and the config files to work)
read.write and the support of hardware etc is there in the kernel
 
Old 04-05-2005, 04:04 PM   #6
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
check out here

http://en.wikipedia.org/wiki/Operating_system_kernel

http://www.kernel.org/

regards
 
Old 04-06-2005, 01:09 PM   #7
LordOfer
LQ Newbie
 
Registered: Jul 2004
Location: Israel
Distribution: Fedora 2
Posts: 21

Original Poster
Rep: Reputation: 0
thanks, I think I'm starting to get it now... I looked in all the source around but couldn't find where it all starts. Is there a main() function that is the first to run? I couldn't find anything like that in init/main.c (which I understand is the first file to be compiled). I want my computer, just for fun, to print a welcome messege when linux starts, I was thinking about these lines:

printk("Welcome to my Linux\n");
for (i=0; i<10000000; i++) ;


whats is a good function to put these line in so I would see this messege as the first thing printed out?
 
Old 04-06-2005, 02:31 PM   #8
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
u can put that in the file
rc.local in /etc/rc.d

like

echo "welcone to linux"

regards
 
Old 04-06-2005, 03:04 PM   #9
LordOfer
LQ Newbie
 
Registered: Jul 2004
Location: Israel
Distribution: Fedora 2
Posts: 21

Original Poster
Rep: Reputation: 0
no, i mean inside the kernel's source, just when linux is booted
 
Old 04-06-2005, 04:00 PM   #10
Nad0xFF
Member
 
Registered: Apr 2005
Location: Russia, Saint-Petersburg
Distribution: Slackware 10
Posts: 109

Rep: Reputation: 15
AFAIK, usual executable file has sections: .data , .code and so on. These sections are read by OS. But what format should OS kernel be? (There is no OS to boot it :-\)
 
  


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
Kernel 2.4 in Zipslack (Waring: unable to open an initial console | Kernel Panic...) kurtamos Linux - General 2 05-10-2006 01:58 PM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 04:59 AM
kernel-source-2.6.5-7.src.rpm requires kernel-dummy to build!? fizzdandantilus SUSE / openSUSE 5 12-02-2004 01:48 PM
kernel panic: try passing init= option to kernel...installation with Red Hat 9 kergen Linux - Hardware 1 09-30-2004 04:28 AM
kernel memory + slabinfo.. + possible reasons for kernel space allocation failures!! premenjit Linux - Software 1 09-28-2004 05:13 AM


All times are GMT -5. The time now is 04:14 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