LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-18-2004, 12:37 PM   #1
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 241

Rep: Reputation: 49
Architecture confusion


Note how these commands disagree on what architecture I have...

Code:
# cat /proc/cpuinfo | grep Pentium
model name      : Intel(R) Pentium(R) 4 CPU 2.40GHz

# uname -a
Linux slackbox 2.6.8.1 #1 Tue Sep 7 16:27:09 CDT 2004 i686 unknown unknown GNU/Linux

# echo $HOSTTYPE
i486

# echo $MACHTYPE
i486-slackware-linux-gnu
I have been compiling a few programs and noticed that some of them have files called "config.sub" and "config.guess" (for example, with tvtime). So here's more confusion...

Code:
# ./config.guess
i686-pc-linux-gnu
config.sub looks like it tries to standardize these CPU-MANUFACTURER-OS strings, so I give it what I think mine should be...

Code:
# ./config.sub pentium4-slackware-linux-gnu
i786-slackware-linux-gnu
I've set $CHOST="i686-pc-linux-gnu" myself via /etc/profile before, so it looks like config.guess is getting its value from $CHOST. So now I change $CHOST="i786-slackware-linux-gnu" and try config.guess again, but it still gives i686-pc-linux-gnu. It must be getting its value from something else.

Now there's 4 different values for the architecture of my computer, i486, i686, i786, and pentium4. I think they should all be set to i786. Here's my questions:

1. Where does uname get the value for architecture type? What sets $HOSTTYPE and $MACHTYPE?

2. What are $HOSTTYPE and $MACHTYPE used for? Can I change the output from uname? If I change them, will that affect any programs?

3. How does config.guess find a value? What are config.sub and config.guess used for during compilation? (These are only included with some sources.) Does $CHOST override their values when I compile?

I'm really confused and I've done plenty of searching but I can't find a thing...
-elyk
 
Old 09-18-2004, 12:54 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 09-18-2004, 01:15 PM   #3
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
FWIW I've never heard of i786, but i686 is anything >Pentium2/AMD K7 iirc.

Uname -a reveales what class the kernel was compiled for, so you should be safe to swap everything with i686. If you want even more specific processor optimisation you have to find the correct amd/pentium arch value.
 
Old 09-18-2004, 01:42 PM   #4
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 241

Original Poster
Rep: Reputation: 49
So i686 is P2 and up, in the same way that i386 is just about any Intel processor (386 and up), sort of a least common denominator.

Here's what I've got for my kernel configuration:
Code:
$ grep -i pentium /boot/config
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
# CONFIG_MPENTIUMM is not set
CONFIG_MPENTIUM4=y
This should give me the pentium4 optimizations for the kernel, so why does uname still give i686 instead of i786 or pentium4? Or did the kernel get the value from $CHOST (i686 when I compiled it)?

-elyk
 
  


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
confusion about architecture type. trempel Linux - Newbie 5 04-30-2005 12:18 PM
architecture howarddevore Linux - Hardware 1 04-25-2005 06:14 PM
What architecture would I use? johnnyICON Linux - Newbie 1 12-08-2004 11:36 AM
Architecture skguha Linux - Newbie 2 05-03-2004 12:37 AM
Architecture TX_metalhead Linux - General 5 02-04-2002 04:13 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:19 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