Basic kernel module help needed!

Basic kernel module help needed!

Post by ericdec.. » Tue, 28 Nov 2000 04:00:00



Hi,

I'm new to device drivers for Linux, and I have a irritating problem
that I've been working with for a while.

I've written the most basic kernel module ever (the "hello world"-type)
and still I can't get it to work. The problem is "unresolved externals"
while running insmod. It doesn't matter what external function I try to
use (strlen, memset, register_char_device etc. etc.) ALL of them
becomes "unresolved".

I use the 2.2.12-20 kernel distributed with red hat 6.1, and I have
installed ALL sources/headers/libs from the distribution CD. The system
is clean, installed on a brand new hard disc. No earlier or later
versions of the kernel even close to my computer!

Even more irritating, if I try to #include <asm/uaccess.h> (as one
should if the kernel is later than 2.2.0) the module won't even
compile. I get a bunch of undeclared functions (boot_cpu_data_R4d12d1d7
etc.)

I am a desperate man, ready to take desperate actions on my linux
computer. If someone doesn't help me, the poor thing will fall 10
floors downto a cold and wet parking lot.

/Eric D

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. aha1542, module vs kernel, kernel doesn't work, need kernel

The reason I need it as kernel code is so that I can put /usr on a
seperate 8.2g drive.

When aha1542 is built as a module, it pops up immediately before the
login screen, and everything works as planned.

Remaking the kernel with it set to be kernel code, it starts the bus
scan during the boot, not too long after the ide devices are found, but
then goes into a double loop of resetting the device 2-4 times, then the
whole bus, then repeats the device, all the while saying it can't abort
the call, but evertually it will find the drive at address 0 on the bus
and go on, at which point it repeats this procedure for address one,
each pass thru the loop taking about 5 minutes, finding the quatum 8.2g
at each addreess in turn until it gets to address 4, at which point the
discovery phase eventually finds a Colorado T4000s at address 4, which
is its correct address, then also at 5 & 6.

Then it apparently repeats the loop, asking each device for its capacity
details, and going through this same error recovery time killer, except
that this time it only gets partial answers only, and only at the
correct address for the device.

I let it go through all that, and finally got a login screen and did so,
but was unable to open either device, not even with fdisk /dev/sda.

I've used several of these cards in years past, and have always had to
edit the source to lower the address of its port by 0x100, to the 0x230
area, and to reset the irq from 11 to 10.  Without those changes the
module doesn't init itself, ever, and it has required those changes to
the code in order to function on 3 different motherboards I've run it
on.

But here, I need the direct in the kernel version so I can put /usr on
it.  Put it in the kernel, and it fails miserably, both for 2.2.18,
2.2.19, and 2.4.2.  The 2.4.2 failure surprised me as that code has a
diff that looks to be in excess of 10k from the older code.

So why can't I put aha1542.o into the (apparently any) kernel?
Inquiring minds want to know. (-;

Cheers, Gene
--

        email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
 <http://www.iolinc.net/gene_heskett>
This messages reply content, but not any previously quoted material,
is ? 2001 by Gene Heskett, all rights reserved.  Due to recent
changes in M$ lusers TOS, mail from msn.com, msn.net, microsoft.com,
microsoft.net, hotmail.com, and hotmail.net is auto-deleted, unread.
--

2. Logical Block Addressing (LBA) for Disk

3. help building kernel: help need to pass module specifuc parameters to scsi card

4. random musings

5. a basic question - kernel module

6. TCP/IP RPC with Solaris 2.4 and Sybase 10.0

7. Need help rebuilding Kernel or just the usb/dc2xx.c module

8. Performance to expect... I've sought, but not found

9. HELP NEEDED:packet filtering, kernel module programing

10. Need help installing Zoran video capture kernel module

11. Need Help with 2.0.8 Kernel and Modules

12. HELP NEEDED:packet filtering,kernel module programing

13. HELP NEEDED : loadable modules kernel 1.2.13 EMAIL please