
These two simple assembly programs let you turn on and off the
internal level one cache of i486 (and higher) processors. Since
the %cr0 register can't be accessed to alter the CD and NW bits
from user space (even with iopl) another way to do it is via
a syscall (which runs inside the kernel) You can't execute the 
two instructions "invd" and "wbinvd" in user space either....

To make:
========

as l1off.s -o l1off.o
ld -s l1off.o -o l1off

as l1on.s -o l1on.o
ld -s l1on.o -o l1on

You then have to apply the patch which implements the syscall
that the above two programs will use and rebuild the kernel.

cd /usr/src/linux
patch < /home/myname/cachectl_diff
make clean ; make zImage

The patch is against v2.0.27 but will probably apply to a wide
range of kernels.

To use:
=======

Simply type l1off and/or l1on

You can use the bogomips stand-alone program/package to verify that
your machine is slower with l1off, etc. The following output is
an example for an i486dx2-66.

Paul Gortmaker.

---------------------------------------------------------------------

ratbag:/home/paul/cache_mods# bogomips
Calibrating delay loop.. ok - 33.55 BogoMips
ratbag:/home/paul/cache_mods# l1off
Calibrating delay loop.. ok - 9.47 BogoMips
ratbag:/home/paul/cache_mods# l1on
Calibrating delay loop.. ok - 33.55 BogoMips
ratbag:/home/paul/cache_mods# exit
