LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-12-2005, 12:43 AM   #1
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Rep: Reputation: 30
Unhappy Debian AMD64 compiled kernel says its i686.....?


Ok, I just compiled my own 2.6.8 kernel for my machine and it works. Here's how I did it:

1) Copy over the .config from the 2.6.8-10-amd64 Debian kernel image that I already had installed to the kernel source directory.

2) Modify a few of the options in menuconfig to remove stuff I don't need.

3) Compiled, etc.



And then it booted. So I thought "yay", but then I type this:

Quote:
harima:/usr/src/linux# uname -a
Linux harima 2.6.8-harima #1 Sun Mar 13 00:29:16 CST 2005 i686 GNU/Linux

i686??? What? I went back and checked my config file and sure enough, AMD64/Opteron/K8 was selected as the processor architecture. What? Why? How? I'm baffled by this. I even booted into the 2.6.8-10-amd64 kernel and uname reported it correctly as x86_64. I have no idea why this isn't working, and because my machine is identified incorrectly my nVidia AMD64 drivers refuse to install!!!



Please, does anyone have at least a shread of a clue as to why this could be happening? Thanks in advance for any help you can give.
 
Old 03-12-2005, 08:14 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

What about: gcc -dumpmachine
does it tells you "i686-pc-linux-gnu" or "x86_64" ???

Oliv'
 
Old 03-12-2005, 12:57 PM   #3
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by Oliv'
Hello,

What about: gcc -dumpmachine
does it tells you "i686-pc-linux-gnu" or "x86_64" ???

Oliv'
Code:
roots@harima:~$ gcc -dumpmachine
i486-linux
What the hell is going on? So my machine is both i686 and i486...
 
Old 03-12-2005, 01:34 PM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
the real problem is that without specifying gcc a target, it will generate 32bits executable so you won't be able to compile an x86_64 kernel with this gcc without doing cross-compilation.
A solution could be: install a gcc-x86_64 in /opt and compile your kernel by doing: make CC=/opt/gcc/bin/gcc
 
Old 03-12-2005, 02:05 PM   #5
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
I see, that makes sense. I thought gcc would automatically know the target architecture. Alright, I'll give that a try. Thanks
 
Old 03-12-2005, 03:43 PM   #6
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Ehh I'm a little confused as to how to approach this problem now. There is no gcc-amd64 in sarge's source repository. I thought maybe gcc-3.4 would be able to id my system so I installed it, but it doesn't. Will I need to install 64 bit libraries in order to compile the kernel for true 64-bit? I installed amd64-libs and amd64-libs-dev packages.....but I'm not sure if they're setup for what I want (a 64-bit kernel and a 32-bit system).


I was reading through gcc-3.4's man page and I found this option:
Code:
 i386 and x86-64 Options -mcpu=cpu-type

Can I just add the option to the kernel makefile's $CC? I'm not clear on how to proceed right now....
 
Old 03-12-2005, 04:15 PM   #7
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Hmm, well after reading more about GCC it appears that if I specify the following options, then the kernel will compile for AMD64:

Code:
-mtune=k8 -march=k8 -m64

And after looking thru the makefile though I found ARCH and SUBARCH variables, but I'm a little confused as to how they work. I'm reading into kernel crosscompiling right now so if anyone has any help it would be appreciated.
 
Old 03-12-2005, 08:53 PM   #8
Clark Bent
Member
 
Registered: Jul 2004
Distribution: Debian, FreeBSD, Slamd64
Posts: 201

Rep: Reputation: 30
Debian:/home/me# uname -a
Linux debian 2.6.9-9-amd64-k8 #1 Sun Dec 5 03:38:13 CET 2004 x86_64 GNU/Linux
 
Old 03-12-2005, 11:02 PM   #9
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
.....are you trying to mock me? (-_-) Or are you trying to help me by giving me hidden clues?
 
Old 03-12-2005, 11:11 PM   #10
Clark Bent
Member
 
Registered: Jul 2004
Distribution: Debian, FreeBSD, Slamd64
Posts: 201

Rep: Reputation: 30
No. I'm not mocking you. Thats the output of my kernel.

Do you still have your original kernel installed that was installed when you installed the OS? If you do, and you do the uname -a, what is your output then?

Also, did you install your kernel the Debian way or from scratch?

Also, if you'll pardon my curiosity, since you have a 64 bit processor, why run a 32 bit version of Debian? Well, you could have some great reasons...but one key difference I think between you and myself is I am running in full 64 bit mode all the way.

If your partial to sarge, you could give this a whirl:

http://debian-amd64.alioth.debian.or...64-netinst.iso

Last edited by Clark Bent; 03-12-2005 at 11:55 PM.
 
Old 03-13-2005, 12:06 AM   #11
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
The original kernel I installed was i386. I still have it, and I'm pretty sure it will say i386 if I uname -a it (I'm too lazy to boot into an old kernel now). I installed my kernel the Debian way.


I'm well aware of Debian pure64 and in face I already have the netinst CD of it. I popped it in a week ago and I couldn't get it to recognize any of the sources (and hence I couldn't download programs) and even after trying to figure out why I still had no idea, so I got frustrated and put in an i386 image instead. Yeah I know that running in pure64 could get me a performance boost, but honestly right now I don't care that much about it. I'm in a busy stage of my life and I don't want to have to deal with all the tediousness associated with an incomplete system (ie having to fakeroot to run 32-bit apps). I just want to run things and have them work. Call me unl33t, call me whatever, but that's what I want. I do plan to move to pure64 once it gets a little bit more mature though and I have more time to hack my system like in the old days.
 
Old 03-13-2005, 12:11 AM   #12
Clark Bent
Member
 
Registered: Jul 2004
Distribution: Debian, FreeBSD, Slamd64
Posts: 201

Rep: Reputation: 30
Thats right! I think I recall you saying something similar in another thread (about being busy...perhaps that wasn't you). At any rate, if your not running in 64 bit mode, I think you'll find you don't need the actual AMD64 drivers for your video card. Try installing the others and I think you'll find they work.
 
Old 03-13-2005, 12:46 AM   #13
R00ts
Member
 
Registered: Mar 2004
Location: Austin TX, USA
Distribution: Ubuntu 11.10, Fedora 16
Posts: 547

Original Poster
Rep: Reputation: 30
Yeah I know they'll work. But can't I have a 64-bit kernel, 64-bit video drivers, and 32-bit everything else? That's what I was shooting for... I'm wondering if I specify the cross-compile option when I compile the kernel if that will work...

Last edited by R00ts; 03-13-2005 at 12:47 AM.
 
Old 03-13-2005, 10:24 AM   #14
Clark Bent
Member
 
Registered: Jul 2004
Distribution: Debian, FreeBSD, Slamd64
Posts: 201

Rep: Reputation: 30
Nope. You cant. You want 64 bit, run the 64 bit OS.
 
  


Reply



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
Debian based i686 distro VertX Debian 6 02-27-2005 07:11 AM
i586/i686 on an AMD64 System bdprem Linux - General 4 02-01-2005 08:30 AM
Bootstrapping Debian for i686 gamehack Debian 1 08-26-2004 04:45 AM
i686 Debian port tmp123 Debian 1 03-22-2004 06:15 PM
i686 Debian port tmp123 Debian 1 03-22-2004 06:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:11 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration