For those interested, I recompiled the 2.4.21-0.16mm-mdk kernel with pretty 
aggresive athlon-xp optflags, and it works fine. These flags also work on 
other kernels I have tried. The trick in making them take when compiling 
kernels is putting them in the linux-2.4.21-0.16mm-mdk/arch/i386/Makefile, in 
the following manner.

First, I installed the MDK multimedia kernel & kernel-source rpms in the usual 
manner. Then I copied the resulting source directory placed in /usr/src to my 
"kernels" directory in ~/home. 

Then copy the .config file to another location, go to a console, cd to 
linux-2.4.21-0.16mm-mdk and do make mrproper. Then go into the above mentioned 
Makefile, and comment out the current MK7 flags, and add the new flags 
stanza, like shown below.
---------------------------------------------------
#ifdef CONFIG_MK7
#CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null 
>/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 
-malign-functions=4"; fi) 
#endif

ifdef CONFIG_MK7
CFLAGS += -march=athlon-xp -falign-functions=16 -falign-labels=1 
-falign-loops=16 -falign-jumps=16 -mfpmath=sse -maccumulate-outgoing-args 
-fprefetch-loop-arrays
endif

The =16 values set things to corelate precisely with the athlon-xp's design 
parameters, which I would think are pretty important. This is said to allow 
the on-die cache to be fully utilized and filled with 16 byte segments.
----------------------------------------------------

Then do make xconfig, and import the config file you copied before, and do any 
editing needed. (In my case, I removed some 3rd party stuff that caused 
depmod errors for modules concerning ethernet cards etc. not found when 
rebooting, but it does no harm.) Save the config file, edit the main extra 
version Makefile (not the one you put flags in) like below:

VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 21
EXTRAVERSION = -0.16mmxp


Then do the usual:

make dep
make clean
make bzImage
make modules
su to root
make modules_install

You will get a warning in make modules (among a few other minor ones) as shown 
here:

cc1: warning: -fprefetch-loop-arrays is not supported with -Os

This only occurs in one small section where -Os apparently takes over, and 
does no harm AFAIK. -Os then releases, and -fprefetch-loop-arrays comes right 
back. (Can anybody explain this?) As long as you get done with no actual 
errors and compile bail outs, you are OK.

I don't do the usual make install, but manually copy bzImage and System.map to 
/boot, adding the kernel name-version, like below.

[EMAIL PROTECTED] linux-2.4.21-0.16mm-mdk]# cp System.map 
/boot/System.map-2.4.21-0.16mmxp
[EMAIL PROTECTED] linux-2.4.21-0.16mm-mdk]# cd 
/home/wrc1944/kernels/linux-2.4.21-0.16mm-mdk/arch/i386/boot
[EMAIL PROTECTED] boot]# cp bzImage /boot/bzImage-2.4.21-0.16mmxp

Then edit lilo, adding the stanza for the new "xp optimized" mm kernel, 
omitting the initrd line:

image=/boot/bzImage-2.4.21-0.16mmxp
        label=2421mmXP
        root=/dev/hda10
        append="devfs=mount hdc=ide-scsi acpi=off quiet"
        vga=788
        read-only

Save, run lilo, and then reboot.

I don't think I left anything out.

wrc1944







Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to