[SOLVED] How to compile only specific arch code (linux-3.8.2/arch/x86) ?.
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
How to compile only specific arch code (linux-3.8.2/arch/x86) ?.
Hi,
Could you help on my below doubt ?
is it possible to compile specific architecture code (linux-3.8.2/arch/x86) in linux kernel ?
I want to compile kernel code in this "linux-3.8.2/arch/x86/" directory and like to learn the concept and programm and also like to test the compiled binary file using qemu/bochs emulators.
could you please help me to to find a way to compile "linux-3.8.2/arch/x86" code and create a binary image ?
When you compile the linux kernel, depending on the compiler you are using, by default only one architecture code will get compiled. That is if you use gcc to compile the kernel, the kernel by default will be built only for x86.
If you use a cross compiler like gcc-arm then code for arm will get compiled.( you would need to modify the .config accordingly and pass the relevant parameters to make)
So if you want code for x86 then just use gcc and compile the kernel.
If I would be doing something like that I would probably start by buying a book (there are a few that aren't bad) and start programming a device driver/module for an input device (joystick, mouse, whatever).
Afterwards perhaps I would start looking at the "no-op"/"noop" I/O scheduler and try to understand how it works and try to write my own disk scheduler - but in the end it depends on what you're interested in.
You're welcome.
And don't let them discourage you - a few weeks back I started fiddling around with ioctl and at first it was really hard, but with a bit of perseverance I started understanding how it worked.
I can imagine that the advantage of dealing with the Kernel is that things there are pretty static - not like with UIs where you might have to switch from QT, Clutter, GTK, etc..., having to re-learn every time the basics.
Good luck!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.