Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 05:27
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Cross Compiling Kernel Modules
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
2lss

Joined: 20 Sep 2009
Posts: 225

PostPosted: Fri 04 Jun 2010, 01:03    Post_subject:  Cross Compiling Kernel Modules
Sub_title: for puppy 4.3.1
 

Ok here is the deal. I've been working on this Dell xps m140 and its almost done, however the backlight refuses to cooperate. After trying everything imaginable, I discovered that I needed some dell userland tools to communicate with the smbios (or something like that Confused ). Luckily I found some ubuntu debs with the needed components and installed them without problem, but they require some additional kernel modules to function; dell_rbu and dcdbas. So I downloaded the patched 2.6.30.5 kernel source for puppy 4.3 but I'm a little confused about how to build and install the modules. The machine in question is running a frugal install and doesn't have much horsepower so I figured I would build them on my x86-64 Ubuntu box. I've never actually built a kernel or modules before so I did some searching and found a few sites of interest.
http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=4
http://puppylinux.com/development/compilekernel.htm

From my understanding, I need something like.
Code:
make mrproper
make ARCH="i686" CROSS_COMPILE="i686 GNU/Linux-" INSTALL_MOD_PATH="/media/sdb/kernel-src" menuconfig
make bzImage


After selecting the drivers in menuconfig and building bzImage,
Code:
make ARCH="i686" CROSS_COMPILE="i686 GNU/Linux-" INSTALL_MOD_PATH="/media/sdb/kernel-src" modules


Then move flash drive(sdb) to the puppy machine, replace kernel image and then run.
Code:
make modules_install


Before I give this a try, could somebody tell me if I'm on the right path? Or give some pointers? I would hate to go through everything and realize that I did something wrong Mad
Back to top
View user's profile Send_private_message 
tempestuous

Joined: 10 Jun 2005
Posts: 5271
Location: Australia

PostPosted: Fri 04 Jun 2010, 03:00    Post_subject:  

Yes, it's a worthwhile step in your Linux journey to learn how to compile a kernel. Start here -
http://www.puppylinux.com/development/compilekernel.htm

It looks like you're off to an over-complex start. If I understand correctly, you're compiling on x86 architecture for an x86 target, so there's no "cross-compiling" involved.

Here's a quick summary: extract your Puppy-compatible 2.6.30.5 kernel source into /usr/src
then
Code:
cd /usr/src/linux-2.6.30.5
make menuconfig

This will present you with the kernel configuration menu.
Navigate into the "Firmware Drivers" section, and enable "Dell Systems Management Base Driver" (dcdbas) as an external module by pressing "m".

You could also enable "BIOS update support for DELL systems via sysfs" (dell_rbu)
but this sounds scary and unnecessary to me.
Exit the kernel configuration, saving changes. Now
Code:
make bzImage

This will compile the kernle image, but it's unchanged from the normal Puppy kernel, so there's no need to install it.
Now the external kernel modules -
Code:
make modules
make modules_install

Now you will have a new kernel module: dcdbas
This should be used in conjunction with the libsmbios library.
Back to top
View user's profile Send_private_message 
2lss

Joined: 20 Sep 2009
Posts: 225

PostPosted: Fri 04 Jun 2010, 12:16    Post_subject:  

Thank you tempestuous, this clears up some some of my confusion.

Quote:
If I understand correctly, you're compiling on x86 architecture for an x86 target, so there's no "cross-compiling" involved.


My mistake, I thought that going from x86-64 to x86 was cross compiling.

I will give this a try later and see how it goes.
Back to top
View user's profile Send_private_message 
2lss

Joined: 20 Sep 2009
Posts: 225

PostPosted: Sat 05 Jun 2010, 01:51    Post_subject:  

Success!! The backlight now works!! Very Happy

I followed the instructions and after 'make modules' I transfered the kernel source from my machine to the dell and ran make 'modules_install'. Everything past that was a breeze.

I did notice one problem but I don't know if there is anything I can do about it. 'modules_install' installs every module in the config and thus takes up a lot of room on the pup save file. Is there a way to only build and/or install the single module (dcdbas)?
Back to top
View user's profile Send_private_message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Sat 05 Jun 2010, 13:45    Post_subject:  

You just need to locate the new module and copy it into /lib/modules/2.6.30.5. Then run 'depmod -a'. You can make a pet of it to simplify things in the future and post it in case someone else needs it.
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0598s ][ Queries: 11 (0.0089s) ][ GZIP on ]