Including new machine type in the kernel configuration
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.
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?
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
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.
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?
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.