my kernel hack: whereto

rrbishop@dhinternet.com
Sat, 16 Nov 1996 15:47:41 +0000


Hello all!
First, apologies if I am off topic for this list (I was directed here
by someone at #Linpeople). Here is the deal: I am running version
2.0.20 on a 386/25 which has been upgraded to a 486/50 using a Texas
Instruments TI486SXLC (cyrix based) processor replacement. It is a
clock doubling 486SX with an 8k cache. The chip wakes up with both
the clock doubling and cache disabled. I have written a small C
program to stuff the necessary bits into the cache control registers
using ioperm() / outb_p() / inb_p() to get the chip *ready* for
cacheing. I know it works because querying the appropriate cache
control register after executing my program reports the correct
values, and benchmarking shows that the system is running clock
doubled. However the cache itself does not seem to be enabled at
this point. According to documentation received from the engineers
who built the chip (as well as the cxpatch available on the net) the
last little detail that needs to be accomplished is to 'enable'
cacheing by stuffing the appropriate value into the CR0 486 control
register. This is the place at which I'm stuck. Attempting to
access CR0 at runlevel 5 ? results in SIGSEGV. I feel that it
desireable (and apparently _necessary_) to accomplish this task as
part of the boot process. For philisophical reasons I think it makes
sense to implement this as a module. My concern is that it may
already be too late to access the CR0 register by the time the boot
process gets to the point of initializing loadable modules. Is this
the case or can my program move a value to CR0 at the time the kernel
will execute it if it is written as a loadable module? I am asking
before trying because the cxpatch doc available on the net suggests
that the access to the CR0 register probably needs to go into the
'kernel proper'. Will that be necessary? If so, please advise me as
to 'whereto' add the code, i.e init, etc. Thanks in Advance!

rrbishop@dhinternet.com
P.S. Tons of THANKS and KUDOS to Linus (and ALL you contributors) for
making such a !Fantastic! implementation of a *NIX available for my
box at such a perfect price point!