LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-19-2007, 12:04 PM   #1
halturata
Member
 
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Rep: Reputation: 16
Including new machine type in the kernel configuration


Hello,

I'm trying to build a 2.6.20 kernel for a powerpc arch, and when doing a configure I see that there is no support exactly for my board, but rather for an older one. I have the Board support package for my board and my question is how can I include an option in the linux configuration (showing up when I do a 'make menuconfig' for example). I googled aroud but all I find is HOW-TO's for generla kernel compilations. Can you give me some clues about that?

Thanks in advance!
 
Old 09-20-2007, 05:11 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I just did this the other day, to add a driver to my kernel that wasn't there previously. I haven't got the exact docs handy, but here's the basic idea:

1 - place the C sourcecode file into its appropriate subfolder in the kernel source area;
2 - edit the Kconfig file in that subfolder appropriately, to add the driver to menuconfig as an option. Follow the existing examples of similar items in that area.
3 - edit the Makefile in that subfolder also, and add a new 'obj' line somewhere, following the examples of the existing lines, with the object code filename of your code, and necessary arguments.

I think that's pretty much all that needs to be done. Those are the only things I did to add a driver for a hardware monitor chip I have on my board, and it worked great. The item was in menuconfig as it should have been, and it selected and built just fine
 
Old 09-20-2007, 07:07 AM   #3
halturata
Member
 
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Original Poster
Rep: Reputation: 16
OK, thanks, I'll give it a try and I'll come back with some results.

Actually I wanted to add a support for a whole new SBC (or maybe sub-architecture is better to say). However I have support for a similar board, which I think will be good starting point.
 
Old 09-20-2007, 07:30 AM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I agree. Try something small first, and see how it goes. If it works out well, then go for adding more, and keep us posted of the process/progress.
I wonder, why would your configuration not be included in the kernel by default? Perhaps it is a little-used (sub)architecture, or what do you think?
 
Old 09-21-2007, 11:24 AM   #5
halturata
Member
 
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Original Poster
Rep: Reputation: 16
Yes, you are right, it is an embedded board, and support for it doesn't come with a vanilla kernel.

Here is what I've tried till now (with no success I must admit):

Code:
1. Addded the board-specific files under linux/arch/ppc/platforms:
# cp ./BSP/mvme6100.c ./BSP/mvme6100.h /usr1/src/linux/arch/ppc/platforms

2. Added this line to the Makefile under linux/arch/ppc/platforms:
obj-$(CONFIG_MVME6100)    += mvme6100.o

3. Added the following lines in Kconfig under linux/arch/ppc:
config MVME6100
        bool "Motorola-MVME6100"

4. Copied a default configuration for the new board into the kernel source tree:
# cp ./BSP/mvme6100_defconfig /usr1/src/linux/arch/ppc/configs

5. Added some additional drivers for onboard hardware under linux/drivers and linux/drivers/custom:
# cp -pr ./BSP/drivers/custom /usr1/src/linux/drivers/custom
# cp -pr ./BSP/drivers/vme /usr1/src/linux/drivers/vme

6. Added to linux/drivers/Kconfig the following lines:
source "drivers/vme/Kconfig"
source "drivers/custom/mv64360_dma/Kconfig"
source "drivers/custom/nvram/Kconfig"
source "drivers/custom/sdd/Kconfig"
source "drivers/custom/watchdog/Kconfig"

7. Added to linux/drivers/Makefile the following lines:
obj-$(CONFIG_VME_BRIDGE)                   += vme/
obj-$(CONFIG_MVME6100_IDMA)                += vme/
obj-$(CONFIG_MVME6100_NVRAM)               += vme/
obj-$(CONFIG_MVME6100_SDD)                 += vme/
obj-$(CONFIG_MVME6100_WATCHDOG)            += vme/
What still bothers me is that I don't know where to include this "CONFIG_MVME*" options so the Kconfig framework can see them. The same goes for the VME driver specific option "CONFIG_VME_BRIDGE". Are they only defined in the platform specific header files (the ones under linux/arch/ppc/platforms)? I mean they are nothing but pure #define statements, or I'm wrong on that?

Any further help an guidance are welcome
 
Old 09-21-2007, 11:34 AM   #6
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Interesting.. Looks like you are going about it the right way, but already you are getting beyond my knowledge level when it comes to custom kernel configging. Personally, I would have gone as far as your STEP-3 above, and tried it to see what happened.

However, you may do better if you present this issue in the new LINUX - HARDWARE sub-forum for EMBEDDED, or in the LINUX - SERVER forum. Maybe rather than rewriting your question, you could post over there a basic intro, and link to this thread from there.

I'd bet there are more knowledgeable folks in the EMBEDDED/SERVER forums who know about this stuff, and hopefully someone can help you get further.

I wish you the best, and will be following your progress, as I do find it interesting, and stand to learn from your experience.
 
Old 09-24-2007, 06:14 AM   #7
halturata
Member
 
Registered: Aug 2005
Location: Sofia
Distribution: SuSE, ELinOS
Posts: 100

Original Poster
Rep: Reputation: 16
Thanks for the suggestion and for showing such interest in this issue

I'll make a new thread in the suggested forums with link to this one, when I get some more free time later this afternoon.
 
  


Reply



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
Selecting Processor Type in Kernel Configuration dwhitney67 Linux - Kernel 5 08-30-2007 04:58 AM
whenever kernel panic comes it destroys the whole partition including that of windows cybercop12us Linux - Software 2 08-29-2006 11:41 AM
Including the header file of a module in kernel code omkarlagu Linux - Newbie 0 02-05-2006 07:55 AM
Identifying the type of Alpha machine wenberg Linux - Hardware 1 01-19-2005 05:31 AM
Multi-Service Machine Including Routing a Good Idea?? Breezwell Linux - Networking 2 11-10-2001 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration