Linux - NewbieThis 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
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.
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43
Rep:
location of folder named "kernel"
Hello...I am working on my final year project and which is improving the Process scheduling algorithm. I ve learnt that the location of the scheduling algorithm is "/kernel/sched.c" ... I am trying to locate the file to read the code but I cant locate a folder by name kernel under '/' ....I am running a Fedora 8 system with kernel version 2.6.25.14-69.fc8...Does the location of the sched.c file differ from distro to distro...If yes, then how to locate the file in fedora...Thanks in advance.
There is a sched.c in the kernel source directory (don't know if Fedora installs this by default).
My kernel source is located in: /usr/src/linux-2.6.X/ One of its subdirs is kernel, which holds the sched.c file (there are a lot more sched.c files, make sure you pick the correct one).
Hello...I am working on my final year project and which is improving the Process scheduling algorithm. I ve learnt that the location of the scheduling algorithm is "/kernel/sched.c" ... I am trying to locate the file to read the code but I cant locate a folder by name kernel under '/' ....I am running a Fedora 8 system with kernel version 2.6.25.14-69.fc8...Does the location of the sched.c file differ from distro to distro...If yes, then how to locate the file in fedora...Thanks in advance.
Many things...
Binary distros like fedora don't usually install the kernel sources. Since the kernel comes precompiled, all they install is a binary image, the kernel will be under /boot and the modules under /lib/modules/$(uname -r)/.
On these distros the sources for the kernel can be installed usually via a package with the same name of your kernel but ending in -sources, -dev, -devel or something like that.
If you intend to do this for a course project or something like that, then you should consider using stock kernels, and not distro specific kernels. If you develop on top of a patched kernel like the fedora one, you risk your patch not being able to apply over any other sources than those of fedora.
You should also pick a concrete version as target for your patch. For example, 2.6.25 or 2.6.26.5 or whatever else.
Those are stock 2.6 kernels, as released by the linux kernel team, vanilla kernels without any modification or 3rd party patch. Pick one kernel, whichever you prefer, download it, unpack it on your home, and use that same tree to develop your whole patch.
This way you ensure that you are using a standard kernel, and by having it on your home you make sure that no update will break it and render useless your patch.
EDITED: Just in case I wasn't clear enough, a patch made for a version of the kernel might not work against other version. So, if this is a project for the college, you should ask if the patch needs to work against a given version of the linux kernel, and if affirmative, use that version to design your patch.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
The package 'kernel-devel' installs to e.g.
/usr/src/kernels/2.6.23.1-42.fc8-i686 but only contains
a limited set of files.
Example again :
The "full kernel-source" , I found :
The package 'kernel-2.6.23.1-42.fc8.src.rpm' http://download.fedora.redhat.com/pu.../source/SRPMS/
which will "install" (unpack) to
/usr/src/redhat/SOURCES/linux-2.6.23.tar.bz2 + 170 patches
and other files. 'linux-2.6.23.tar.bz2' can be unpacked to
/home/sugantha/tmp with 'tar xvf linux-2.6.23.tar.bz2'
"sched.c" will then be in /home/sugantha/tmp/linux-2.6.23/kernel
I did not find your version of kernel, 2.6.25.14 is probably
available at kernel.org and you have some patches possibly
still valid for this version, if needed.
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43
Original Poster
Rep:
Thanks a lot i92guboj, druuna, knudfl...
I am downloading the kernel version linux-2.6.26.5...if I use the header files of this version and when I am finally done with the implementation of sched.c, how do I integrate the kernel with the rest of the system to test it. This is too early at this stage but I would feel more comfortable to start with all this information...Thanks a ton.
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43
Original Poster
Rep:
Thanks Onebuck...
This project needs to be submitted only on the may of next year.So that gives me lot of time to learn the basics. Understanding the Linux kernel is also a good book I heard.Thanks for all your suggestions ppl...
Thanks Onebuck...
This project needs to be submitted only on the may of next year.So that gives me lot of time to learn the basics. Understanding the Linux kernel is also a good book I heard.Thanks for all your suggestions ppl...
In that case, your first milestone is to successfully compile a kernel and boot from it. Good luck.
Thanks Onebuck...
This project needs to be submitted only on the may of next year.So that gives me lot of time to learn the basics. Understanding the Linux kernel is also a good book I heard.Thanks for all your suggestions ppl...
Thanks Onebuck...
This project needs to be submitted only on the may of next year.So that gives me lot of time to learn the basics. Understanding the Linux kernel is also a good book I heard.Thanks for all your suggestions ppl...
You need to understand the basic procedures before you can work on a patch for the kernel. Things like configuring a kernel, compiling it and boot it correctly should be the first things that you will need to know, because without these, you can't even enable and test your patch.
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43
Original Poster
Rep:
Quote:
Originally posted by Onebuck
Time flies!
hehe...It sure does.Will try to learn things fast...And compiling the kernel is my first goal. I see a lot of good tutorials online...will try soon and get back in case I have a problem...Thanks and Regards.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.