Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is no one "first file in kernel code" - it's architecture dependent. You could try ../arch/<your_arch>/boot/header.S and meander from there.
Trying to read the kernel from the beginning will be an interesting challenge. I'd suggest you try small bites first. www.kernelnewbies.org might be a good place to visit.
A good, high-level overview of the kernel itself: particularly the relationship between the kernel, user-space Linux programs running under the kernel, and hardware resources managed by the kernel, can be found here:
When you boot the computer, a special program called a boot loader is brought into memory. It, in turn, loads a kernel image into memory (replacing itself), and hands over control of the system to it.
The kernel manually constructs all of the various lists and data-structures that it will use in the course of normal operations ... the memory heaps, the basic device-tables, and the process list. When built, the process list contains (usually) one entry: a very special process that by-definition is not allowed to die. That process is called init.
Once this initialization is finished, the kernel switches into virtual-memory mode and then activates the process-dispatcher ... which is now able to do its job because "a process" does exist: the process-list is not empty and it never will become so. From this point forward, init, and the various other processes that it spawns, "run the show."
As you may have guessed, this picture is somewhat over-simplified, but "for our purposes here, it will suffice."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.