LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 05-10-2013, 02:55 PM   #1
abdulrahuman.s@gmail.com
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Cool 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 ?

Thanks & Regards,
Abdul
 
Old 05-12-2013, 09:03 AM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Switzerland
Distribution: Gentoo
Posts: 703

Rep: Reputation: 80
cd linux-3.8.2
make menuconfig
<now set the options as you want them>
<exit by saying to save your config changes>
make
 
1 members found this post helpful.
Old 05-12-2013, 11:40 PM   #3
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
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.
 
1 members found this post helpful.
Old 05-13-2013, 12:13 PM   #4
abdulrahuman.s@gmail.com
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks a lot for the detailed information. It is very helpful,
Could you pls help on below question as well.

I like to learn linux kernel arch code (i.e. arch/x86) from beginning. Where i can start and do more example program to understand linux kernel.

I know ASM, C, Operating system concept and little bit of device driver programming. I want to become expert in linux architecture spefici code(X86).

Please help me with this query ...
 
Old 05-13-2013, 03:18 PM   #5
Pearlseattle
Member
 
Registered: Aug 2007
Location: Switzerland
Distribution: Gentoo
Posts: 703

Rep: Reputation: 80
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.
 
1 members found this post helpful.
Old 05-15-2013, 12:41 PM   #6
abdulrahuman.s@gmail.com
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks a lot for guide... i will start with LDD and Linux kernel programming books...
 
Old 05-18-2013, 04:09 PM   #7
Pearlseattle
Member
 
Registered: Aug 2007
Location: Switzerland
Distribution: Gentoo
Posts: 703

Rep: Reputation: 80
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Arch Linux (only) on MacBook 4,1; Specific drivers and *.kext files parnmatt Arch 6 07-18-2013 02:33 PM
LXer: Arch BSD: Arch Linux Atop The FreeBSD Kernel LXer Syndicated Linux News 0 01-24-2013 03:20 PM
Arch Linux Installation Problems - arch-chroot, Grub2 Ronky Linux - Newbie 3 01-08-2013 05:22 PM
[SOLVED] Arch Linux (x86) hangs on shutdown/reboot. Seph64 Arch 6 08-04-2012 07:14 PM
Considering Arch Linux installation; question about a specific package. lupusarcanus Linux - Newbie 4 01-08-2010 12:43 PM


All times are GMT -5. The time now is 05:45 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration