starting point of linux kernel - Linux

This is a discussion on starting point of linux kernel - Linux ; Hi, I m new to linux kernel. I tried to search main() function in the source code but could not found. In absence of main() fun what would we the starting point of the kernel as we know that main() ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: starting point of linux kernel

  1. starting point of linux kernel

    Hi,

    I m new to linux kernel. I tried to search main() function in the
    source code but could not
    found. In absence of main() fun what would we the starting point of
    the kernel as we know
    that main() function is must for any C program.


    Thanks,,,,,

  2. Re: starting point of linux kernel

    useless79 wrote:

    > I m new to linux kernel. I tried to search main() function in the source
    > code but could not
    > found. In absence of main() fun what would we the starting point of the
    > kernel as we know
    > that main() function is must for any C program.


    I think you should read more about booting the kernel. Some useful
    information is here:
    http://www.faqs.org/docs/Linux-HOWTO...x_boot_process
    Despite the fact that this page is a bit outdated it can give you a
    genereal overview, how the kernel is loaded. It also may be valuable to
    read Documentation//boot.txt in the main Linux sources directory.

    However, in the current code (2.6.27) there *is* main function (for x86,
    I haven't checked other architectures). It is placed in file arch/x86/
    boot/main.c It's main task is to prepare system to switch to the
    protected mode - it just do things that have to be done in real mode
    (querying APM, etc)

    Pawel Dziepak

  3. Re: starting point of linux kernel

    On Oct 28, 1:27*am, useless79 wrote:

    > ... as we know
    > that main() function is must for any C program.


    No. Section 3.6.1 of the C standard says, "It is implementation-
    defined whether a program in a freestanding environment is required to
    define a 'main' function." The Linux kernel is in a freestanding
    environment, see 1.4(7).

    DS


+ Reply to Thread