LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I compile a driver (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-compile-a-driver-33273/)

lexy 10-20-2002 03:13 AM

How do I compile a driver
 
lo all.

I posted last week on how to get my card ethernet card
working on linux. I was useing lindows at the time.

Ihave messed about with linux for a short time but
always go back on windows cause I cant get any net
access.

All I have to do is make this work.

Quote:


Installation:

1. copy the source code fealnx.c to Linux,

2. compile the source code, the instruction for compiling the driver is
as follows:

#gcc -DMODULE -D__KERNEL__ -I/usr/src/linux/net/inet -Wall
-Wstrict-prototypes -O6 -c fealnx.c

3. insert the driver as module,

#insmod fealnx.o

4. bind your card to an IP address

#ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}

5. add your card to IP routing table,

#route add -net ${NETWORK} netmask ${NETMADK} eth0

6. now, you should be able to ping local network.

Also how do I get this info ?

Quote:



#ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}

#route add -net ${NETWORK} netmask ${NETMADK} eth0

Whick linux o/s would be the best I have installed
redhat and lindows in the past.

What about mandrake and the others ?

I see it as if I get on the net with linux then I can
learn from this point. I dont have to go back to windows
as all I use my comp @home for is icq and surfing.

thanx.

acid_kewpie 10-20-2002 04:02 AM

well you shouoldn't need to compile anything, your card driver is fairly common, and is *probably* already precompiled on your system, so you should only need to configure it with netconfig or something similar.

lexy 10-20-2002 07:51 AM

lo

I installed redhat 7.2 to attempt to get this card working on linux.

I got this info about the card.

Quote:


01:02.0 ethernet controller: myson technology unknow device 0803

subsystem: surecom technologys: unknow device 1320
flags: bus master medium devsel, latency 64 irq5

io ports adbc00 [sixe=256]
memory adefdfcc00 32bit , non-prefetchable [size=1k]
expansion rom adefde0000 [disabled] [size=64k]
capabilites: [88] power management version2

I also took the card out of the comp and got the model number : "ep-320x-s1"

I download a new driver set and this in the linux install dir contents.

dir : mtd80x.v021
file: kern_compat.h
file: Makefile
file: mtd80x.c
file: pci-scan.c
file: pci-scan.h

This is the new info in the read me.

Quote:


******* This document contains instructions on Linux driver installation for *******
******* SURECOM EP-320X-S/S-1 100/10M Ethernet PCI Adapter *******

The Linux driver for Myson MDT8xx compatible MAC chipset on
this adapter has been embedded into Linux systems since kernel
version 2.4.5, and this makes this adapter automatically detected
and installed with the driver supported by Linux system.

Therefore,

1. If your Linux kernel is still old version 2.2.x, please use
and refer the driver supported for kernel version 2.2.x in
\Linux\2.2.x directory on the driver diskette.


2. If your Linux kernel is version 2.4.x previous than version
2.4.5, please get the latest kernel file from the web site of The
Linux Kernel Archives (http://www.kernel.org/). Then, install and
re-compile the downloaded latest kernel file into your current
Linux system.


3. If your Linux kernel is or has been patched to version
above 2.4.5 but you have not enabled or configured the MTD8xx
compatible driver as dynamic loadable or embedded system module, then you could follow the step 4 to enable the driver
and re-compile the kernel.

If you could use the console command "#locate fealnx.o" to
locate the module driver file or find the driver module file
fealnx.o in kernel source /usr/src/linux-2.4.x/drivers/net in
your Linux system, then you could load module into system by
console command "insmod fealnx.o" and then "ifconfig eth0 up" to bring this adapter to work.

You could use console command "linuxconf" to configure
this adapter card too.


4. If your Linux kernel is any new version above than 2.4.5
(included) and it is a new installation, you can configure the
kernel by following console commands to enable the driver for
SURECOM EP-320X-S/S-1 100/10M Ethernet PCI Adapter.

#/usr/src/menuconfig

Enable the option of "Myson MTD-8XX PCI Ethernet support"
in "Ethernet (10 or 100 M bit)" of "Network device support" as a
loadable module or system default module.

#make dep

#make clean

#make bzImage

#cp /usr/src/linux-2.4.X/arch/i386/boot/bzImage /boot

Then, edit /etc/lilo.conf, run "/sbin/lilo", and then reboot
your Linux system. After new kernel has been rebooted,
it will automatically load the driver for this adapter.

I tryed to set the ipconfig acid_kewpie card is not
installed m8.

I am a newbie so some tips on setting all this up please.

nonamenobody 12-16-2002 04:35 PM

according to http://linuxrouter.kldp.org/lancard.htm, you need the tulip driver, for the Surecom EP-320X-S1.


All times are GMT -5. The time now is 03:18 AM.