LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is the Kernel? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-kernel-309963/)

LordOfer 04-05-2005 09:54 AM

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?

Matir 04-05-2005 10:10 AM

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.

masand 04-05-2005 12:58 PM

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

LordOfer 04-05-2005 02:36 PM

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...

masand 04-05-2005 02:59 PM

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

masand 04-05-2005 03:04 PM

check out here

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

http://www.kernel.org/

regards

LordOfer 04-06-2005 12:09 PM

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?

masand 04-06-2005 01:31 PM

u can put that in the file
rc.local in /etc/rc.d

like

echo "welcone to linux"

regards

LordOfer 04-06-2005 02:04 PM

no, i mean inside the kernel's source, just when linux is booted

Nad0xFF 04-06-2005 03:00 PM

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 :-\)


All times are GMT -5. The time now is 07:59 PM.