2001-04-26 14:59:55

by Yiping Chen

[permalink] [raw]
Subject: About rebuild 2.4.x kernel to support SMP.


I know it's not proper ask such question here. But I don't know where can I
post this question.
I download RedHat 7.1 last week, and install it in my dual-CPU enviroment.
I try to rebuild kernel that support SMP in kernel 2.4.2 today , but it
failed.
The following is what I did.
========================================
1. Install Red Hat 7.1 in my dual-CPU environment
2. type 'uname -a' , the following is the result:
Linux lab5-1 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
3. cd /usr/src/linux-2.4 (becuase Red Hat link the 2.4.2 kernel source to
linux-2.4)
4. make mrproper
5. make menuconfig (set SMP and RTC)
6. make dep
7. make clean
8. make bzImage
9. make modules
10. make modules_install
11. edit /etc/lilo.conf
12. run lilo
13. reboot, choose new kernel to boot the system, type 'uname -a'
Linux lab5-1 2.4.2-2 #1 SMP Wed Apr 25 18:56:05 CST 2001 i686 unknown

My question is why the result of 'uname -r' is not "2.4.2-2smp" , but
"2.4.2-2"
Whether I forgot to do something?
It seems that when we compile the 2.4.2 kernel, it will not use -D__SMP__
argument now.
(because I didn't see it in /usr/src/linux-2.4/Makefile, and I didn't see it
when I did 'make bzImage')
If someone ever build 2.4.x kernel which support SMP, please teach me how to
do it.
Thanks!!

--------------------------------------------------
Yiping Chen
VIA Technologies, Inc.
LAN Software
533 Chung Cheng Road 8F
Hsin Tien, Taipei
Taiwan
TEL : 886-2-22185452 EXT.7512
FAX : 886-2-22187527
E-mail : [email protected]



2001-04-26 15:20:52

by Vivek Dasmohapatra

[permalink] [raw]
Subject: Re: About rebuild 2.4.x kernel to support SMP.

On Thu, 26 Apr 2001, Yiping Chen wrote:

> My question is why the result of 'uname -r' is not "2.4.2-2smp" , but
> "2.4.2-2"

This is just the label as defined by the entries in the top-level
Makefile, eg:

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 3
EXTRAVERSION = -ac5

> Whether I forgot to do something?

You can edit the extraversion value if you want to label your smp kernels
differently, but you don't have to.

You'll probably find you _have_ compiled an SMP kernel - see what
/proc/cpuinfo says, for example.

--
I am worthless. I struggle with the simple things. It seems so easy for
everyone else. One armed blind people climb mountains and teenagers get
Ph.D's. I have trouble getting out of bed.
-TMCM

2001-04-26 15:36:36

by Yiping Chen

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

So, I have two question now,
1. how to determine whether your kernel support SMP?
Somebody taugh me that you can type "uname -r", but it seems not
correct.
2. I remember in 2.2.x, when I rebuild the kernel which support SMP, the
compile
argument will include -D__SMP__ , but this time, when I rebuild kernel
2.4.2-2 , it didn't appear.
Why?

Anyway, thanks for Vivek's answer.
-----Original Message-----
From: Vivek Dasmohapatra [mailto:[email protected]]
Sent: Thursday, April 26, 2001 11:20 PM
To: Yiping Chen
Cc: '[email protected]'
Subject: Re: About rebuild 2.4.x kernel to support SMP.


On Thu, 26 Apr 2001, Yiping Chen wrote:

> My question is why the result of 'uname -r' is not "2.4.2-2smp" , but
> "2.4.2-2"

This is just the label as defined by the entries in the top-level
Makefile, eg:

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 3
EXTRAVERSION = -ac5

> Whether I forgot to do something?

You can edit the extraversion value if you want to label your smp kernels
differently, but you don't have to.

You'll probably find you _have_ compiled an SMP kernel - see what
/proc/cpuinfo says, for example.

