basic on Wed, 21 Feb 2001 23:00:26 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] FW: Complining Modules


dear Anthony:
  i have been reading Linux Device Drivers by Rubini  (o'reilly)
   on pages 18-20
  "to build object file that the kernel can load" use this makefile
  INCLUDEDIR = /usr/include

  CFLAGS = -D__KERNEL__  -DMODULE  -O -Wall -I$(INCLUDEDIR)
**** the next line is mine  ... i do not use make files but
     you need the gcc to get the xxxx.o file ***********
   gcc -c xxxx.c   ( this gives the object file xxxx.o)
  
  #Extract version number from headers
  VER = $(shell awk -F\" '/REL/ {print $$2}'
        $(INCLUDEDIR)/linux/version.h)
  
  OBJS=	xxxx.o       (xxxx is your module name)
  
  all: $(OBJS)
  
  install:
       install -d /lib/modules/$(VER)/misc /lib/modules/misc
       install -c xxxx.o  /lib/modules/$(VER)/misc
       install -c xxxx.o  /lib/modules/misc 
     
  clean:
        rm -f *.o *~ core
   
   -------------
   end of makefile
    use insmode to load it
	
(you can just look at your version & then VER = 2.2.18
      if you are on 2.2.18 )
      good luck,
      sandy
On Tue, Feb 20, 2001 at 02:15:21PM -0800, Inkdog.com Staff wrote:
> 
> 
> -----Original Message-----
> From: Thanous [mailto:Thanous@dca.net]
> Sent: Tuesday, February 20, 2001 1:48 PM
> To: drexeldg@dca.net
> Subject: Complining Modules
> 
> 
> Hi list
> 
> Can anyone tell me how to compile a module into the kernel?
> I have a driver for a SCSI control card... and I have a tape back up which I
> want to run off the card.  I went to the manfacturs web site... and I got a
> .h and .c file.  But I need a .o file for the driver to interface properly.
> Then I need to make it start at boot time.... but I think I took care of
> that ok.
> 
> I know you can use gcc to do this.. and I am pretty sure its gcc
> SOMETHING... but its the something that I could use some assistence with.
> 
> Thanks all
> 
> Anthony
> 
> 
> 
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug
> 
> 


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug