Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I need to compile a kernel module for my target platform running 2.6.21 kernel. If I run file command on some other module that runs successfully on the target system, it shows "ELF 32-bit LSB relocatable, MIPS, MIPS32 version 1 (SYSV), not stripped"
I downloaded 2.6.21 kernel, updates $ARCH and $CROSS_COMPILE and compiled the kernel. Now when I specify this kernel source path in my module makefile it builds a module which is for MIPSIII, and MSB (as observed when running file command on the .ko). The linux-2.6.21/.config does not have CONFIG_MIPS32 set and CONFIG_LITTLE_ENDIAN set. So I thought I need to configure the kernel (at least modify these two options) before building my module against this kernel. Am I thinking in the right way? If not what should be my approach? Please let me know which option/options should I select from make menuconfig if I need to recompile the kerenl.
Also, please let me know if these two option (mips32 and 'little endian') can be specified in my module Makefile. What would be the make line then?
What toolchain do you use ? Typically if you use MIPS CodeSourcery toolchain, it will create by default a MIPS Big Endian binary. A quick workaround for that is to create some wrappers for gcc, ld...
Let me know if you are in such a case and that you need more info about that.
Thanks Oliv for the reply. I am using a mipsel toolchain created using buildroot. I am not been able to get the work around you are referring to. Can you please explain it in bit more detail.
If I build any application code using this toolchain with '-mips32' options specified it builds LSB executable for mips32. File command to this application binary shows "ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, not stripped". But if I specify -mips32 option in my module Makefile it shows the following error:
Error: -mips32 conflicts with the other architecture options, which imply -mips3
So I thinks that somehow my kernel configuration is not correct. My kernel .config file does not have MIPS32 flag enabled. Please suggest what should I do now. The module Makefile is also pastes here,
Ok, so that's your kernel which are probably not perfectly set (as you said in your first post).
I think that you have to ensure that the following options are enabled:
CONFIG_CPU_MIPS32_R1=y (in CPU selection)
Thanks Oliv, It looks my machine selection section is wrongly configured. That's why I didn't get the MIPS32R1 and LITTLE Endian option last time. I will correct this one and will try building the module. I will keep you posted.