Level 2 cache activation code?

Svante Signell svante.signell at telia.com
Sun Nov 30 18:14:01 CET 2003


I have now made a small kernel module based on l2_cache.c giving the
following output:

Nov 30 17:46:56 cl-dual kernel: Configuring L2 cache...CPU signature of
6b0 so no L2 cache configuration
Nov 30 17:46:56 cl-dual kernel: Enable Cache
Nov 30 17:46:56 cl-dual kernel: done.
Nov 30 17:46:56 cl-dual kernel:  cache_on  installed

No speed-up seen. Extremely slow as before. Any hints? mtrr is OK, I
believe. Is it the microcode??

The processor is an 1.3GHz Celeron Tualatin, with CPUID: 6b0. According
to the code in l2_cache.c newer CPUs than Coppermine (680) does not need
the L2 setup code. Is this the case?
if (signature < 0x630 || signature >= 0x680) {
  printk_debug("CPU signature of %x so no L2 cache configuration\n",
signature);
  goto done;

I few questions:
1. Does a kernel module have to be a standalone object without linking
stage?
2. How to add libraries to link with, if unresolved externals show up.
3. How to create a kernel module consisting of more than one object
file. Now I include the needed source files into the main one.
4. The cflags used are:
CFLAGS = -D__KERNEL__ -DMODULE -I ./include -I$/usr/src/linux/include -I
/usr/src/kernel-headers-2.4.22-1 -O2 -Wall -g
5. My module code looks like:
cat cache_on.c

#include <linux/module.h>
#include <linux/kernel.h>
(#include source files and other header files)

#define PFX " cache_on "

int init_module(void)
{
 p6_configure_l2_cache();
 printk(KERN_INFO PFX " installed \n");
 return 0;
}

void cleanup_module(void)
{
 printk(KERN_INFO PFX " removed\n");
}

On Tue, 2003-11-25 at 22:56, Svante Signell wrote:
> Ron and Takeshi,
> 
> Thanks for the tip. I'll try that next. Any pointers how to create a
> kernel module? So far I have only been writing code for user space.
> 
> On Tue, 2003-11-25 at 22:06, ron minnich wrote:
> > what I did to test this code was to build a kernel module for my linux, 
> > with this code inside, and insmod the kernel module.
> > 
> > ron
> > 
> > _______________________________________________
> > Linuxbios mailing list
> > Linuxbios at clustermatic.org
> > http://www.clustermatic.org/mailman/listinfo/linuxbios
> _______________________________________________
> Linuxbios mailing list
> Linuxbios at clustermatic.org
> http://www.clustermatic.org/mailman/listinfo/linuxbios



More information about the coreboot mailing list