Alpha Module Wierdness 2.0.30

Phillip G Ezolt (pe28+@andrew.cmu.edu)
Sun, 21 Sep 1997 23:41:27 -0400 (EDT)


Hi all,
This has completely stumped me. The documentation that I have found
on modules has been somewhat sparse, but everthing looks right.

I was trying to debug a kernel module with printks, and odd strings were
being printed to the screen. I wittled the module down to basically nothing,
and the same error occurs.

The source:

#include <linux/version.h>
#include <linux/kernel.h>

char kernel_version[] = UTS_RELEASE;

int init_module(void){
printk("Hi.");
return 0;
}

void cleanup_module(void){
printk("Bye.");
return;
}

I expect to see:

/sbin/insmod ./test_driver.o
<sc 347(0,0,0)>Hi.
/sbin/rmmod test_driver
<sc 347(0,0,0)>Bye.

I really see:
/sbin/insmod ./test_driver.o
<sc 347(0,0,0)>Hi.
/sbin/rmmod test_driver
<sc 347(0,0,0)>2.0.30

The kernel version is 2.0.30, on an AlphaStation 250.

The compiler is gcc 2.7.2.1 from redhat 4.2. The system is Redhat 4.2, but
has the 2.0.30 kernel with the alpha patches applied.

I also tried this with the default redhat kernel, but the same thing occured.

As a side note, the milo I use is from 2.0.22, NOT 2.0.30, because 2.0.30
refused to work.

In my experience so far, only the first printk will not be corrupted.
Every printk after that either gives out garbage or pieces of strings
that do not pertain to that printk.

It is almost as if the string pointer passed to the printk function was
not the right one.

The module was compiled with the following flags:

gcc -c -fno-strength-reduce -D__LINUX__ -DLINUX -D__KERNEL__ -DDEBUG
test_driver.c

Any ideas?

Phil