--
I am worthless. I struggle with the simple things. It seems so easy for
everyone else. One armed blind people climb mountains and teenagers get
Ph.D's. I have trouble getting out of bed.
-TMCM

2001-04-26 15:54:07

by Vivek Dasmohapatra

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

On Thu, 26 Apr 2001, Yiping Chen wrote:

> So, I have two question now,
> 1. how to determine whether your kernel support SMP?
> Somebody taugh me that you can type "uname -r", but it seems not
> correct.

Try:

cat /proc/stat

or

cat /proc/cpuinfo

/proc/cpuinfo should contain 1

processor : N

line per processor.

/proc/stat will contain n cpuN lines, where n is the number of processors
in your box, I think, or no such lines [just a cpu line] on a UP box.

--
There's an old proverb that says just about whatever you want it to.

2001-04-26 16:08:49

by Benjamin LaHaise

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

On Thu, 26 Apr 2001, Yiping Chen wrote:

> So, I have two question now,
> 1. how to determine whether your kernel support SMP?
> Somebody taugh me that you can type "uname -r", but it seems not
> correct.

No, it's correct: the Red Hat RPM is build from the kernel.spec file which
adds the smp string to the version.

> 2. I remember in 2.2.x, when I rebuild the kernel which support SMP, the
> compile
> argument will include -D__SMP__ , but this time, when I rebuild kernel
> 2.4.2-2 , it didn't appear.
> Why?

Because you've made an assumption that holds no value. 2.4 kernels rely
on CONFIG_SMP instead of __SMP__.

-ben

2001-04-26 16:12:49

by Alan Shutko

[permalink] [raw]
Subject: Re: About rebuild 2.4.x kernel to support SMP.

Vivek Dasmohapatra <[email protected]> writes:

> /proc/stat will contain n cpuN lines, where n is the number of processors
> in your box, I think, or no such lines [just a cpu line] on a UP box.

No, I see

cpu 830711 916 708342 3323709
cpu0 830711 916 708342 3323709

and

# CONFIG_SMP is not set

--
Alan Shutko <[email protected]> - In a variety of flavors!
The more control, the more that requires control.

2001-04-26 16:24:21

by Yiping Chen

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

Thanks for your reply.
I am interested in where can find the linux kernel spec. file, and where Red
Hat add the smp string?
Where the uname command extract the kernel version information(eg:
2.4.2-2smp or 2.2.16)?
I means from which file, or use which system call?

I am a linux driver writer, and I am writing Makefile now. I hope the
Makefile can install driver
to the correct directory automatically (user run 'make install').
The linux driver modules always put in /lib/modules/<kernel_version>/...
before (in kernel 2.2.16),
but in kernel 2.4.x, the path change to
/lib/modules/<kernel_version>/kernel/drivers/...
I don't know where to get the kernel_version information. I need some help.
Thanks!!
may I use uname? I worry that the driver will install to incorrect path, and
user will complain it.
thanks!!


-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Friday, April 27, 2001 12:03 AM
To: Yiping Chen
Cc: 'Vivek Dasmohapatra'; '[email protected]'
Subject: RE: About rebuild 2.4.x kernel to support SMP.


On Thu, 26 Apr 2001, Yiping Chen wrote:

> So, I have two question now,
> 1. how to determine whether your kernel support SMP?
> Somebody taugh me that you can type "uname -r", but it seems not
> correct.

No, it's correct: the Red Hat RPM is build from the kernel.spec file which
adds the smp string to the version.

> 2. I remember in 2.2.x, when I rebuild the kernel which support SMP, the
> compile
> argument will include -D__SMP__ , but this time, when I rebuild kernel
> 2.4.2-2 , it didn't appear.
> Why?

Because you've made an assumption that holds no value. 2.4 kernels rely
on CONFIG_SMP instead of __SMP__.

-ben

2001-04-26 16:41:34

by Vivek Dasmohapatra

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

