LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-20-2008, 02:22 AM   #1
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Rep: Reputation: 15
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.
 
Old 09-20-2008, 06:07 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

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

Hope this helps.
 
Old 09-20-2008, 06:31 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by sugantha View Post
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.

So, my advise is to go here:

http://www.eu.kernel.org/pub/linux/kernel/v2.6/

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.

Last edited by i92guboj; 09-20-2008 at 07:12 AM.
 
Old 09-20-2008, 07:00 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,625

Rep: Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529Reputation: 2529
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.

Regards
 
Old 09-20-2008, 09:42 AM   #5
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Original Poster
Rep: Reputation: 15
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.
 
Old 09-20-2008, 02:25 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,201
Blog Entries: 3

Rep: Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426
Hi,

You should look at the 'Linux Kernel in a Nutshell'. A real good kernel reference. There are other kernel references with the below link.

This link and others are available from 'Slackware-Links'. More than just Slackware® links!
 
Old 09-20-2008, 09:39 PM   #7
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Original Poster
Rep: Reputation: 15
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...
 
Old 09-20-2008, 10:28 PM   #8
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by sugantha View Post
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.
 
Old 09-21-2008, 07:50 PM   #9
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 11,201
Blog Entries: 3

Rep: Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426Reputation: 1426
Hi,
Quote:
Originally Posted by sugantha View Post
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...
Time flies!

BTW, Your Welcome.
 
Old 09-22-2008, 04:31 AM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,040

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Quote:
Originally Posted by sugantha View Post
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.
 
Old 09-23-2008, 09:33 AM   #11
sugantha
Member
 
Registered: Feb 2008
Distribution: Ubuntu 11.04 Natty Narwhal , Fedora Linux
Posts: 43

Original Poster
Rep: Reputation: 15
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.

Last edited by sugantha; 09-23-2008 at 09:37 AM.
 
  


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
Getting "taints kernel" message even after having "Dual BSD/GPL" license nikhil_no_1 Linux - Kernel 3 12-06-2010 12:29 PM
Displaying "Subscribed Threads" -> new folder "All Folders" JZL240I-U LQ Suggestions & Feedback 5 06-15-2007 06:36 AM
Nautilus: "Location is not a folder" keratos Ubuntu 4 05-28-2007 02:33 AM
"rm -rf /tmp", now Evolution shows "(no folder displayed" Ed-MtnBiker Linux - Software 7 04-10-2006 04:05 PM
Common problems explained: "kernel panic - not syncing", "unable to mount..." sundialsvcs Linux - Newbie 2 03-01-2006 12:17 PM


All times are GMT -5. The time now is 05:02 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration