All of lore.kernel.org
 help / color / mirror / Atom feed
* Building a new module from an existing one
@ 2001-02-22 17:06 Marcus Ramos
  2001-02-22 18:22 ` Richard B. Johnson
  2001-02-22 19:25 ` Fernando Fuganti
  0 siblings, 2 replies; 3+ messages in thread
From: Marcus Ramos @ 2001-02-22 17:06 UTC (permalink / raw)
  To: linux-kernel

Hello,

I plan to make a few changes to 3c90x.c (Ethhernet driver) located at
/usr/src/linux-2.2.16/drivers/net, in RH7. Since the correspondent
object file 3c90x.o resides in /lib/modules/2.2.16-20/net, I ask: how
shall I proceed in order to have the C file properly compiled and placed
in the right place, so that the modified version replaces the previous
one after system boot up ?

Thanks in advance,
Marcus.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building a new module from an existing one
  2001-02-22 17:06 Building a new module from an existing one Marcus Ramos
@ 2001-02-22 18:22 ` Richard B. Johnson
  2001-02-22 19:25 ` Fernando Fuganti
  1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2001-02-22 18:22 UTC (permalink / raw)
  To: Marcus Ramos; +Cc: linux-kernel

On Thu, 22 Feb 2001, Marcus Ramos wrote:

> Hello,
> 
> I plan to make a few changes to 3c90x.c (Ethhernet driver) located at
> /usr/src/linux-2.2.16/drivers/net, in RH7. Since the correspondent
> object file 3c90x.o resides in /lib/modules/2.2.16-20/net, I ask: how
> shall I proceed in order to have the C file properly compiled and placed
> in the right place, so that the modified version replaces the previous
> one after system boot up ?
> 
> Thanks in advance,
> Marcus.
> 

I assume this is serious. Therefore, I answer.

cd /usr/src/linux-2.2.16
make modules
make modules_install

You should be able to test your changes without having to reboot
and without overwriting the existing (working) driver. If you are
doing a lot of work, I suggest you make a script:

#!/bin/bash
ifconfig eth0 down
rmmod 3c90x
insmod /usr/src/linux-2.2.16/drivers/net/3c90x.o
ifconfig eth0 xx.xx.xx.xx netmask mm.mm.mm.mm broadcast bb.bb.bb.bb
route add -net xx.xx.xx.0 netmask mm.mm.mm.mm broadcast dev eth0
route add default gw (etc)


Once you have verified that your revised driver works as intended,
then you do `make modules_install` to put it into the correct place
for the next boot.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Building a new module from an existing one
  2001-02-22 17:06 Building a new module from an existing one Marcus Ramos
  2001-02-22 18:22 ` Richard B. Johnson
@ 2001-02-22 19:25 ` Fernando Fuganti
  1 sibling, 0 replies; 3+ messages in thread
From: Fernando Fuganti @ 2001-02-22 19:25 UTC (permalink / raw)
  To: Marcus Ramos; +Cc: linux-kernel



On Thu, 22 Feb 2001, Marcus Ramos wrote:

> Hello,
> 
> I plan to make a few changes to 3c90x.c (Ethhernet driver) located at
> /usr/src/linux-2.2.16/drivers/net, in RH7. Since the correspondent
> object file 3c90x.o resides in /lib/modules/2.2.16-20/net, I ask: how
> shall I proceed in order to have the C file properly compiled and placed
> in the right place, so that the modified version replaces the previous
> one after system boot up ?

after you compile it with something like this command line
gcc -c 3c90x.c -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer \
    -fno-strength-reduce -pipe -m486 -malign-loops=2 \
    -malign-jumps=2 -malign-functions=2 -DCPU=486 -DMODULE -D__KERNEL__

just copy the generated 3c90x.o to /lib/modules/2.2.16-20/net, overwriting
the old 3c90x.o (made a backup if you wish)



Fernando Fuganti



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-02-22 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-22 17:06 Building a new module from an existing one Marcus Ramos
2001-02-22 18:22 ` Richard B. Johnson
2001-02-22 19:25 ` Fernando Fuganti

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.