On Fri, 27 Apr 2001, Yiping Chen wrote:

> Where the uname command extract the kernel version information(eg:
> 2.4.2-2smp or 2.2.16)?

uname [the shell command] is a wrapper around the uname system call:

man 1 uname
man 2 uname

> I means from which file, or use which system call?

>From a strace -v of uname:

uname({sysname="Linux",
nodename="arachne",
release="2.2.18-00",
version="#9 Wed Jan 3 13:48:37 GMT 2001",
machine="i686"}) = 0

> I don't know where to get the kernel_version information. I need some help.
> Thanks!!
> may I use uname? I worry that the driver will install to incorrect path, and
> user will complain it.

You can [and may] use uname to get the kernel version string. I am less
certain about the exact layout of the module tree under 2.4.3.

--
I dunno about the Big Bang. The Big Kludge I can believe in.

2001-04-26 21:01:46

by Josh McKinney

[permalink] [raw]
Subject: Re: About rebuild 2.4.x kernel to support SMP.

It seems to me that you never installed the new kernel. Try 'make install'
or manually cp'ing the vmlinuz and system.map yourself.

On approximately Thu, Apr 26, 2001 at 10:59:44PM +0800, Yiping Chen wrote:
>
> I know it's not proper ask such question here. But I don't know where can I
> post this question.
> I download RedHat 7.1 last week, and install it in my dual-CPU enviroment.
> I try to rebuild kernel that support SMP in kernel 2.4.2 today , but it
> failed.
> The following is what I did.
> ========================================
> 1. Install Red Hat 7.1 in my dual-CPU environment
> 2. type 'uname -a' , the following is the result:
> Linux lab5-1 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
> 3. cd /usr/src/linux-2.4 (becuase Red Hat link the 2.4.2 kernel source to
> linux-2.4)
> 4. make mrproper
> 5. make menuconfig (set SMP and RTC)
> 6. make dep
> 7. make clean
> 8. make bzImage
> 9. make modules
> 10. make modules_install
> 11. edit /etc/lilo.conf
> 12. run lilo
> 13. reboot, choose new kernel to boot the system, type 'uname -a'
> Linux lab5-1 2.4.2-2 #1 SMP Wed Apr 25 18:56:05 CST 2001 i686 unknown
>
> My question is why the result of 'uname -r' is not "2.4.2-2smp" , but
> "2.4.2-2"
> Whether I forgot to do something?
> It seems that when we compile the 2.4.2 kernel, it will not use -D__SMP__
> argument now.
> (because I didn't see it in /usr/src/linux-2.4/Makefile, and I didn't see it
> when I did 'make bzImage')
> If someone ever build 2.4.x kernel which support SMP, please teach me how to
> do it.
> Thanks!!
>
> --------------------------------------------------
> Yiping Chen
> VIA Technologies, Inc.
> LAN Software
> 533 Chung Cheng Road 8F
> Hsin Tien, Taipei
> Taiwan
> TEL : 886-2-22185452 EXT.7512
> FAX : 886-2-22187527
> E-mail : [email protected]
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Linux, the choice | There was a young man from Stamboul Who
of a GNU generation -o) | boasted so torrid a tool That each female
Kernel 2.4.3-ac1 /\ | crater Explored by this satyr Seemed
on a i586 _\_v | almost unpleasantly cool.
|

2001-04-27 06:06:38

by buhr

[permalink] [raw]
Subject: Re: About rebuild 2.4.x kernel to support SMP.

Yiping Chen <[email protected]> writes:
>
> So, I have two question now,
> 1. how to determine whether your kernel support SMP?

Type "uname -a", as you did before:

> Linux lab5-1 2.4.2-2 #1 SMP Wed Apr 25 18:56:05 CST 2001 i686 unknown
^^^
SMP appears here if and only if your kernel was compiled as an SMP
kernel (i.e., with CONFIG_SMP set). Programmatically, you can get
this same information from the "uname" system call. The "version"
member for the "utsname" structure will be the complete string:

#1 SMP Wed Apr 25 18:56:05 CST 2001

That is, you should be able to reliably determine whether or not the
kernel is SMP by simply "strstr"ing for " SMP " in the version string.

> 2. I remember in 2.2.x, when I rebuild the kernel which support SMP, the
> compile
> argument will include -D__SMP__ , but this time, when I rebuild kernel
> 2.4.2-2 , it didn't appear.
> Why?

The "__SMP__" preprocessor define has been replaced by the
"CONFIG_SMP" configuration file variable.

Kevin <[email protected]>

2001-04-27 11:28:08

by Johan Kullstam

[permalink] [raw]
Subject: Re: About rebuild 2.4.x kernel to support SMP.

<[email protected]> writes:

> On Thu, 26 Apr 2001, Yiping Chen wrote:
>
> > So, I have two question now,
> > 1. how to determine whether your kernel support SMP?
> > Somebody taugh me that you can type "uname -r", but it seems not
> > correct.
>
> No, it's correct: the Red Hat RPM is build from the kernel.spec file which
> adds the smp string to the version.

"uname -a" will show SMP status.

euler(jk)$ uname -a
Linux euler.axel.nom 2.4.4-pre5 #1 SMP Thu Apr 19 19:20:40 EDT 2001 i686 unknown

this is on a redhat system, but i think it will work on any linux
system.

> > 2. I remember in 2.2.x, when I rebuild the kernel which support SMP, the
> > compile
> > argument will include -D__SMP__ , but this time, when I rebuild kernel
> > 2.4.2-2 , it didn't appear.
> > Why?
>
> Because you've made an assumption that holds no value. 2.4 kernels rely
> on CONFIG_SMP instead of __SMP__.

it's probably easiest to download the latest kernel (2.4.3 at the time
of this writing) from ftp.XX.kernel.org (XX being your country code).
then configure using "make xconfig" or "make menuconfig". choose SMP
in one of the first menus. there's a kernel-howto which explains this
stuff. btw there is no problem running your own kernels on a redhat
system bypassing rpm.

in a source tree in which you've compiled SMP and want UP or
vice-versa, i think to do a "make distclean" in between switching.

--
J o h a n K u l l s t a m
[[email protected]]
Don't Fear the Penguin!

2001-04-27 11:53:25

by Yiping Chen

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.

I have a important question about compile driver here, sometimes we install
RedHat Linux
When you boot the system , it will not include the kernel source, if we
don't have kernel source ,
whether can we compile the driver (NIC).
I am confused, beacuse we need include many kernel header file, if you don't
have linux kernel
source (I means that there is no kernel source in /usr/src, whether we can
compile the driver module
successfully?), whether we can just use the header file in /usr/include?
thanks!!
Yiping Chen

2001-04-27 13:05:04

by Feng Xian

[permalink] [raw]
Subject: RE: About rebuild 2.4.x kernel to support SMP.


when you install redhat linux, you can select to install the
kernel-include and kernel-source
but I think the kernel include files come with redhat7 (i am not sure
about rh6) won't let you to compile a kernel module by using
/usr/include/linux (they ask you to use /usr/src/linux-xxx)

you can dnload the kernel source from ftp://ftp.kernel.org and build you
own kernel/NIC driver.

Alex

On Fri, 27 Apr 2001, Yiping Chen wrote:

> I have a important question about compile driver here, sometimes we install
> RedHat Linux
> When you boot the system , it will not include the kernel source, if we
> don't have kernel source ,
> whether can we compile the driver (NIC).
> I am confused, beacuse we need include many kernel header file, if you don't
> have linux kernel
> source (I means that there is no kernel source in /usr/src, whether we can
> compile the driver module
> successfully?), whether we can just use the header file in /usr/include?
> thanks!!
> Yiping Chen
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

--
| Feng Xian *
| (o_ *
| //\ *
| V_/_ *